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.

TMS320F28377D: Trouble reading EEPROM through I2C

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Hi,

I've written code to read an already programmed EEPROM through I2C peripheral, following are the steps i've done.

1.Configured I2C in Master transmitter mode and sent the Start Address of the EEPROM.

2.After the address has been set up, configured I2C in Master receiver mode to read the data sequentially upto 16 bytes(FIFO maximum) and stopped the data transfer.

3.Repeated the above step(without sending address again) to read blocks(16 bytes) of data until all the data reading is completed. 

The block by block reading is done when i get the STOP condition interrupt of the previous block..

So, when i run this software only reading of the first block was successful...when i keep the breakpoints to check  and ran the software, block by block reading was successful as i expected .Then 

i kept a delay of 1 usec just before i send the command for next block reading ,this time also it is working fine...Without delays it is not working as expected.

I've checked the status of registers when the transfer is unsuccessful and found that bus is free,no interrupts of any kind but the stop condition is not cleared.. I could not understand the situation..

whether the sequence i've programmed is faulty or any other thing  i am missing? please help

Regards,

Naveen.

  • Naveen,

    Does this failure occur always when run without delay?
    Do you have a scope capture of the failed transmission block?
    Do you have any other error detection enabled in the I2c? If so do you accidentally clear the stop bit during the error detection?

    I am going to get my hands on an eeprom and see if I can replicate the behavior tomorrow.

    -Mark
  • Naveen,

    just letting you know that I have found an EEPROM and am working to recreate something similar to what you are trying to accomplish.

    In the meantime, you might check out the I2C_boot.c for the device. it is actually very similar to your approach, but instead of reading 16 bytes at a time, it is just reading four (32 bits) . Here is a path to the boot code. There is some abstraction to the code so that it is reusable across all of the different boot modes, but I think that you should be able to follow along with the process.

    Edit adding the link to where in C2000Ware the boot rom source 

    C:\ti\c2000\C2000Ware_1_00_03_00\libraries\boot_rom\f2837xd\revB\rom_sources\F2837x_bootROM\cpu01-bootROM\source\I2C_Boot.c
    and
    C:\ti\c2000\C2000Ware_1_00_03_00\libraries\boot_rom\f2837xd\revB\rom_sources\F2837x_bootROM\cpu01-bootROM\source\Shared_Boot.c


    Let me know if you have any other information about your issues that might help get to a resolution quicker.

    Thanks,
    Mark

  • Hi Mark,
    I'll definitely look into the I2cboot.c and will update you on the behaviour.
    Thanks