I2C ACK Polling

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ScEn_283436
Level 5
Level 5
5 sign-ins First solution authored 100 replies posted

Hi,

With PSoC 5, I2C Master UDB configuration, I am interfacing to a Microchip 244AA64F EEPROM. My goal is to write information to the EEPROM, then read back to verifty. So far I have only been successful by using a fixed CyDelay() with a minimum of 4 milliseconds. The Microchip data sheet has a flowchart for ACK polling which I've attempted but my status from I2C is always I2C_MSTR_ERR_LB_NAK, then becomes I2C_MSTR_BUS_BUSY and never becomes I2C_MSTR_NO_ERROR.

Once the write has been performed a I2C_1_MasterSendStop()_is sent. Then I would like to somehow poll that the write cycle has completed and continue on.  The Microchip datasheet states that while a write cycle is in progress, the chip will not submit an ACK and recommends sending a start condition until the ACK is returned. This is how I've implemented it (unsuccessfully).

status = I2C_1_MasterSendStart(0x50, I2C_1_WRITE_XFER_MODE) ;

while(status != I2C_1_MSTR_NO_ERROR)

{

     I2C_1_MasterSendStart(0x50, I2C_1_WRITE_XFER_MODE) ;

}

Is there a simple, tried and true method for polling?

Thanks, Nick

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Try after a SendStart() follow a SendStop() when you want Ack polling.

Bob

View solution in original post

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Try after a SendStart() follow a SendStop() when you want Ack polling.

Bob

0 Likes