In this video we look at how to setup and change the system clock on the SAMD21 family of microcontrollers from Microchip / Atmel. This example code is written in C++ and uses direct register access.
Free version can be found on GitHub: https://github.com/ForceTronics/SamD21_Clock_Setup
For pay version includes the following additional features:
Demonstrates how to use the calibration values stored in NVM to tune the 48MHz clock for higher accuracy
Allows you to change the system clock to 48MHz, 8MHz, 1MHz, and 32768Hz
Shows how to output the system clock from pin PA27
Link to code on ForceTronics.com: http://www.forcetronics.com/example-code-for-purchase/samd21-clock-setup-and-control-c-code-example