-
Notifications
You must be signed in to change notification settings - Fork 26
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
Slave SDA stuck to zero #11
Comments
Does the code of the library gets stuck completely, or is just SDA stuck to low and the code runs further? |
I added a "being alive" signal in the main loop, which does not show any more, when the the SDA line gets stuck. So I guess, it gets stuck inside the library code. It seems to happen during the execution of an onrequest call-back function. I can send you the code, if you want. However, it usually takes quite some time before the error shows up. |
I thought a while about this. For pure slave mode there are only 2 places, where a block can happen:
Can you check, if the start condition is completed correctly by your master in the case of a stuck? Maybe you can capture it with a scope, or you just check the state of the SCL line. |
I noticed that the lockup happened during the transfer of 4 bytes from the slave to the master. The first 2 bytes were transfered OK, the second 2 bytes were 0. So, my best guess is that it happens inside the onRequest callback function. |
I'm experiencing this issue as well and am not able to resolve it given the info above. Hardware: Jetson Nano is Master on its I2C bus 1 (pins 3 and 5) This is the code I'm running on the ATTiny85 (16MHz)
I noticed that when I use the Out of desperation, I skipped the detection and went straight for sending data to the ATTiny85. Using the smbus python library and can send data that is successfully received by the ATTiny85. I can use the ATTiny85, but am troubled by the prospect that the SDA pin can get stuck low. Detection shouldn't cause a device to hang. Was the source of the problem ever properly identified? Is there a solution? |
Using the library as a slave client on an ATtiny85 with 1 MHz clock, I experienced quite often that the SDA line got stuck to zero. Disabling the Timer0 interrupt (responsible for counting millis etc) seems to help. I haven't seen this problem again even running the slave client for quite some time. I am not really sure whether this is problem of the library or of the way Arduino implements the Timer0 IRQ routine. I just wanted to mentioned the problem so that others might be aware of the potential problem.
The text was updated successfully, but these errors were encountered: