Microchip® Advanced Software Framework

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

Introduction

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

Main files:

Device Info

All SAM devices can be used.

Description of the example

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

The system clock is output on pin PCK0.

Note
For SAM4C_EK, PCK2 is used.

Compilation Info

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

Contact Information

For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/