Skip to main content
briankaz
Associate III
July 26, 2021
Solved

How to do selective read from I2C EEPROM where write cycle followed by read cycle is required with no STOP condition in between?

  • July 26, 2021
  • 1 reply
  • 1249 views

I'm confused about how to set AUTOEND and other I2C parameters to execute the selective read illustrated in the attached timing diagram. I need to write the address to read from in write mode, then output another START condition right away, then I can read the byte in memory in read mode.

But I'm not sure how to "end" the address write without setting AUTOEND=1 or explicitly setting the STOP bit, but I understand that will send a STOP condition, which I do not want. And it looks like I can't change the R/W mode to R without somehow stopping the address write.

Am I missing a key I2C parameter that I should be setting to enable this selective memory read?

Thanks!

-Brian

This topic has been closed for replies.
Best answer by briankaz

OK, I think I've got the answer. I needed to set AUTOEND=0 before writing the two address bytes, then after transmitting them I needed to wait for I2C_ISR.TC = 1, then set AUTOEND=1 and the R/W bit to read mode before reading the data byte.

1 reply

briankaz
briankazAuthorBest answer
Associate III
July 26, 2021

OK, I think I've got the answer. I needed to set AUTOEND=0 before writing the two address bytes, then after transmitting them I needed to wait for I2C_ISR.TC = 1, then set AUTOEND=1 and the R/W bit to read mode before reading the data byte.