Introduction

This application note describes how to use the different timers of the Atmel® AVR®. The intention of this document is to give a general overview of the timers, show their possibilities, and explain how to configure them. The code examples will make this clearer and can be used as guidance for other applications. The Atmel ATmega328PB is used as an example in this document to explain the timers.

Starting from a general overview of the timers, several examples will show how the timers work and how they are configured. Experienced users can start directly with the section Setting Up the Timers. The last section is a short description of the PWM mode. A zip file is available with this application note which contains C and Assembly code for all these examples. It can be downloaded from the Atmel Website.

Additional information is available in the data sheets and application notes for specific devices.