Microchip® Advanced Software Framework

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

Introduction

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

Main files:

Device Info

All SAM devices supported by ASF can be used.

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.

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/