This example shows how to initialize the clock system and blink a LED at a constant 1 Hz frequency.
All SAM devices supported by ASF can be used.
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.
This software was written for the GNU GCC and IAR for SAM. Other compilers may or may not work.
For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/