-
Notifications
You must be signed in to change notification settings - Fork 196
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
atsamd21e18a I2C #680
Comments
Doesn't look like you ever control the LED? Can try adding |
@sakian Sorry I shortened the code but below there is a loop where I blink the LED. |
I think you need to configure the peripheral clock then. Check this example out: atsamd/boards/metro_m0/examples/i2c.rs Lines 56 to 61 in e8fbf5d
When you enable, it waits for the register to be synchronized, which won't happen if the sercom isn't given a clock. You'll need to pass enable the peripheral clock, like in the example I linked. As an aside, it would be nice to have the |
@sakian Thanks, that was it. Since we are here at it I have another question, I am trying to communicate with this chip https://ww1.microchip.com/downloads/aemDocuments/documents/SCBU/ProductDocuments/DataSheets/ATECC608B-TNGTLS-CryptoAuthentication-Data-Sheet-DS40002250A.pdf and have successfully executed the wake call with the proper response but for some reason am getting a NACK with a payload that I know is working (tested and sent in another programming language). I suspect that the write function has a different behaviour than the one in Go (tinygo), but could be wrong. would you have an idea why I am getting a NACK in the two instances of i2c.write? |
I don't see anything wrong that sticks out to me. Probably need to go through standard debugging (make sure port is configured properly to talk to that chip, confirm data being sent is correct, probe data on wires to make sure it's correct, etc.). |
@hugolgst - did you get this sorted? Gentle suggestion: rather than posting images of code, it's helpful to use code blocks so that others can easily copy-and-paste, use search, etc. For bigger pieces of code, a GitHub gist is be a good option too. |
Hello,
I am writing code for this board using ATSAMD21E18A.
I would like to initiate an I2C connection but am failing with this code:
following https://docs.rs/atsamd-hal/latest/atsamd_hal/sercom/i2c/index.html
The LED stays on and nothing is happening, I am not sure why
The text was updated successfully, but these errors were encountered: