I am trying to interface AFE4404 with K65 and K53. The slave is getting powered and the clock is also there. AFE4404 registers are 24 bit. So I did the following change to write the data onto registers. I can see the content getting updated in I2C1_D register. I am working with MQX and bare metal code to get the interface up and running.But no luck
void MMA7660WriteRegister(unsigned char u8RegisterAddress, uint32_t u8Data1)
uint32_t u8Data =0x000200;
/* send data to slave */
I2C1_D = u8RegisterAddress;
I2C1_D = (u8Data & 0xFF0000)>>16;
I2C1_D = (u8Data&0x00FF00)>>8;
I2C1_D = (u8Data & 0x0000ff);
But when probing with a logic analyzer I can see only S and P pulses and nothing more.
Any idea on why this happens?
Is there any stable working code in MQX to interface I2C peripheral? The example projects gets locked up.