PDA

View Full Version : Bit banging a DS18B20



BeanieBots
25-01-2006, 18:42
Has anyone ever tried to bit bang a DS18B20 temperture sensor?
The object of my excersise is to read 3 sensors in under 1 second. The readtemp12 command takes 750mS so that is out of the question. (short of 3 dedicated 08Ms and a lot of handshaking).
My thought is to send the "start conversion" command either to each sensor sequentially or possible all three together, wait 750mS (whilst processing the previous readings) and then read the scratchpad data.
It certainly looks within the grasp of a PICAXE but I wondered if anyone had tried it before I spend days trying to get the timing right.

hippy
25-01-2006, 19:22
I recall the 1-Wire Bus uses some very short pulses for signalling, and the data line has to be switched from output to input and sampled about 15uS after initiating a read, which would be hard to do on a PICAXE.

andypro
25-01-2006, 23:13
I've tried other 1 wire devices...and well, it's impossible. The OW protocol has some very strict and very short timing criteria that the picaxe jsut plain cant do.

If your not affraid of surface mount, you could try the DS2482XXXX series of bus converters. I believe one does I2C, one does SPI, and there is a 1 channel (I think) and an 8 channel, which is the one I've used. The full part number is DS2482-800.

--Andy P

BeanieBots
26-01-2006, 07:31
Thanks guys. After reading further, I've come to much the same conclusion. I'll have a browse for bus converters but I'm quite sure a couple of 08Ms will be up to the task.