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.

TMS320F28035: Read and write operation using EEPROM through I2C

Part Number: TMS320F28035

Hi ,

example code of i2c is working fine for one time run . but i want to convert code in repetitive mode . i have commented pass () code and defined in I2cMsgOut1.MsgStatus = I2C_MSGSTAT_SEND_WITHSTOP

but  interrupt I2C_ARDY_ISRC   is generating   rather than  I2C_SCD_ISRC in next cycle . so pls guide us to what i have to change in setting of i2c initialization for repeating the code. or suggest it is happening due to

some hardware issue. 

  • Hi Navneet,

    Can you explain your application a little more? What do you mean by "convert code in repetitive mode"? What is the part number of the EEPROM you are using?

    I'd imagine what is happening is the Slave address portion is being NACKed during the I2CA_WriteData function causing I2C_ARDY_ISRC to trigger (i.e. the communication is ended before writing the MemHigh/Low adress and MsgBuffer bytes to the slave). Looking at the EEPROM device datasheet might give you some insight into how to start up the communication again, or it might be the EEPROM is just not ready to receive more data.

    Looking at the I2C waveforms should help in your debug as well.

    Hope this helps,
    Kevin
  • Hi Kelvin,

    the application is calibration of parameters . i want to store more data in eeprom and can use the code in continues write mode and then read mode not one time write and read mode . i changed the code accordingly but the only issue is when code coming out of i2c interrupt it
    the massage status is again initialized and stuck in that loop .
  • Hi Navneet,

    OK. You'll likely need to change some of MsgStatus checks (if/else statements) and re-declarations (CurrentMsgPtr->MsgStatus =...) within the application to make it continuous. I believe the i2c_int1a_isr interrupt will need to be altered quite a bit for continuous reads/writes to work.

    You could even redesign the application to not use the MsgStatus's if you want, or use them in a way that makes more sense to you.

    Best,
    Kevin
  • hi i have changed the code but between 2 write cycle if i gave 4ms delay it is working fine but i reduced delay second time write function is not working .
    sample code:

    EEPROM_WRITE(0x00,0x12);
    DELAY_US(4000);
    EEPROM_WRITE(0x01,0x34)
  • Hi Navneet,

    How are you finding it doesn't work in your tests when you reduce or remove the delay? Can you share your EEPROM_WRITE() function with me?

    What EEPROM part number are you using? There might be some explanation for this on the datasheet.

    Also, do you have instruments to probe the I2C waveforms during these writes/reads? It's often good to look at the waveforms to make sense of what's going on.

    Best,
    Kevin