Clock Setup

For this application the ATxmega128A1U is running at 8MHz. The ATxmega128A1U has an internal 32MHz RC oscillator and an internal 2MHz RC oscillator. By default the 2MHz RC oscillator is selected as the main clock source at start-up. The different clocks can be selected by software, and in this application it selects the 32MHz RC oscillator, which is divided by 4 using the system prescaler. The 2MHz oscillator is disabled. The XMEGA Real Time Counter (RTC) is set up to trigger a new ADC conversion at regular intervals by using event system, approximately every five milliseconds.

The clock setup will be configured by Atmel | START drivers, as well as the GPIO configuration, which means that the clock setup and GPIO PINMUX can be configured on the Atmel | START web page. For details, refer to the codes from the example project.