I am working on S32K144 I2C. I want to use it in polling method. I tried but I am unable to get correct data. I am communicating with an external EEPROM. Please help, if it will be through an example code, it will be better for me.
Thanks & Regards,
I tried with example code which is given in S32K Design Studio. It is working but It is in interrupt method I want to use in polling method.
I am trying to use example code you provided in above reply. I am always in "LPI2C0_Master_IRQHandler" method and value of MSR is 0x2002001. I am not understanding why i am not able to read data.
My main file has just below instructions from your example file
err = I2C_read_reg(SLAVE_ADDRESS, 0x0C, buffer);
Trying to see if i can read register with address 0x0C into buffer which is just one byte.
Can you please help me understand it.
I am ok with even interrupt method, can you share similar sample code if you have. I am running it on S32K144EVB-Q100 Evaluation board
Since MSR_PLTF flag is set, the slave is probably keeping SCL or SDA low for more than PINLOW cycles.
Have you tried monitoring the bus with a logic analyzer?
Please note that the I2C_read_reg function takes the read address of the slave as parameter.
We don't have any other example except for the SDK examples in S32DS.