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.

TMS320F280049C: I2C interrupt stops execution after some time all of random

Part Number: TMS320F280049C


Dear all,

I am facing an issue on i2c interrupt. I will describe the program structure first. I have 3 pwm interrupts running at 16 khz , 6 khz , and 1 ms .I  have a i2c working under 400 kbits/s (fast mode) inside with 2 slaves both are io expanders. one for writing other for reading. in  16 khz pwm interrupt am trying to read and write i2c data. 1 byte of read and 1 byte of write. Writing will happen all the times when 16khz interrupt is served. Reads will only happen when a flag is enabled by a gpio interrupt. This gpio interrupt only gets generated when a change in inputs of io expander is sensed , the slave generates a low output which is catched as an gpio interrupt. i2c interrupt takes about 128 us to finish execution. 

the problem is reading and writing will happen alright for some time , out of random i2c interrupt stops getting served and no frame is visible on the bus . all the other pwm interrupt , gpio interrupt all still runs , its just the i2c interrupt is not running . i have checked this by having variable count inside the isr and gpio toggling also . I cant come into a solution on why out of random time interrupt stops getting triggered. Please help.

Thanks and regards,

Stevin Martin.

  • Stevin,

    This is very implementation specific problem. It would be difficult to speculate what might be going wrong. But, I can provide some pointers to rootcause the problem.

    What is the source of I2C interrupt? Did you check whether there are any pending I2C interrupt (check I2CSTR registers) and corresponding PIEIFR registers when I2C interrupt are not triggered. Has the corresponding PIE interrupt flag is acknowledged (PIEACK).

    Regards,

    Manoj

  • Hi Manoj,

    I don't think it is an implementation issue. because when i run the same piece of code in the main loop disabling other PWM interrupts its working good.And also i tried this and worked.. When a i do  i2c read operation then i would disable one of the pwm interrupt and enable it back when i have finished reading . This way i think i am gaving slot for i2c interrupt to function. But then again why it is am not  getting this issue in the beginning of execution ?. I have also checked with debugger about interrupt pending .. there are no interrupts pending all good.

    thanks and regards,

    Stevin

  • Stevin,

    What I2C events  are configured to trigger I2C interrupt? We need to understand under what condition you see this problem? In otherwords, we need to reproduce this problem more reliably. 

    Regards,

    Manoj