Line 1: Line 1:
 
[[Category:AVR Tutorials]]
 
[[Category:AVR Tutorials]]
 
=Basics=
 
=Basics=
 
+
We have covered the basics of [[AVR_Timer_programming| AVR timer Programming]], during the Timer 1 example we saw that we had to monitor the Flags to check if the Timer has overflown which made the main program dependent on the status of the flags. Timers are independent unit's inside a micro-controller and make full use of them we will configure and use them with Interrupts. This makes the CPU free from polling the flags and timers can operate on their own. When the timing task is finished, it will interrupt and inform the CPU.
 +
  
 
{| style="text-align:center;" class="table table-responsive table-bordered"  
 
{| style="text-align:center;" class="table table-responsive table-bordered"  

Revision as of 15:02, 22 March 2016

Basics

We have covered the basics of AVR timer Programming, during the Timer 1 example we saw that we had to monitor the Flags to check if the Timer has overflown which made the main program dependent on the status of the flags. Timers are independent unit's inside a micro-controller and make full use of them we will configure and use them with Interrupts. This makes the CPU free from polling the flags and timers can operate on their own. When the timing task is finished, it will interrupt and inform the CPU.


TIMSK
Timer/Counter Interrupt Mask Register
D7 D6 D5 D4 D3 D2 D1 D0
- - TICIE1 OCIE1A OCIE1B TOIE1 - -

Code