8 years, 1 month ago.

Anyone got a One Wire device working with the NRF51822?

Hi All,

Im trying to get a DS18B20 temperature sensor working with my NRF51822 board. I have setup the sensor, and can get it working with an Arduino with no problems. However when I connect it to the NRF51822, It doesn't appear to detect the sensor at all.

Has anyone had any luck with any one wire devices with the NRF51822? If so which library did you use to communicate with it? or did you write your own?

Im currently trying to match the timings etc with the ones from the arduino one wire library, but still no luck.

Thanks

Question relating to:

The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

Im having similar issues - the wait_us() does not seem to work properly - I can get the 1wire code working just fime for Nucleo, but no for W7500P or NRF dev board. On the other hand I have worked on a projekt using nRF51822 being developed using native libraries in Keil and it DID work for sure. So this looks like an mbed issue from where Im standing.

I have also used logic analyzer to do some analysis here and looks like both nrf5188 dev kit and w7500p dev kit have the same timing issue with onewire. Nucleo works like a charm (with the same code)

posted by Marcel Hecko 17 May 2016

I believe this is a change that was added to reduce the power consumption of the NRF51822.

See: https://developer.mbed.org/questions/4693/Lower-power-Mode-Nordic-nRF51822/

From the post:

We made some changes recently to lower baseline power consumption; in particular:

the system now starts with low-frequency clock by default (instead of using the external 16MHz clock). The high frequency clock is kicked into action automatically by the soft-device when needed; but now it doesn't remain active all the time. This by itself lowers the baseline consumption significantly. We make an effort to avoid using wait(), which is currently synchronous and wastes a lot of power. We've also re-implemented the Ticker APIs to use the RTC instead of a high-frequency timer. This makes a tradeoff between precision and power; and we believe power trumps over precision in the context of BLE.

Users are free to enable high-frequency timers explicitly if needed. If an application requires the use of high-frequency clock (for instance to do serial communication at high baud rates), then it must enable the high-frequency clock by writing into the appropriate control registers (please refer to the datasheets of the nRF51822). It would help to turn off the high-freq. clock at the earliest opportunity.

posted by Kapila De Silva 20 May 2016

1 Answer

8 years, 1 month ago.

If I recall correctly the NRF uses for low power purposes a timer for the Timer/wait statements which runs way too slow to be able to handle the normal OneWire libs.

Accepted Answer