Connect with us

resetting timer0 interrupt flag

Discussion in 'Microcontrollers, Programming and IoT' started by foTONICS, Oct 4, 2013.

Scroll to continue with content
  1. foTONICS


    Sep 30, 2011
    So I was reading up on embedded C programming for the PIC and came across this code that uses the overflow flag of timer0 to trigger an interrupt. But don't you need to clear the flag before you exit the ISR, or does the compiler insert that bit of code by itself?

    I've attached a screenshot of said code:

    Attached Files:

  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    I would be looking at the set_timer0() function. Does that clear the interrupt as a side-effect?

    Page 6 of this tells more.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day