This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C read/write using LC512 EEPROM

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am trying to write code that will read and write to an LC512 eeprom (datasheet attached) connected to an F28335 DSP. The eeprom is connected to the DSP with pins A2 to A0 of the eeprom connected to ground.

I am unable to confirm if I am successfully writing and reading data to the eeprom. I have used the Example_2833xI2C_eeprom project in controlSUITE, but my code needs to write 500 pages with 128 bytes per page. I also need to be able to read the 500 pages of data from the eeprom.

I believe the problem is how I am interpretting the slave address as shown in the DSP datasheet versus the control code-slave address-R/W bit for the eeprom. In the example code from TI, the slave address is 0x0050 which corresponds to a control code of 1010 plus 000 for the slave connections A2, A1 and A0. But this slave address doesn't account for the Read/Write bit.

In the LC512 datasheet, it states to write 10100000 (0x00A0) followed by the address bytes then the data bytes. The 0x00A0 is the control code plus slave address plus the R/W bit. 0 is for writing.

2783.24LC512_EE.pdf

For reading, a 10100001 (0x00A1) is followed by address bytes then data bytes.

I am confused. Is this taken care of by setting I2CSAR = 0x00A0 for writing or do I set I2CSAR = 0x0050 then write 0x00A0 to the I2CDXR register? The example code shows I2CSAR = 0x0050 but doesn't address the read/write bit specified by the LC512 datasheet.

The comments in the example code state the code was designed for a board that schematics show the use of an LC512 eeprom.

Help!!!!!

Thank you,

Chuck