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.

TMS320F28335: Writing EEPROM by I2C

Genius 3095 points
Part Number: TMS320F28335

Dear team:

My program is modified based on the i2c_eeprom routine provided by Ti.

When using the write by page function, I can only write 14 bytes of data + 2 bytes of address at a time. If the data exceeds 14 bytes, the interrupt cannot be entered and the write fails. However, the EEPROM I use can write 32 bytes of data per page. Is this problem due to the FIFO interrupt used by the routine, and the FIFO buffer can only be 16 bytes? How do I need to configure to write 32 bytes per page?

Best regards

  • Hi,

    F.F said:
    Is this problem due to the FIFO interrupt used by the routine, and the FIFO buffer can only be 16 bytes? How do I need to configure to write 32 bytes per page?

    Yes, this sounds related to the FIFO size. If using the FIFO and trying to write 2 address bytes + 32 bytes of data you can do something similar to the below:

    1. Configure the FIFO interrupt to occur when it is empty or a few bytes before, i.e. TXFFIL config
    2. Set I2CCNT equal to 34 (2 address + 32 data bytes)
    3. Fill I2CDXR with the first 16 bytes to be transmitted
    4. Start the transmission, MST, TRX, STT bits set
      1. Can set STP bit as well so that STOP condition is generated when I2CCNT reaches 0
    5. When FIFO interrupt triggers, fill next 'N' bytes of data within ISR
      1. If necessary SCL should be held low by the device during this time

    Best,

    Kevin