Page 10 - DEC40053 Ebook_Timer
P. 10

What is Timer?












            Clock source can be internal or external




                  For  internal  clock,  1/4th  of  the  frequency  of


                  the  crystal  oscillator  on  the  OSC1  and  OSC2

                  pins (Fosc/4) is fed into the timer.


                  For  external  clock,  pulses  are  fed  to  PIC  and

                  used as counter.









                  Timers  are  common  features  of  most

                  microcontroller.


                  In  simplified  terms,  a  timer  is  just  a  register

                  whose value keeps increasing (or decreasing)


                  at  a  constant  rate  without  the  help  of  the

                  CPU.


                  The CPU can read or write this register at any

                  time. It finds out how much time has elapsed.





           The timer in PIC18F refers to the hardware timer

           inside the PIC18F itself.












                                                           -3-
   5   6   7   8   9   10   11   12   13   14   15