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.

Tiva i2c module, Solution & question.



Hello, first i want to say sorry for my english, i'll try my best

I've been a while using the tm4c123g and tm4c1294 tiva launchpads and some time ago i had the need of use the i2c module (on both) to communicate with eeprom memory but I was never able to do it and I never knew why so I just stoped trying.

But later on the problem came back when i had the need to use a digital accerelometer so i decided I need to fix it this time. I did a lot of research and got into the microcontroller's datasheet and finally found the answer!

The problem was that with the i2c library in tivaware you can only communicate via i2c with a "simple read/write operation", that goes like this:

S_DS_RW_AC_DA_NAC_ST

S: Start bit

DS: Device Select byte

RW: Read or Write bit

AC: Acknowledge bit

DA: Data_to_send or Data_to_read byte

NAC: No Acknowledge bit

ST: Stop bit

But what happen if you have to communicate with a device wich doesn't use this "simple operation"?, you simply can't do it with the tivaware's i2c library, so i did my own to solve that problem.

What i want to know is: ¿How many of you guys have had the same problem with the i2c module? because i wish to share my library but i don't know if will be worth it.

What do you think?

  • Hello Eduardo,

    My question back for your question: What is the "not-" simple operation? Please elaborate!!

    I have used the library for more complex operations....

    Regards
    Amit
  • for example, the write mode sequence for a "M24C64" serial eeprom is:

    S_DS_RW_AC_HBA_AC_LBA_AC_DA_NAC_ST

    where:

    HBA = High byte Address
    LBA = Low Byte Address

    I don't know how you did something like this just with the APIs in the tivaware's i2c library but i never couldn't
  • never could * sorry
  • Hello Eduardo,

    It would be I2CMasterControl with the following parameters for

    S_DW_RW_AC_HBA_AC : I2C_MASTER_CMD_BURST_SEND_START
    LBA_AC : I2C_MASTER_CMD_BURST_SEND_CONT
    DA_NAC_ST: I2C_MASTER_CMD_BURST_SEND_FINISH

    Regards
    Amit
  • Yes, i tried that a ton of times with no positive result

    And i've seen a lot of questions and problems related with thw i2c module....

  • Hello Eduardo,

    Questions and Solutions both exist on the forum and if something like this is indeed an issue, I would be sure that we would have to redesign I2C. However, since you insist that it is not working, I would like the forum to have your inputs on the solution as well. The more the merrier.... And in fact you are adding and strengthening the solution portfolio.

    Regards
    Amit
  • Gentlemen:

    I too am still having serious issues with the TM4C129X I2C communications as reported at:

    https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/343532/1500424

    Note in the “I got the solution!!!! :)” solution that there is apparently an ISR Handler which MUST call I2CMasterIntClear(I2C0_BASE);. Otherwise, that ISR will be constantly and repeatedly called till the line of code that follows is called in that supposed solution:

    I2CMasterIntClearEx(I2CBase, I2C_MASTER_INT_NACK|I2C_MASTER_INT_DATA);

    However, the required I2CMasterIntClear(I2C0_BASE); call in that ISR Handler will clear the I2C_MASTER_INT_DATA bit being examined in that supposed solution.

    I too would like a SIMPLE example of RELIABLE I2C code that actually works with no band-aid delays etcetera.

    Wasn’t the TM4C129X I2C communications thoroughly tested and verified before releasing it and the documentation to the public?

    By the way, in the TI Data Sheet, notice the statements that RUN is not to be set in BURST mode:

    However, the TivaWare defined constant I2C_MASTER_CMD_BURST_SEND_START sets the RUN bit (i.e. START and RUN).

    This is yet another example that the defined constant names in the TivaWare Peripheral Driver Library for the MCS register values are not intuitive but are misleading and confusing. One may be better off ignoring them.

    Yes, after digging deeper into the Data Sheet, I now understand that the Burst referred to must be related to the FIFO Burst mode.

    Thank you,

    Tim