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.

TMS320F2800157-Q1: I2C BUS SCAN IS NOT WORKING PROPERLY

Part Number: TMS320F2800157-Q1

i2cLib_FIFO_polling.c init.c .....

I HAVE ATTACHED THE THE .C FILES ...I AM HAVING SVERE ISSUE THAT 

status = I2CBusScan(I2CA_BASE, pAvailableI2C_targets);..GOES INTO INFINIT LOOP..

i DONT KNOW THE RESAON BEHIND IT..

Kindly please look into it as soon as possible.

image.pngas marked i the photo highlighted in yellow it doesnt come out out of yellow infinite loop..

  • sorry I dint keep the picture above...the marked in yellow..its going in that loop only...Kindy please look into it as soon as possible..

  • Hi Muntazha,

    Can you confirm if you are seeing that the controller is sending the first START condition + address (0x50), EEPROM acks, and then because the TX FIFO is empty, the code is stuck in that one line? Can you try setting

    I2C_setDataCount(base, 0);
    before sending the start condition?

    In addition, you can remove the ; from the first line of the following segment:

    while(I2C_getStopConditionStatus(base) && attemptCount <= 3U);  // ← SEMICOLON
    {
        DEVICE_DELAY_US(I2C_Params->Delay_us);
        attemptCount++;
    }
    

    Best Regards,

    Aishwarya

  • What happened is that I changes the bit rate from 100kilo to 400 kilo hertz. Now its not going in the infinite loop....can you tell me why it's happening..as in example code its 100kilo hertz..

     I2C_initController(I2CA_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_50);

  • Muntaha,

    Let me take a look at this and get back to you within the end of the week.

    Best Regards,

    Aishwarya

  • Muntaha,

    There is a TX FIFO timing issue shown only at 100 KHz. It is possible you have weak pull up resistors causing clock instability at 100 kHz. Have you scoped the line and What is the pull up resistor values? What is the DEVICE_SYSCLK_FREQ?

    Also, why do you have the "attemptCount < 3" logic? It's not necessary.

    Best Regards,

    Aishwarya

  • The pull up is 4.7k

    100 mega hertz is frequency

  • Muntaha,

    Please review this document for bus capacitance related information as well and confirm: I2C Bus Pull-Up Resistor Calculation. 4.7 k is fine usually, but you may need to be at a different value, but assuming this is a custom board, the capacitance will matter too. The Launchpad already takes care of it.

    Software wise, can you provide a scope shot of the I2C operation at 100 KHz? Is SCL actually toggling at this rate or some other frequency? I would also try to place the code on line 49 after line 58.

    Best Regards,

    Aishwarya