MMA8541 driver for Linux 3.2?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMA8541 driver for Linux 3.2?

1,675 Views
clappe
Contributor I

Hi, is there a MMA8541 driver for linux 3.2? In the support section, I only see one for 2.6.35

I've been trying to write a simple test program by following some examples, but whenever I try to read back any register, all I get is 0xFF. I have no problems talking to some other chips on the same i2c bus (rtc), so I think the problem has to do with the repeated-start.

Or, I could just compile in the driver and access it through that.

Thanks for the help!

0 Kudos
1 Reply

1,312 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Chris,

Yes, the MMA8451Q uses a combined I2C data transfer format and requires a repeated start condition after the second byte (register address).

For instance, 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):

81392_81392.jpgWho_Am_I+register+read.JPG.jpg

Also make sure that you are using a correct 7-bit slave address, which is either 0x1C (SA0 = 0) or 0x1D (SA0 = 1).

Regarding Linux drivers, I would let others monitoring this forum comment it.

Regards,

Tomas

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-489071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMMA8541%20driver%20for%20Linux%203.2%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-489071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20is%20there%20a%20MMA8541%20driver%20for%20linux%203.2%3F%20In%20the%20support%20section%2C%20I%20only%20see%20one%20for%202.6.35%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI've%20been%20trying%20to%20write%20a%20simple%20test%20program%20by%20following%20some%20examples%2C%20but%20whenever%20I%20try%20to%20read%20back%20any%20register%2C%20all%20I%20get%20is%200xFF.%20I%20have%20no%20problems%20talking%20to%20some%20other%20chips%20on%20the%20same%20i2c%20bus%20(rtc)%2C%20so%20I%20think%20the%20problem%20has%20to%20do%20with%20the%20repeated-start.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EOr%2C%20I%20could%20just%20compile%20in%20the%20driver%20and%20access%20it%20through%20that.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThanks%20for%20the%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-489072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MMA8541%20driver%20for%20Linux%203.2%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-489072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Chris%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EYes%2C%20the%20MMA8451Q%20uses%20a%20combined%20I%3CSUP%3E2%3C%2FSUP%3EC%20data%20transfer%20format%20and%20requires%20a%20repeated%20start%20condition%20after%20the%20second%20byte%20(register%20address).%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EFor%20instance%2C%20a%20single%20byte%20read%20from%20the%20WHO_AM_I%20register%200x0D%20looks%20like%20this%20(note%20that%20it%20is%20for%20the%20MMA8652FC%20I%20have%20on%20my%20desk)%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2281392_81392.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2281392_81392.jpg%22%20style%3D%22width%3A%20899px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120881i5319DC3D82834506%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2281392_81392.jpg%22%20alt%3D%2281392_81392.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Who_Am_I%2Bregister%2Bread.JPG.jpg%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Who_Am_I%2Bregister%2Bread.JPG.jpg%22%20style%3D%22width%3A%20899px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6874i887BB87B667853ED%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Who_Am_I%2Bregister%2Bread.JPG.jpg%22%20alt%3D%22Who_Am_I%2Bregister%2Bread.JPG.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAlso%20make%20sure%20that%20you%20are%20using%20a%20correct%207-bit%20slave%20address%2C%20which%20is%20either%200x1C%20(SA0%20%3D%200)%20or%200x1D%20(SA0%20%3D%201).%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegarding%20Linux%20drivers%2C%20I%20would%20let%20others%20monitoring%20this%20forum%20comment%20it.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ETomas%3C%2FP%3E%3C%2FLINGO-BODY%3E