How to do Acknowledgement polling with AT24C5I2C EEPROM

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

How to do Acknowledgement polling with AT24C5I2C EEPROM

345 Views
Jusaira
Contributor I

Hi team,

I am using AT24C512C as external EEPROM with S32K146. I am able to write and read using I2C driver API functions LPI2C_DRV_MasterWriteData () and LPI2C_DRV_MasterReceiveData (). I put a delay of 5ms after writing into the EEPROM (as per AT24C512C the write cycle time is 5ms). Without the delay I am unable to read from the EEPROM. 

 

Referring to AT24C512C, they are suggesting to do acknowledgement polling to avoid using the delay. I tried it by continuously writing a dummy data into the EEPROM and checking the status (as of my understanding LPI2C_DRV_MasterWriteData() return success only if it get acknowledged). But it is not working as expected. Please provide some input on how to do the Acknowledgement polling.

0 Kudos
2 Replies

219 Views
Jusaira
Contributor I

Hi @VaneB ,

I want to know immediately when the serial EEPROM (AT24C512C ) write cycle has completed, so a subsequent operation can be started without waiting for the full write cycle time. As per AT24C512C datasheet to do the acknowledgement polling they are asking to continuously send the start condition followed by a valid Device Address byte with R/W = 0 and check the acknowledgement.

To do so I found LPI2C_DRV_MasterSendAddress() function in LPI2C_driver.c file.  But it is a static function and when I used it to do the acknowledgement polling it is not working.(Unable to read immediately after writing).

Is there any other method or API function to send the start condition with device address and do the acknowledgement polling?

Please refer the flowchart below:

Jusaira_0-1692776720374.png

 

0 Kudos

327 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Jusaira 

Could you be more specific about how it is not working as expected?

Does your external EEPROM send the acknowledgment? Did you see this in the frame? If yes, does the S32K1 detected? What is the behavior of the status flags?

I would appreciate it if you help me with this information to understand the issue.

 

B.R.

VaneB

0 Kudos