Interfacing EEPROM BR24T512-3AM with S32K144. I have tried to establish the interface by writing a value to a particular address and then reading it back from the same address.
However I'm getting the status while sending and receiving data over I2C as "STATUS_I2C_RECEIVED_NACK".
PFA the sample code for this task. Kindly review and help sort out the issue.
Thanks
Hi @Rambo1310,
Can you menasure the bus with an oscilloscope?
If there is no ACK, check the address.
Thanks,
BR, Daniel
There is no need to initialize the driver and to set the address in every function, do it just once.
The driver changes the R/W bit in the address depending on the LPI2C API used:
LPI2C_DRV_MasterSendDataBlocking()
LPI2C_DRV_MasterReceiveDataBlocking()
Don't change the address using the LPI2C_DRV_MasterSetSlaveAddr() function.
It is important to measure the bus using an oscilloscope or a logic analyzer to make sure the signals are correct.
Regards,
Daniel
I don't see any obvious issue in the code.
As I said, it is necessary to scope the bus, and compare it with the expected signal as per the datasheet of the EEPROM.
Regards,
Daniel