ABSTRACT

This chapter focuses on interrupts on the 16F84. An interrupt is an asynchronous signal calling for processor attention. Interrupts can originate in hardware or in software. PIC microcontrollers provide varying levels of support for interrupts. Return-from-interrupt (RETFIE) sets the Global Interrupt Enable bit in the Interrupt Control (INTCON) register automatically re-enabling interrupts. In addition to the RETFIE instruction, two PIC hardware elements relate directly to interrupts: the OPTION register and the INTCON register. The 16F84 is equipped with a special timer module, named Timer0, which serves both as a timer and as a counter. One powerful and common application of a Timer0 interrupt is in implementing serial communications. When an interrupt can take place on either the rising or the falling edge of the triggering signal, the interrupt source must have a minimum pulse width in order to ensure that both edges are detected.