Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Common API for Clocks Control / Example 3 for EVK1101 Documentation

Introduction

This example shows how to switch between various system clock sources and prescalers at run time.

Main files:

Device Info

All AVR UC3A, UC3A1 and UC3B devices can be used.

Description of the example

The clock system is reconfigured every time the user presses a button (NEXT_BUTTON) to use the next clock source and prescaler settings shown in the state diagram below.

Sequence of clock source and prescaler settings

A Timer/Counter (TC) is used to generate periodic interrupts based on its peripheral bus clock. With each interrupt, a LED (LED_EXAMPLE_OUTPUT) is toggled, thus giving a visual indication of the system clock frequency.

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.