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.

TMS320F28379D: i2c_ex6_eeprom_interrupt example -- Delay too long between sends

Part Number: TMS320F28379D


Tool/software:

Hello TMS32 team,

This issue is detrimental to my application/testing and is gating my progress. Please support.

I am trying to write code to send I2C data (3 bytes) every 5 kHz but I am encountering so much grief trying to get the I2C data to send at a consistent rate.

It is necessary that the 3 bytes are sent before the next rising edge.

However, I observe that after x amount of transactions , there is a long delay and the I2C module gets hung up before finally sending/releasing the data through the bus. I observed it can take up to 30k or 40k transactions before a delay/bus hung up such as this occurs. This means the issue is intermittent or caused due to an edge case. I tried using the polling method but that also caused a delay so I thought the interrupt would resolve the issue--it does improve ( I can send more data before the delay occurs but it still occurs).

My code is based on the "i2c_ex6_eeprom_interrupt " example. I also tested with this project (example 1 within the .c file) and I add a 200 us, same issue. The 200 us delay should be more than enough to send 3 bytes of data with I2C rate of 400kHz , at least I would think.

Code is modified to use example 1:

EEPROM.currentHandlePtr     = &EEPROM;
    EEPROM.SlaveAddr            = EEPROM_SLAVE_ADDRESS;
    EEPROM.WriteCycleTime_in_us = 10000;    //6ms for EEPROM this code was tested
    EEPROM.base                 = I2CA_BASE;
    EEPROM.pControlAddr         = &ControlAddr;
    EEPROM.NumOfAddrBytes       = 0;

    //Example 1: EEPROM Byte Write
    //Write 11 to EEPROM address 0x0
    ControlAddr = 0x0;     //EEPROM address to write
    EEPROM.NumOfDataBytes       = 3;
    TX_MsgBuffer[0]             = 1;
    TX_MsgBuffer[1]             = 2;
    TX_MsgBuffer[2]             = 3;
    EEPROM.pTX_MsgBuffer        = TX_MsgBuffer;

    while(1){
        status = I2C_MasterTransmitter(&EEPROM);

        //Wait for EEPROM write cycle time
        //This delay is not mandatory. User can run their application code instead.
        //It is however important to wait for EEPROM write cycle time before you initiate
        //another read / write transaction
        DEVICE_DELAY_US(200);
    }

Prior history: TMS320F28379D: Issues with I2C Controller Not Sending x Bytes (non-repeater mode) 

Note: I use external 2.2 kohm pull-up resistors not the internal pull-ups.

Thank you,
Jennifer

  • Hi Jennifer, 

    Do you have access to a Saleae logic analyzer that would enable you to capture a long stream of data? Since the problem is intermittent, it's difficult to understand what may be causing this. It would be helpful to see a large sample of I2C communication data and see what the data lines look like right before this error occurs. Is the I2C communication working in all other transactions besides these intermittent pauses?

    Regards,

    Peter