- Timers are there to count the internal clock Pulses of a Micro controller.
- Counters are there to count the external pulses.
States of a Timer
- Initial State
Uses of a Timer
- Event driven(initiate an event after a delay)
- Scheduling of Tasks in a System (by activating and running a timer)
- Watchdog Timer (Resets the system after a predefine time)
- Real Time clock (A clock that never stops and keeps on running and never be reset, Eg. Heart Beat)
- Time slicing of various tasks.
There are two types of timer
- Atleast one hardware should be available in a Microcontroller.
- The figure above shows the Hardware Timer has the control bits
- Timer Enable
- Timer Start
- Timer Stop
- Pre scaling bits
- Up count enable
- Down count disable
- Load Enable
- Timer Interrupt Enable