Summary of New blog about Atmel MCU and Atmel Software framework
The article explains the flexible system clock of the AVR XMEGA A4U microcontroller, detailing how it starts with an internal 2 MHz oscillator after reset and can be reconfigured at runtime using the ASF Clock Control System. It highlights that various peripherals require specific clock speeds, such as the Watchdog Timer (32 kHz), RTC (32.768 kHz), USB (6–48 MHz), and high-resolution waveform generation (clkPER4).
Parts used in the AVR XMEGA A4U Clock Project:
- AVR XMEGA A4U Microcontroller
- Internal Oscillator (2 MHz)
- ASF Clock Control System Module
- Brown-out Detector
- Watchdog Timer
- Real-time Counter (RTC)
- USB Module
- DMA Controller
- Event System
- Interrupt Controller
- RAM
- Hi-Res Generator
We discover in this article the flexible system clock of the AVR XMega A4U that remember to be very similar to other XMega and let’s see how to configure it with ease thanks to the ASF module Clock Control System we have added to our project and analyzed in previous episodes.
For those wishing to download the Atmel Studio project created so far: progetto_introduzione_ASF_3
As mentioned in the previous article, after the reset (and when) the device will start theinternal oscillator from 2 MHz then you can change at runtime through our various firmware system clock.
Let’s see a schema based on the datasheet of the microcontroller that summarizes well what we offer for the clock:
Initially you may be frightened by the many Options and acronyms, a question often asked by newcomers is “but not just a simple General clock?”
The microcontroller has many devices that typically work at different speeds from the CPU:
-the Brown-out that detects any cali when the power reset and Watchdog Timer that allows the detection of firmware blocks working at 1 kHz tone generated from a clocked at 32 kHz
-Real-time counter (RTC) that allows you to keep track of the time typically works at 1024 kHz but can work with higher resolution (greater than 1ms) to 32,768 kHz
– USB module requires a minimum clock speed of 6 MHz for working in low speed and at least 48 MHz to full speed mode
-the devices as the DMA controller, event system, interrupt controller and RAM have a clock set called clkPER
-the EBI (External Bus Interface) used to connect external memory such as SRAM and SDRAM or devices such as LCD display memory mapped working on a clkPER2 clocks up to twice as much to devices. The module is only present on some package, generally with a large number of pins, is not present on our Development Board ATXMega32A4U EWS.
-the Hi-Res has clkPER4 clock up to four-fold compared to devices, is used to generate waveforms with high resolutionInitially you may be frightened by the many Options and acronyms, a question often asked by newcomers is “but not just a simple General clock?”
For more detail: New blog about Atmel MCU and Atmel Software framework
- How does the device start after a reset?
The device starts the internal oscillator from 2 MHz. - Can the system clock be changed at runtime?
Yes, the clock can be changed at runtime through the firmware system clock. - What speed is required for the Watchdog Timer?
The Watchdog Timer works at 1 kHz tone generated from a clocked at 32 kHz. - Does the Real-time counter support higher resolution?
Yes, it can work with higher resolution greater than 1ms up to 32,768 kHz. - What are the minimum clock speeds for the USB module?
It requires a minimum of 6 MHz for low speed and at least 48 MHz for full speed mode. - What clock signal drives the DMA controller and RAM?
They use a clock set called clkPER. - Is the EBI module present on the ATXMEGA32A4U EWS board?
No, the EBI module is not present on this development board. - What is the purpose of the clkPER4 clock?
It is used to generate waveforms with high resolution and runs up to four-fold compared to devices.
