-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
extmod/modonewire: Adjust timing within "onewire_bus_reset" #5290
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
Conversation
It would be interesting if that fixes the problem. Edit: Ah I see that complete module will be new to esp32 as your 2nd PR removes the esp32 specific onewire library. That makes more sense to me, hopefully it'll work reliable. |
That might be true when looking at it from one perspective. But if in between ESP32 switched from unicore to dual-core mode, that could well change some subtle details on its runtime behavior. Also, Espressif Systems are still working on mitigating silicon bugs on their rev.1 and rev.2 revisions through compiler workarounds. Some bad cache coherency issues have been fixed lately, which also can contribute to different timing behavior. All that will also depend on which compiler/toolchain has been used for creating the builds. In that light, depending on how solid the timing of
As far as I could see, |
Thanks for the patch. Did you have a problem with reading onewire sensors on the esp32, and then after applying this patch it worked? I'm really not sure this would fix anything because for these two delays they only require a minimum delay to work. So they could in principle be much longer delays and it should still work correctly. The main use of |
Not quite, I just though I might have spotted something which missed to be adjusted accordingly with respect to the timing problems @kevinkk525 outlined above. Unfortunately, we are stuck on Pycom MicroPython right now and our real problem is pycom/pycom-micropython-sigfox#356. So, feel free to close this right away, sorry for the noise and keep up the spirit! |
Ok, in that case I'll close this issue. If testing shows that this change fixes things then it can be reopened. |
Document missing 'frequency' parameter on ParallelBus.c
Dear George and the MicroPython community,
while working on [1,2], we just added #5289 and also stumbled on #4647. While we can't say for sure, we might have spotted a minor glitch which could possibly have negative impact on the correct timing of things.
So, maybe adjusting two function calls within
onewire_bus_reset
tomp_hal_delay_us_fast()
instead ofmp_hal_delay_us()
could make things work for @kevinkk525 on the ESP32 platform.Please correct me if I am wrong on that and feel free to close this PR right away if this is going into the wrong direction.
With kind regards,
Andreas.
[1] https://community.hiveeyes.org/t/untersuchung-und-verbesserung-des-timings-bei-der-ansteuerung-der-ds18b20-sensoren-unter-micropython/2309
[2] pycom/pycom-micropython-sigfox#356