Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TC Example 4 for UC3L_EK 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 involves one TC channel configured in capture mode (input). Upon a chosen GPIO pin change, an event triggers a TC.Ai capture.

The GPIO pin PA11 is programmed to output a peripheral event whenever the interrupt condition pin value falling edge is detected.

Since we're using PA11 as event generator, channel 1 of the TC0 module is used as event user (cf. the table "Peripheral Event Generators and Users Interconnection" from the UC3L datasheet). The selected timer input clock is the internal clock labelled TC4 referred to as TIMER_CLOCK4 in the datasheet.

Note
  • On the STK600 + RCUC3L0 routing card setup, the chosen GPIO pin PA11 generating the event is routed to STK600.PORTB.PB3.
  • On the AT32UC3L-EK, the chosen GPIO pin PA11 generating the event is routed to the "WAKE" button.

Upon a falling edge detection on the GPIO pin, an event is generated. This event generator triggers a TC0.A1 capture. When the TC0.A1 capture occurs, an interrupt is triggered and LED0 (connect STK600.PORTA.PA4 to STK600.LEDS.LED0) is toggled by the interrupt handler.

Main Files

Compilation Info

This software was written for the GNU GCC for AVR32 and IAR Systems compiler for AVR32. Other compilers may or may not work.

Device Info

All AVR32 UC3L devices with a TC module and a Peripheral Event System can be used. This example has been tested with the following boards:

  • STK600 starter kit with the RCUC3L0 routing card
  • AT32UC3L-EK evaluation kit

Setup Information

CPU speed:

  • Running on OSC0 from an external crystal at 12MHz : STK600+RCUC3L routing card setup
  • With the DFLL using an internal osc, the CPU speed is configured at 12MHz: AT32UC3L-EK

Contact Information

For further information, visit Atmel AVR32.