Page 260 - Making PIC Microcontroller Instruments and Controllers
P. 260

254   UIDERSIAIIDIIIG  IHE COU TER+ COU TI  G MARBLES



                     Il{TCOI{ |l{TEnACTTOI{
                     If you watch INTCON on the LCD while interrupts  are set and cleared,  you will  notice
                     that the GIE (global interrupt enable) bir, birT of INTcoN,  gers  cleared auromarically
                     when an interrupt is set, and is reset automatically when you clear the interrupt flag
                     (if you had set it to 1 in the lirst place).  This means that a second interupt  cannot occur
                     before the first one that was set is cleared. Since PBP dllows the use of more  than one
                     ON INTERRIJPT GOTO command in a  program,  strategies to make  sure all intenupts
                     are handled  prcperly can be formulated. It is best to do one  interrupt at a time to keep
                     it simple while you ar€ a beginrcr


                     TmER2
                     The third timer is Timer2.  This 8-bit timer canrot , e usel as a counter beca[se it does
                     not have the ability to respond to an extemal clock of any description- There is no line
                     on this timer intemal or exlemal) that we can connect an external signal to.
   255   256   257   258   259   260   261   262   263   264   265