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.

Transmit data to EEPROM via I2C

Other Parts Discussed in Thread: CONTROLSUITE, TMS320C28346

Hi all,

I now want to write data to EEPROM but TI's example ’i2c_eeprom' only shows the way to write 0-14 words to EEPROM due to the FIFO. However, I have to write more data to EEPROM so as to go on with my experiment. How can I achieve it by changing some settings?

In addition, if I want to write a large number of data to EEPROM, do I have to key in all of them one by one? For example, if I want to write one .hex file to the EEPROM, is there any convenient method to get it?

I am appreciate for any reply.

Best wishes!

  • Bin Yao,

    Like you already mentioned it, If your data size is known and it is a multiple of 2,3 or 4 you can set the FIFO to issue an interrupt every time the FIFO is full or ready to transmit the next four bytes. If not you have to send one byte at a time and service an interrupt for each byte received or transmitted. 

    Thanks

    Noah

  • Hi Noah:Berhanu,

    Thank you for your reply.

    Since I am confused about how the interrupt works, I have no idea how to modify the TI's example.  If I have an array in which the data are from 0 to 30, now I want to write it to the EEPROM. Could you share me with the code which achieve the funtion.

    Best wishes!

  • Bin Yao,

    what specific silicon chip are you using?

    The i2c_eeprom example in controlSuite shows how to transmit 2 bytes. Try changing the parameters of I2CMSG I2cMsgOut1 and I2CMSG I2cMsgIn1 structs and the I2C_NUMBYTES macro.

    Thanks

    Noah

  • Hi Noah:Berhanu,

    The chip I use is TMS320C28346. In my opinion, once 14 words have been transmitted, the program should jump into an interrupt in which I2CMSG I2cMsgOut1 should been refreshed and restart the transmission. Is it right?

    What confuses me most is when the interrupt touches. I hope you share me with the code about this part.

    Best wishes!