DS18B20 power up time? - Page 1
Forum section: electronics / projects

author: MikeK
author_rank: Super Contributor
timestamp: August 24, 2022, 09:11:36 pm
content: This isn't covered in the datasheet. But I'm finding that both my known-genuine unit and my known-fake unit each require at least 50us to power up before they will give a valid presence pulse. I would have thought that the "recovery time" spec covered this, but that is only 1us. Can anyone provide input on this? I'm using 100us for wider allowance, but it's still a guess as I don't know what the spec is. By the way, I'm using a 4.7k pullup with 5.0 Vdd.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 24, 2022, 09:43:42 pm
content: I would assume that it's covered by the exit from reset description: "When the DS18B20 detects this rising edge [I assume this means due to end of reset pulse, or the initial power-up], it waits 15uS to 60uS and then transmits a presence pulse by pulling the 1-wire bus low for 60uS to 240uS."

author: MikeK
author_rank: Super Contributor
timestamp: August 24, 2022, 10:14:24 pm
content: No, I don't think so..as that doesn't work. I'm saying this doesn't work:1. Float bus high for less than 50us.2. Pull bus low for 500us.3. Float bus high for 70us.4. Check for presence pulse.But this does work:1. Float bus high for greater than 50us.2. Pull bus low for 500us.3. Float bus high for 70us.4. Check for presence pulse.If it was as you say then I could simply do #3 and #4 and that's it.

author: Benta
author_rank: Super Contributor
timestamp: August 24, 2022, 11:12:50 pm
content: Well, the 500 us pulse is for initializing the device, so anything before that is irrelevant, no?

author: MikeK
author_rank: Super Contributor
timestamp: August 24, 2022, 11:23:31 pm
content: Well...The 60us time is for the device responding to the master reset pulse, which itself is 500us. The device has to have power in order to recognize the reset. You can just apply power and expect the device to immediately produce a presence pulse, since it needed to witness the 500us low pulse in the first place.So, without a power up spec, I'm stuck guessing the necessary power up time. If I add more devices to the bus, or use longer wires, or whatever...then it's a crap shoot what will happen. Power up time should be a spec.

author: viperidae
author_rank: Frequent Contributor
timestamp: August 24, 2022, 11:38:57 pm
content: Have you measured how long the ds18b20 has enough voltage at its pins before the reset pulse? Maybe there is inductance causing a delay when the internal 25pf capacitor charges.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 24, 2022, 11:46:20 pm
content: The datasheet appears to assume that the device is continuously powered, or at least in a stable power state before any of the timing parameters are valid. I agree that the datasheet does not indicate how long the device needs to be powered before it is ready to operate, however, I would not expect it to be any less than the time it needs to exit the reset state - it could be considerably longer.The "Trec" of 1uS, between reads, is due to the device still be operation from the charge stored on its internal power-supply capacitor.Searching for "maxim" and "one wire devices" returns more information on using this bus, however, I can't see anything specific about the power-up time requirements.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 24, 2022, 11:51:22 pm
content: Posts crossed !Quote from: MikeK on August 24, 2022, 11:23:31 pmNot really. Power the devices continuously. Get the software working reliably, then reduce the pre-powered time until the devicees crap-out. They will all be doing similar things at power-up. However long this turns-out to be, double or tripple it to get some safety margin.Do you really have to power-down the devices?

author: MikeK
author_rank: Super Contributor
timestamp: August 25, 2022, 12:07:57 am
content: Quote from: Andy Watson on August 24, 2022, 11:51:22 pmBattery powered. Trying to minimize everything. I contacted Maxim, hoping they have something I can count on.

author: MikeK
author_rank: Super Contributor
timestamp: August 26, 2022, 12:54:59 pm
content: Maxim/AD got back to me today. They said no delay once Vdd comes up. I'll have to test some more.

author: MikeK
author_rank: Super Contributor
timestamp: August 26, 2022, 01:02:13 pm
content: I just realized that my attached SD card may be drawing too much current and starving the DS18B20. I'll test.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 26, 2022, 01:13:37 pm
content: I don't know about the power up requirements but use a lot of these in my central heating system. It is Raspberry PI based and I run OWFS under linux to read all of them. Works like a charm. It can do both parasitic powered and fully powered devices. I'm using fully powered, so a three wire setup.https://owfs.org/Made special hardware to allow for optical separation of the one wire buses. Took quite a bit of fiddling but it works with wire lengths up to ~90 meters. At least I tested it with a spool of cat5 utp cable of ~90 meters. In the active system the longest wire is about 17 meters.

author: MikeK
author_rank: Super Contributor
timestamp: August 26, 2022, 09:19:53 pm
content: Okay, it wasn't the power supply. It's the holding of the bus low for an extended period that is doing it.1. Power up.2. uC immediately sets the 1-wire bus pin to output low. (Legacy condition; I didn't think it mattered.)3. Some considerable time later (in the tens of milliseconds) the uC sets the pin as input (high-Z).4. Then, here is where the necessary 50 us comes into play. The bus needs to stay high for at least 50us.5. The bus is then brought low to signal the reset.If #4 is not at least 50us the reset fails. The extended low period of #3 is causing this problem. If I set the bus pin to input (high-Z) immediately after uC power up then I don't need any delay in #4.

author: MikeK
author_rank: Super Contributor
timestamp: August 27, 2022, 12:10:00 am
content: After a little more investigating...If the 1-wire bus is low for more than ~220us it needs a high time recovery of at least 50us in order to correctly acknowledge a reset with a presence pulse (and possibly other commands).

author: magic
author_rank: Super Contributor
timestamp: August 27, 2022, 07:40:05 am
content: Are the chips parasite powered?Obviously, holding the bus low for a long time, turns them off in such case.

author: MikeK
author_rank: Super Contributor
timestamp: August 27, 2022, 01:59:46 pm
content: Nope, regular powered.

author: MikeK
author_rank: Super Contributor
timestamp: August 27, 2022, 06:37:58 pm
content: Okay, I think I figured this out. While the 220us low pulse was not long enough for a reset pulse - according to the datasheet - I think it was long enough for the device to interpret it that way. The slave time slot after a reset pulse is supposed to be 410us. So I was unknowingly performing a reset and then attempting an actual reset in the middle of the slave time slot. So it failed.I think one reset attempt is not a robust way of doing it. I think it's much better to only call it a failure after several reset attempts. Weird things can happen on the bus.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 27, 2022, 07:16:33 pm
content: Especially when there are fake devices in play. I have a bunch that are definitely fake and have different timing aspects. A genuine or at least good clone takes quite some time to do a conversion. The fake ones I have finish in 1/10th of that time and don't have the full resolution the real ones have. Did a lot of measurements on them to make a claim to get my money back from Aliexpress.What I also found during the development of my optical isolation circuit is that real devices need some capacitance on the bus to work properly. Normally the driver IC's take care of this, but I had to add some extra to make it work. See the text in the schematic attached.Attached the schematics for those interested. Used a I2C to 1 wire bus IC and opto isolators on both sides of the line. Had to add a pulse restore circuit on the far side to make it work.

author: MikeK
author_rank: Super Contributor
timestamp: August 30, 2022, 02:55:34 pm
content: Here's what Maxim/AD had to say about the issue:Quote