Showing posts with label avr microcontroller timer example. Show all posts
Showing posts with label avr microcontroller timer example. Show all posts

AVR MICROCONTROLLER Timer tutorial and example

Working with  AVR  timer  in first time maybe make us confuse . So i write this avr timer example and tutorial  as an effort for to make my understanding about AVR time more strongth reside in my memory.
AVR microcontroler has three timer :
a. Timer 0
b. Timer 1
and
c. Timer 2

These AVR timer has at least four operation mode :
1. Counter mode
2. Timer mode
3. input capture mode
4. PWM mode

To operate a timer we must deal with several register that govern these timer, below is register list that i pretend:

  • Register TCNT = is counter register
  • Register TCCR =register for operation mode ofsi  Timer/Counter
  • Register TIMSK =register  to chose timer
  • Register TIFR 
  • Register OC (output compare)