AnsweredAssumed Answered

FRDM-KL46Z I2C Accelerometer

Question asked by Janusz Kowalski on Nov 24, 2015

Hi Everyone,

 

I am trying to make an accelerometer application using built-in MMA8451Q module on FRDM-KL46Z board. I am using Keil uVision editor. It's something new to me so please be patient

My problem starts with I2C communication. I am trying to read a value from WHO_AM_I register but I always receive the WHO_AM_I address - not the value in it (0x1A).
I tried to search for similar projects or codes, but most of them are made with additional libraries (mbed for example) in other editors (CodeWarrior). What am i doing wrong in I2C_ReadRegister_uc function? How it's supposed to be done?

 

I am including my C files so you can see the code.
Please help And thanks in advance

Original Attachment has been moved to: I2C.h.zip

Original Attachment has been moved to: I2C.c.zip

Original Attachment has been moved to: main.c.zip

Outcomes