Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TC Example 3 for EVK1101 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 1 ms. Upon interrupt, a LED0 is toggled thus producing a square signal of frequency 500 Hz. Check the toggled GPIO pin connected to LED0 on an oscilloscope and see the square signal at frequency 500 Hz.

Also, a message is displayed on USART and the 'Timer:' value is updated every second. The displayed message is:
ATMEL
AVR32 UC3 - TC example
Timer: 1 s

Main Files

Compilation Info

This software was written for GCC for AVR32 and IAR Embedded Workbench for AVR32. Other compilers may or may not work.

Information

This example has been tested with the following configuration:

  • EVK1100, EVK1101, EVK1104, EVK1105, UC3L_EK, UC3C_EK, UC3-A3 XPLAINED, UC3-L0 XPLAINED, STK600 + RCUC3D routing board boards.
  • CPU clock: 16MHz in UC3C_EK and 12 MHz in all other boards.
  • PC terminal settings:
    • 57600 bps,
    • 8 data bits,
    • no parity bit,
    • 1 stop bit,
    • no flow control.

Contact Information

For further information, visit Atmel AVR UC3.