cancel
Showing results for 
Search instead for 
Did you mean: 

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

briankaz
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
briankaz
Associate III

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.

View solution in original post

1 REPLY 1
briankaz
Associate III

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.