View previous topic :: View next topic |
Author |
Message |
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
ds18s20 with active pull-up and active pull-down |
Posted: Wed Aug 17, 2005 6:32 am |
|
|
Hello,
I already worked with an one-wire-sensor of Dallas. But now I wanted to use a longer wire to connect the ds18s20 and so I used the another circuit, which works with an active pull-up and an active pull-down. So the dallas is connected to the PIC18F258 with three wires.
My problem is tht I don't know how to program it. The only informations that I found were for the other circuit. But that is just with one pin connected to the pic, mine is connected with three. So I can't choose a ONE_WIRE_PIN.
Has someone already worked with such a circuit? Do I have to set two pins to a special signal and use the normal one-wire-programm to the third?
I don't know what to do and I am very angry to myself for changing the way of working with ds18s20. I would be very thankful for your tipps.
Have a nice week, pom
edit: It was not AppNote 244 as I said. I was wrong. |
|
|
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
|
Posted: Mon Aug 22, 2005 1:39 am |
|
|
I edited the text but the post was not set to the top of the frum, so I have to lift it by myself. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Aug 22, 2005 3:11 am |
|
|
Sounds interesting these active pull-ups, do you have a schematic or reference to documentation for this? |
|
|
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
|
Posted: Mon Aug 22, 2005 6:03 am |
|
|
hello,
the circuit for the active pull-up is described in the application note 132 of maxim. Look at figure number 8. The connection between ds1820 and PIC can be about 600 metres long.
But I don't know, how to program.
Bye, pom
AN132: http://pdfserv.maxim-ic.com/en/an/app132.pdf |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Mon Aug 22, 2005 8:12 am |
|
|
Well it's called one wire but it always needs at least two wires. One is the ground and the other the so called one wire. The devices hung off the one wire will need to parasitically extract power from the one wire unless they are fed by a third wire . Devices connecting to the wire are "wire ored " to each other. Any device bringing the one wire to ground will succeed in doing so even if another device is trying to go high. The issue the circuit you are using is solving is how fast the line can be returned to high....this is needed to continue charging other devices and also to gain speed in transmitting data. The circuit also relieves the PIC of having to sink the current when pulling low.The preferred connection should never drive the line high.....this can be done by using an external switch such as a FET or via an open drain pin on the PIC. An alternative to the open drain is to use an ordinary digital PIN on the PIC and drive low with an output of 0 and go high by setting the pin to float and letting a pull up get the line high.
You'll need to look at the code that writes to the TOUCH-PIN. Where there is a call to output_low replace it with your output low code that will activate the APD line. Where the touch code uses output_float you'll need to replace it with code that will activate the APU line. The reads to the touch pins should be OK. |
|
|
|