MMA8452Q I2C Read Single Byte problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MMA8452Q I2C Read Single Byte problem

ソリューションへジャンプ
1,332件の閲覧回数
bdp42
Contributor IV

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

ラベル(2)
1 解決策
730件の閲覧回数
TomasVaverka
NXP TechSupport
NXP TechSupport

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):

Who_Am_I+register+read.JPG.jpg

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.

元の投稿で解決策を見る

2 返答(返信)
731件の閲覧回数
TomasVaverka
NXP TechSupport
NXP TechSupport

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):

Who_Am_I+register+read.JPG.jpg

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.

730件の閲覧回数
bdp42
Contributor IV

Thanks Tomas,

It's what I thought but I just wanted it confirmed.

Bruno

0 件の賞賛
返信