Interfacing S32K144 with an external EEPROM using I2C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interfacing S32K144 with an external EEPROM using I2C

938 Views
Rambo1310
Contributor I

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

0 Kudos
6 Replies

911 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Rambo1310,

Can you menasure the bus with an oscilloscope?

If there is no ACK, check the address.

 

Thanks,

BR, Daniel

0 Kudos

901 Views
Rambo1310
Contributor I
The 7 bit address is 0x50.
The read/write bit i.e the 8th bit is 0 for writing and 1 for reading.
I have implemented the logic in the respective function.
0 Kudos

900 Views
Rambo1310
Contributor I

The write and read cycle as per datasheet has been attached for your reference. I don't understand where am going wrong with this. Is the I2C peripheral initialized and APIs used correctly?

 

0 Kudos

893 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

 

 

0 Kudos

866 Views
Rambo1310
Contributor I

I made these changes but didn't work. Same status is returned.

I even tried changing the component to I2C_pal from LPI2C but still no luck am not able to write and read the desired data.

PFA the modified code.

 

0 Kudos

834 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos