nanoframework / Home

:house: The landing page for .NET nanoFramework repositories.
https://www.nanoframework.net
MIT License
847 stars 75 forks source link

UART pins aren't configured correctly to use 1-Wire #540

Closed up-streamer closed 4 years ago

up-streamer commented 4 years ago

Details about Problem

The OneWire bus controller needs to release the line in order to allow the host to pull down it during read time slots.
As per stated in datasheets: "The control line requires a weak pullup resistor since all devices are linked to the bus via a 3-state or open-drain port (the DQ pin in the case of the DS18B20)..."

Target: ESP-32 Firmware image version: 1.4.0-Preview Worked before? If so, with which nanoFramework image version: Not checked

Description

This bug causes the master to held the line hi when the slaves tries to pull it to low level. This causes abnormal reading values when two slave devices are connected

Detailed repro steps so we can see the same problem

  1. Install two devices on OneWire bus. (tested using DS18B20)

  2. Do FindFirst() - FindNext() device ID.

  3. Make a loop to read temperature of one device.

  4. Touch on the selected device, as the temperature rises it will show inconsistent values.

  5. If an oscilocope is available, observe how the bus behave.

...

Expected behaviour

The OneWire bus should be able to handle more than one device.

Screenshot

1-Wire issue Waveform showing the Master "fighting" with the slave trying to put zero level on the bus.

Additional context

josesimoes commented 4 years ago

According to MAXIM's documentation on UART implementation of 1-Wire master the pins have to be Open Drain capable.

josesimoes commented 4 years ago

Will this be fixed when addressing #567 ?