I2c repeated start question
-
i am getting funny values when i read back from registers i wrote.
i am trying to get my accelerometer working and it is somehow kind of working .. i wonder if this could be a problem with micropython
the datasheet says" The MMA8451Q expects repeated starts to be used to randomly read from specific registers."
what does that mean? how can it affect normal micropython code?
-
@iotmaker Are you using clock stretching? This is not supported yet.
Can you share your code? The information given is not enough to answer your question. 100th of options could cause the issue.
-


the datasheet has this diagram when you read a register the master send device address, register address and then a SR repeated start condition..
i wonder if this is what the I2C library does in micropython?
-
@iotmaker The library is doing this correctly.
You don't have to bother about ST, AK, SR, R, NAK and SP things.
I'am not using the registers and using another I2C device.My code looks like this:
data = i2c.readfrom(addr, 6) -
But first you should send a command to start measuring.
The data sheet should tell you which one.
Command in my situation is:i2c.writeto(addr, bytearray(b'\x20\x24')) -
Thanks
looks like it is doing good now
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login