Chapter 9. Introduction to the Timer/Counter Hardware

In this chapter, we’ll test our reaction time, refine our old organ routines, and transmit AM radio directly from the AVR. What do these projects have in common? They’re all made possible by the internal timer-counter hardware. Previously, we’ve marked the passing of time by holding up the CPU in counting delay loops. No more! The AVRs have dedicated hardware that’ll do that for us.

In all of these cases, you’ll find that using the hardware timers costs a little bit in initial setup, but makes your resulting code significantly simpler, makes the timing significantly more accurate, and frees up the CPU for useful work.

Get Make: AVR Programming now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.