How to do Acknowledgement polling with AT24C5I2C EEPROM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to do Acknowledgement polling with AT24C5I2C EEPROM

654 次查看
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 项奖励
回复
2 回复数

528 次查看
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 项奖励
回复

636 次查看
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 项奖励
回复