For a project I am using an LPC824 MCU from NXP and I want to read out data from the accelerometer over I2C. This accelerometer is the MMA8453Q. Looking into the datasheet of the accelerometer I see the following:
From my understanding this means that you give a start signal, you write the device address and put write behind it, you get an acknowledgement and so on.
The address I have to write is the following:
the register I chose for now was 0x0D which is the "Who am I" register, this should always be read as 0x3A.
For people familiar with NXP examples I based myself on one of them. This is the code I have atm:
*txData = 0x0D; SetupXferRecAndExecute(0x1C, txData, 1, rxData, 0); SetupXferRecAndExecute(0x1C, txData, 0, rxData, 1);
and this is what it looks like on the scope
So as i can see I send the Device adress twice, first I write the register address and than i want to read it, but it gives 0x00 back. Can someone pls help me? Thanks in advance!