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.

DM6446, how to call I2C inside an interrupt service routine?

    Whenever I call call I2C

    I am implementing an Aptina CMOS sensor's AE function, I need to control sensor's exposure time in the vertical blanking time of sensor. So I am in an interrupt service routine triggered by sensor's Vsync (or I should say CCDC's VINT), while inside the routine, I need to send command to sensor by I2C. I guess it's I2C's interrupt hand my system up.  Is my guess correct? How to avoid that? Is there others way to do that? 

  • Normally, you do not want to do time consuming tasks in an ISR;  there are often restrictions imposed by operating systems to limit what you can do in an ISR as a way to enforce this.  To be honest, I am not sure if I2C transaction from within an ISR is valid or not, but even if it is, it is probrably not a good idea.  What I have seen done in various operating systems is to have the ISR do minimal status update and communicate (via mutex, semaphore...) with another thread to kick off more time-consuming tasks.

  • Hi,Juan Gonzales

    i want to read and write I2C bus with interrupt on DM6437.

    And now ,the interrupt can work,but i don't know how to code the interrupt void I2C_ISR(void) content to let I2C recv and send data correctly.

    would do give me some demo code or meterial about that?

    thank you.