Skip to content

extmod/modonewire.c reliable timings for onewire.#13171

Merged
dpgeorge merged 1 commit intomicropython:masterfrom
eliaswimmer:onewire_timings
Dec 15, 2023
Merged

extmod/modonewire.c reliable timings for onewire.#13171
dpgeorge merged 1 commit intomicropython:masterfrom
eliaswimmer:onewire_timings

Conversation

@eliaswimmer
Copy link
Copy Markdown
Contributor

When using long cables for sensors on onewire e.g. ds18b20,
the current default timings might be to optimistic.
Thus leading to bus failures and CRC errors.

Timings given by https://www.analog.com/en/technical-articles/1wire-communication-through-software.html give stable results.

@eliaswimmer eliaswimmer changed the title conservative timings for better reliability extmod/modonewire.c reliable timings for onewire Dec 10, 2023
@eliaswimmer eliaswimmer changed the title extmod/modonewire.c reliable timings for onewire extmod/modonewire.c reliable timings for onewire. Dec 10, 2023
@github-actions
Copy link
Copy Markdown

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (06df3b2) 98.40% compared to head (5b70c10) 98.36%.

❗ Current head 5b70c10 differs from pull request most recent head 2e101a8. Consider uploading reports for the commit 2e101a8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #13171      +/-   ##
==========================================
- Coverage   98.40%   98.36%   -0.04%     
==========================================
  Files         159      159              
  Lines       21075    20989      -86     
==========================================
- Hits        20738    20646      -92     
- Misses        337      343       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpgeorge dpgeorge added the extmod Relates to extmod/ directory in source label Dec 15, 2023
@dpgeorge
Copy link
Copy Markdown
Member

See related #7050.

When using long cables for sensors on onewire e.g. ds18b20, the current
default timings are too optimistic, leading to bus failures and CRC errors.

Stable results are achieved with the timings given by
https://www.analog.com/en/technical-articles/1wire-communication-through-software.html
@dpgeorge dpgeorge merged commit 2e101a8 into micropython:master Dec 15, 2023
@dpgeorge
Copy link
Copy Markdown
Member

I merged #7050 first, which fixed the read timings (there was a long discussion there).

This PR is also merged, fixing the write timings.

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extmod Relates to extmod/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants