Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

I2C and Interrupts

Anobium
2013-08-09
2013-08-18
  • Anobium
    Anobium
    2013-08-09

    My project is using two interrupts.

    -timer0 as a poll to blink some hardware @ 32000000 @ PS0_32
    -timer1 as a RTC from a valid clock source @ PS1_1. Clock works fine, with the clock ticking away very nicely.

    Same project then reads an MCP9800 via I2C using the standard routines and as the standard I2C routines disable interrupts and then enable (via I2Cstart and I2CStop respectively).... timer0 and timer1 are impacted.

    Has anyone got an I2CHandler function to keep the I2C busy? Or, any other ideas to keep the timers running (via interrupts)?

    As a temporary work around I have disabled interrupts in the standard I2C routines. Got a better approach or any improved I2C routines to get around the issue?

     
  • Anobium
    Anobium
    2013-08-18

    Resolved: I have found no issue with deleting the INT OFF and INT ON within the I2C routines.

    I may develop as set of improved i2C routines to poll the I2C bus when I get a moment.