Cornell University
Electrical Engineering 476
AVR microcontrollers
Hardware Timers

Introduction

All of the AVR MCUs have hardware support for measuring time. The Mega32 has three hardware timers, two 8-bit (timer0 and timer2) and one 16-bit timer (timer1). Each timer has a prescalar that divides the cpu clock by 1, 8, 64, 256, 1024. At each prescaled clock tick the timer counter register is automatically incremented by one. In addition, each timer can be stopped. Each timer can be used is several different ways. A short list follows for each timer.

Timer0 and timer2

Timer1

Using Timers


Copyright Cornell University Jan 2008