GithubHelp home page GithubHelp logo

Comments (5)

fuchsnj avatar fuchsnj commented on August 20, 2024

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.

fuchsnj avatar fuchsnj commented on August 20, 2024

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.

fuchsnj avatar fuchsnj commented on August 20, 2024

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.

fuchsnj avatar fuchsnj commented on August 20, 2024

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.

kellerkindt avatar kellerkindt commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.