This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

interrupts

Many thanks for those who help me! (:

I got a problem here...

If i were to use 3 types of interrupts(external interrupt0, timer0 and timer1) in one single program, how should i go about writing the codes in the program?

Parents
  • It will "cause havoc" even if polled.

    No. A polling loop will/may run slower, but will continue to run. It is only the loop time that controls how often the signal gets polled. It is only when/if the program contains something silly like:

    while (signal_x_active) process_signal_x();
    


    that it gets into troubles if the signal is stuck.

    A constantly generated interrupt will totally kill anything that hasn't higher priority than the interrupt. The main loop may not get enough processor time to be able to notice the stuck interrupt.

    Since the majority of applications perform most of their jobs outside of interrupts, they are very sensitive to a interrupt handler constantly being trigged.

Reply
  • It will "cause havoc" even if polled.

    No. A polling loop will/may run slower, but will continue to run. It is only the loop time that controls how often the signal gets polled. It is only when/if the program contains something silly like:

    while (signal_x_active) process_signal_x();
    


    that it gets into troubles if the signal is stuck.

    A constantly generated interrupt will totally kill anything that hasn't higher priority than the interrupt. The main loop may not get enough processor time to be able to notice the stuck interrupt.

    Since the majority of applications perform most of their jobs outside of interrupts, they are very sensitive to a interrupt handler constantly being trigged.

Children