Tag Archives: ATMEL


XMega Clock System

Okay firstly the reason I wrote about the clock system instead of I/O ports or something else in this second post of the XMega series is simply because of the fact that without understanding clock configurations you won’t get what you want from your chip. Since XMega’s clock system is software-level configurable and complex at first, it makes itself the first priority module before anything else.

There are several clock sources that XMega micros can use as clock. These are both internal and external clock sources. As stated earlier, clocks are not set by fuse settings unlike traditional Mega AVRs, they are controlled by software and the outputs from these sources can be multiplied using the internal Phase Locked-Loop (PLL). Thus there’s a wide range of clocks available in the XMega and it’ll not be needed to shut down and reprogram the XMega just to change its clock – a great relief from meddling with fuse settings. Some port pins can also output the system clock frequency. Literally there’s no need to depend on external quartz crystals which are not available in all frequencies.

XMega Clock System Internal
Read more

ATXMega Primer

The XMega series is a powerful addition to the existing arsenal of Atmel’s AVR-core micros. As much as I have personally studied about it so far and felt, the XMega series incorporates many features of conventional 32-bit ARM micros like alternate I/O pin mapping functionalities, sophisticated clock options and data buses, multiple communication platforms that have several uses, variety of capture-PWM options, 12-bit ADCs and DACs, DMA controller, USB hardware, etc. with the good old AVR core. Thus you get one hell of an 8/16 bit MCU that can fulfil your wildest micro desires. In terms of unit cost, resources and user flexibilities this family of micro can beat any present day micro in most of the scenarios. Unlike other manufacturers who design chips as to fit specific applications, there’s no limit for XMega series. It is one controller with unlimited possibilities that can fit into any application. Indeed it is a true Atmel slogan now:

My microcontroller can beat the hell out of your microcontroller.”

There are several things that are should be known. XMega is still a relatively new breed of micro. There’s literally nothing similar to it in the market no matter which manufacturer you can name. As I said Atmel added literally everything that can be imagined. Initial XMega devices had several hardware flaws and were unstable. They had problems related to power and operational stability. However these shortcomings are no longer there as they were. Atmel dramatically improved this new line of devices and are yet doing a lot of R&D on it. The older successful AVR Mega series micros are not as same as XMegas and so what can be applied to Mega AVR can’t be applied for the XMegas. There are significant differences both in terms of hardware and software but still there are similarities.
Read more

XMega I/O Ports

Any microcontroller must have I/O pins for taking inputs and providing outputs. The ATXMega32A4U just like any other micro has 34 programmable I/O pins divided unevenly amongst six IO ports. Most I/O ports are 8 bit wide. XMega I/Os have digital, analog and special purpose functions. Some I/O pins have more than one use. A quick view of the XMega I/O pins reveals the purpose of these pins.

XMega Interior

Read more

Code optimization tricks for AVR microcontrollers

Using high-level language compilers such as C greatly improves the development efficiency of microcontroller-based products. But when programs are written in C and compiled by a C compiler, the code efficiency is generally lower compared to an Assembly language program. However, good knowledge of microcontroller architecture and C coding helps the developers to optimize the code for reduced size and enhanced performance. For example, if we use a “do { } while ( )” loop, an increment or a decrement loop index generates different code size. Usually we write our loops counting from zero to the maximum value (increment), but it is more efficient to count the loop from the maximum value to zero (decrement). This application note describes various code optimization tips for 8-bit AVR microcontrollers based on avr-gcc (C compiler). However, due to their general nature these tips could be implemented in other compilers or with similar compiler options, and vice versa.

Code Optimization in AVR microcontrollers

Understanding ADC parameters for accurate analog-to-digital conversions

Analog-to-digital-conversion (ADC) is required in Embedded Systems to deal with various analog world parameters such as current, pressure, motion, temperature, etc. An ADC is an electronic system or a module that has analog input, reference voltage input and digital outputs. The ADC convert the analog input signal to a digital output value that represents the size of the analog input comparing to the reference voltage. It basically samples the input analog voltage and produces an output digital code for each sample taken. This application note from Atmel describes the fundamental concepts of ADC and the associated parameters that determine the performance and accuracy of the ADC’s output.

Understanding ADC parameters

Recent Entries »