Skip to content

OneWireBus does not seem to detect a DS18B20 on featherS2 #3822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Neradoc opened this issue Dec 13, 2020 · 6 comments
Closed

OneWireBus does not seem to detect a DS18B20 on featherS2 #3822

Neradoc opened this issue Dec 13, 2020 · 6 comments
Labels
bug circuitpython api espressif applies to multiple Espressif chips
Milestone

Comments

@Neradoc
Copy link

Neradoc commented Dec 13, 2020

Tested a DS18B20 temperature sensor (with the appropriate resistor) on a Feather S2 and other boards (like Feather M0 express) and the device is not found on the S2. I think I correctly checked it's connected to the right pin (it throws an error otherwise).

Feather S2:

import board
from adafruit_onewire.bus import OneWireBus
ow_bus = OneWireBus(board.IO17)
devices = ow_bus.scan()
print("Devices:",devices)
code.py output:
Devices: []

Feather M0 Express

import board
from adafruit_onewire.bus import OneWireBus
ow_bus = OneWireBus(board.A0)
devices = ow_bus.scan()
print("Devices:",devices)
code.py output:
Devices: [<OneWireAddress object at 20001b20>]
@tannewt tannewt added bug circuitpython api espressif applies to multiple Espressif chips labels Dec 15, 2020
@tannewt tannewt added this to the 6.x.x - Bug Fixes milestone Dec 15, 2020
@tannewt
Copy link
Member

tannewt commented Dec 15, 2020

OneWire is bit banged so it might be digitalio or timing related.

@CrossLAN
Copy link

Seems to be the same issue with STM32F405 Cortex M4 CPU on Adafruit Feather STM32F405 Express.
Find my investigations here: OneWire support STM32F405

Perhaps stm32duino / Arduino_Core_STM32 group is working on something similar (no. 412)?
Like @tannewt estimated something with timing.

Maybe this post is helpful even it is not CircuitPython related: Support OneWire device (ex: DS1822) #412

@CrossLAN
Copy link

CrossLAN commented Jan 5, 2021

For STM32F405 I filed a fresh issue #3935

@Hyna
Copy link

Hyna commented Feb 25, 2021

Hello,
I'm having the same issue on ESP32-S2 and nucleoG7.

with this simple code reset() returns always false:

import board
from adafruit_onewire.bus import OneWireBus
ow_bus = OneWireBus(board.XXX)
print("Resetting bus...", end="")
if ow_bus.reset():
    print("OK.")
else:
    print("Nothing found on bus.")

When i probe the bus (on nucleoG7), timing is not correct. According to source there should be common_hal_mcu_delay_us(480); with BUS low. Then bus is switched to input followed by common_hal_mcu_delay_us(70); After that the bus level is read.
In my case, first delay is only about 420 us, which is outside the spec for most of the 1wire devices.
1614286866569 Reset() returns false.

Even more strange behavior with 1wire eeprom AT21:
1614286866579

@dhalbert
Copy link
Collaborator

@Hyna see if #5866 helps for you.

@dhalbert
Copy link
Collaborator

Closing in favor of #5865, but will xref to here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug circuitpython api espressif applies to multiple Espressif chips
Projects
None yet
Development

No branches or pull requests

5 participants