OneWire Library with Overdrive support

Hello,

I was wondering if there is any issue with OneWire library porting it to support overdrive.

I am using this part, which is a EEPROM device that I need to register another PCB that’s interfacing with my Argon.

I used this library for the onewire bus, and modified the timing using this to support overdrive.

I hooked up the same setup using a Arduino Uno, using the OW overdrive library and it works fine, but once I hook it up to the particle, it doesn’t work. Hooking up to a scope, I see my delays are all over the place on the Argon. I put a delayMicroseconds(55) function call and my scope says its delaying for 65us. Also, my bit timing is all over the place on my scope. One loop bit 0 is fine and bit 3 is doubled in time, and the next loop, bit 0 is wrong, and bit 3 is fine.

Is there a known issue with delayMicroseconds? Some of the timing requires a nanosecond scale, are there any functions that will delay for nanoseconds? Or perhaps is there a library that supports overdrive.

Ive used many different pullups, from 10k to 850 ohms, so I don’t think it’s the drive strength of my bus. I am pulling it up to 3.3V and the chip only need 400uA to operate.

You will likely find it impossible to get accurate timing on Gen 3 devices (nRF52) using regular code, including using interrupts. There’s too much interrupt latency and the radio stack on the nRF52 runs at a high priority and tends to interrupt timing sensitive code.

The solution is to use one of the nRF52 DMA peripherals. I did this for the DHT22 which works great. It’s definitely possible to do the same for 1Wire, but I never got around to doing it.

Hey Rickkas,

Thanks for your reply, that is unfortunate.

Isn’t this issue resolved with ATOMIC_BLOCK wrapping around time sensitive code?

Or are there still high priority interrupts happening in the processor that can’t be blocked?

The ATOMIC_BLOCK won’t help because the radio interrupts are at a higher interrupt priority than user code.

Thanks for your help!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.