I have a question regarding reading the I2C values. My current task is to connect a EEPROM to the I2C line. I have managed to write to the eeprom device, but I'm struggling about reading the written values.
If I have understood the datasheet for the CP2120 correctly, one has to first read the bytes from the I2C, which is stored in a internal register (RXBUFF). From there, I have to read this buffer in order to receive the written bytes?
Is this the correct approach?
Description of my functions:
myWriteFunction (command, num_bytes, slave_addr, [data1, data2, dataN])
myReadFunction (command, num_bytes, slave_addr)
myReadBuffFunction (command, dont_care)
Yes, you read the I2C data from RXBUFF after it is recieved by the CP2120. It may be useful to monitor both the I2C and SPI traffic with an oscilloscope or logic analyzer while implementing this code.
Thank you for the reply.
I figured it out, I missed one command line from the EEPROM device in order to read the stored value.