Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Timer/Counter Example 1 for AT32UC3A0512 in AVR Simulator Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the TC driver.
It also gives an example of the usage of the TC module.

This example will start a timer/counter and generates "tick" interrupts.

The selected timer input clock is the internal clock labelled TC3 referred to as TIMER_CLOCK3 in the datasheet. TIMER_CLOCK3 is connected to fPBA / 8 (see datasheet).

The 16-bit timer/counter channel will cycle from 0x0000 to RC. RC is initialized to (fPBA / 8) / 100, so that an interrupt will be triggered every 10 ms. Upon interrupt, a GPIO line is toggled thus producing a square signal of frequency 50 Hz.

Main Files

Compilation Info

This software was written for the GCC compiler for AVR32

Device Info

All AVR32 devices with a TC module supported in AVR Studio 5 Simulator can be used. This example has been tested with the following board:

  • AVR Simulator

Setup Information

This example has been tested with the following configuration:

  • AVR Simulator
  • CPU clock: Internal RC oscillator (about 115200 Hz) .

Contact Information

For further information, visit Atmel AVR32.