Trying to get my Dallas DS18B20 up and running. I am using the Onewire and Dallas libraries. I see what looks like some communication on the scope but the controller is thinking its the default value of -127C which is basically just a ll 1's.
Code is good since I have it running on another type of controller. Heard that maybe the libraries for the Nano 33 are not correct?
Onewire is bit of an issue at the moment as its library is outdated. However, if you refer to this post: OneWire ?????????? - Nano 33 IoT - Arduino Forum there appears to be a solution to this although I haven't tried it myself.
Tried what was mentioned in that thread. Basically uploaded the latest and greatest onewire library from 2.3.4 to 2.3.5 and still no go. I diffed the two libraries and only found one line different which wouldn't have made a difference anyway as far as I can tell.
I am having the same troubles with my Nano 33 BLE.
It appears that OneWire now supports the Nano 33 IOT.
However, the latter is based on the SAMD21 microcontroller,
while the Nano 33 BLE is based on the Nordic NRF52840,
for which there is no support yet.
I already dug out the issue on Github, but as I understand it,
it will require someone who understands the NRF52 series MCUs as well as OneWire to fix it.
During some short (~1.5h) research I could find some work on onewire in the NordicDevZone.
Unfortunately, this is for the NRF51 series and then again,
I am not an expert and don't know much about the differences.
In this discussion, someone claims OneWire isn't too difficult to adapt for the NRF52.
I'll try to get in touch with him.
OneWire requires to follow very strict timing rules - otherwise does not work. Nano BLE has mbed OS thus so strict timing may not be achievable at all. It is not due to uC.
With the nano BLE you can use mbedos too (native code). So maybe worth looking at using the mbed library directly: DS1820 | Mbed
Although when reading through the above page, I see there's this comment about timing issues, which is a tricky one to resolve (apparently) - scroll to bottom of this page to see solution:
If timing is an issue, it might be worth taking inspiration from NeoPixel Libraries (Adafruit NeoPixel, NeoPixelBus, FastLED, etc) as they have to handle pretty exact 800 KHz data streams to get the LEDs to work. NeoPixels work fine on Nano 33's including the mbed versions.
From what I have seen it involves using noInterrupts(), sending the data and tracking elapsed microsecond time, and then re-enabling interrupts. However, doing this can interfere with other interrupt dependant libraries such as Servos.