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.