Hi,
I'm having a problem with the MMA8452Q when attempting to read the WHO_AM_I register over I2C. We are using an iMX28 based platform running Linux 2.6.35. The device driver reads a value of 0 instead of the expected value of 0x2A. I've seen that on the I2C bus the controller sends a Stop Condition after writing the register it wants to read before starting to read the actual value. It does not use a repeated start.
The MMA8452Q data sheet states "....The MM8452Q expects repeated starts to be used to randomly read from specific registers". It also states (under Single Byte Read) "The Master (or MCU) transmits a repeated start condition (SR) and the addresses the MMA8452Q ($1D) with the R/W bit set to "1" for a read from the previously selected register.
Does this mean we MUST use a repeated start when reading random register values and that the MMA8452 does NOT support using a Stop condition after writing the register address before another Start/Stop to read the actual value?
Thanks,
Bruno
解決済! 解決策の投稿を見る。
Hi Bruno,
Yes, the MMA8452Q uses a combined I2C data transfer format and requires a repeated start condition after the second byte (register address).
A single byte read from the WHO_AM_I register 0x0D looks like this (note that it is for the MMA8652FC I have on my desk):
Please let me know if you have any other questions.
Regards,
Tomas
PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.
Hi Bruno,
Yes, the MMA8452Q uses a combined I2C data transfer format and requires a repeated start condition after the second byte (register address).
A single byte read from the WHO_AM_I register 0x0D looks like this (note that it is for the MMA8652FC I have on my desk):
Please let me know if you have any other questions.
Regards,
Tomas
PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.
Thanks Tomas,
It's what I thought but I just wanted it confirmed.
Bruno