Cornell University
Electrical and Computer Engineering 4760
AVR mega644/1284
Hardware Timers

Introduction

All of the AVR MCUs have hardware support for measuring time. The Mega644 has three hardware timers, two 8-bit (timer0 and timer2) and one 16-bit timer (timer1). The Mega1284 has four hardware timers, two 8-bit (timer0 and timer2) and two 16-bit timers (timer1 and timer3). Each timer has a prescalar. At each prescaled clock tick the timer counter register is automatically incremented by one. Each timer can be started/stopped, written with a new value, and read. Each timer can be used in several different ways. A short list follows for each timer.

Timer0 and timer2 functions

Timer1 and Timer3 functions (644 does not have timer3)

Examples Using Timers


Copyright Cornell University Jan 2009