Skip to content
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

DS1820 temperature readings ESP32 in combination with FreeRTOS tasks leads to malfunction of the RMT Module #142

Open
sirpete83 opened this issue May 25, 2024 · 3 comments

Comments

@sirpete83
Copy link

ESP32 Wemos Lolin32

sketch with 3 additional FreeRTOS tasks leads to a significant lengthening of the set poriodes of the rmt module. I was able to narrow it down to the Onewire or the Dalles temperature library. If I remove Onewire completely from the sketch, then the times are correct again.
which surprises me a bit, because the onewire library doesn't seem to use rmt. And it's just fed with data and then runs in hardware, at least that's my assumption.
can someone confirm the problem?

@sirpete83
Copy link
Author

Hallo,
I looked at the OneWire code again and saw that this library deactivates the interrupts in order to maintain the timings. It's certainly not a problem for non-RTOS applications. But it will certainly stop all hardware timers and thus halt the tasks.
I don't expect a solution to the problem, but perhaps this insight will help others if they encounter timing problems in their RTOs application when using this library.

@tshcherban
Copy link

tshcherban commented Jun 6, 2024

There is a RMT-based OneWire library, so if you have a free RMT channel - u can use it for onewire communication

@uzi18
Copy link

uzi18 commented Jun 8, 2024

just try OneWireNg library https://github.com/pstolarz/OneWireNg

It supports OD:

All bus activities are performed respecting open-drain character of the 1-wire protocol.

During normal 1-wire activities, the master MCU GPIO controlling the bus is never set high 
(providing direct voltage source on the bus) instead the GPIO is switched to the reading mode 
causing the high state seen on the bus via the pull-up resistor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants