Comments (5)
I tested a bunch between an Arduino and my STM32F103. It actually looks like the first byte of the scratchpad is being occasionally read wrong by the STM32. The least significant bit is always 1 (it's always an odd number). For all of the rows where CRC match is false, if you set the LSB to 0, the CRC matches. I'm still not sure what is causing this though.
from onewire.
With the exact same wiring on the same device, when I use an Arduino library to interface with the ds18b20 it works fine, but when using this library, the LSB of scratchpad[0] is always 1 (causing the CRC check to fail ~50% of the time). So I'm fairly confident I've ruled out hardware issues, but this also isn't an issue with the CRC algorithm so I'll update the issue name.
from onewire.
I wrote my own onewire implementation, and used all of the timing values provided by the Maxim 1-wire document (https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/126.html) and all of the readings look correct for me now. I suspect there is a timing issue in this library, since it doesn't use the recommended timings in some places.
I'll publish my implementation in the next few weeks when it's more complete if you want to reference it.
from onewire.
The root cause was timing issues because the default clock speed on the stm32f103 (which I was using for testing) was too low.
See stm32-rs/stm32f1xx-hal#169 for more details. Closing since this shouldn't be an issue with this library.
from onewire.
Hi there, great to hear you could fix your issue. I know that using DelayUs
is not great, and it can cause runtime issues on hardware that is faster/slower as the one I am testing it on locally (stm32f103) #11.
from onewire.
Related Issues (13)
- README.md: reset() expects one parameter HOT 1
- Readme doesn't compile
- Get rid of DleayUs HOT 1
- Request example of use in a function (ie type sig) HOT 1
- Allow setting resolution?
- always CRC mismatch unless parasite mode even the VCC is connected
- Porting to avr-hal HOT 1
- Can't get this crate to work with embassy HOT 2
- Can't find devices HOT 22
- Focus library on generic one wire support HOT 3
- Example in README outdated HOT 1
- Cannot get this crate to work with atsamd-hal HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onewire.