3 Assignment 1: CLKCTRL - External High-Frequency Oscillator (XOSCHF) and Clock Failure Detection (CFD)

In this assignment, the AVR128DB48 Curiosity Nano will be configured to use the external high-frequency oscillator (XOSCHF) as the main clock source.

The clock failure detection will be configured to detect failures on the main clock. A failure on the main clock will result in a Non-Maskable Interrupt (NMI).

A failure will be triggered by the software when the switch (SW0) on the AVR128DB48 Curiosity Nano is pressed.

The AVR128DB48 Curiosity Nano will blink an LED with a frequency dependent on the main clock to show how the main clock source will be switched back to the default internal source when an error is detected.

The starting point for this assignment is the Atmel Studio Solution Assignment1 found in Assignment1.

  • Objectives
    • Configure the main clock yo use XOSCHF as its clock source
    • Configure the CFD to generate an NMI on the failure of the main clock
    • Trigger a failure on the main clock using the built-in test functionality of the CFD