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
This software was written for GCC for AVR32 and IAR Embedded Workbench for AVR32. Other compilers may or may not work.
This example has been tested with the following configuration:
For further information, visit Atmel AVR UC3.