AVR timers do more than count time

Timers/Counters are probably one of the most complex peripherals in microcontrollers, but they are most common no matter what complexity the program is. Designers of timers have put a lot of thought into them, making them very flexible and versatile for all timing-dependent tasks like measuring periods, generating PWM signals, generating output signals, and timed interrupts. Timers run independently from the AVR core. Once set, they do their silent job while AVR can do other tasks or go to sleep. AVR can read timer values or change operation modes whenever it needs or only can be interrupted with several available interrupts. If you see an application where the frequency is measured, music is generated, or motor is driven, a timer is involved.

Continue reading