Microchip® Advanced Software Framework

Common API for Clocks Control / Example 1 for UC3-A3-Xplained Documentation


This example shows how to initialize the clock system and blink a LED at a constant 1 Hz frequency.

Main files:

Device Info

All AVR MEGA, XMEGA and UC3 devices supported by ASF can be used.

description: Description of the example

A delay routine is used to time the interval between each toggling of a LED. The duration of the delay routine is computed from the frequency of the configured system clock source.

The main system clock source and prescalers, along with any PLL and/or DFLL configuration, if supported, are defined in conf_clock.h. Changing any of the defines – CONFIG_SYSCLK_SOURCE, CONFIG_SYSCLK_CPU_DIV, etc. – should not change the frequency of the blinking LED.

Refer to the Clock Management API documentation for further information on the configuration.

Device Info

This example has been tested with the following setup:

  • STK600 evaluation Kit (Tested with STK600-ATMEGA128RFA1) need to connect a 10 Pin cable from PORTB to Led header
  • ATmega256RFR2 Xplained Pro kit

Compilation Info

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

Contact Information

For further information, visit Microchip.