Using the AVR Xmega Microcontroller Family

Atmel have added the Xmega series to their AVR range and we are seeing more interest in these microcontrollers as time goes by, but who should be looking at using them?

Well for a start, it is not a chip for complete beginners and people wanting to learn microcontrollers from scratch would be better off starting with standard AVR ATmega microcontroller kits or PIC Microcontroller Kits.

The minimum requirement to use these chips is an understanding of embedded C programming and preferably AVR C programming. The AVR Xmega development boards and starter kits available from Kanda and other suppliers assume a familiarity with C programming.

With this in mind, what are the benefits of the AVR Xmega family? There are lots of features described below but the main benefits are speed of operation, low power consumption, 12-bit ADC and many communication channels, for example, 8 UARTS and 12-bit ADC channels, compared with 2 UARTs and 10-bit ADC on standard AVR ATmega128. However, organizing lots of peripherals in your program is another reason why this chip is for more advanced users.

The code is the same as standard AVR and the same tools are used (AVRStudio, AVR DRAGON, IAR AVR Embedded Workbench etc) but there are differences such as a completely changed pinout and altered peripheral access. This means that it is not as easy as it could be to port an existing AVR ATmega project to ATxmega and you would probably be better advised to consider Xmega for a new project.

The main features and benefits of the Xmega are

  • Low Voltage operation – 1.6 to 3.3V
  • Low power consumption, down to 100nA
  • Direct Memory Access (DMA) for peripherals frees CPU for other tasks, improving speed
  • 32 MHz maximum clock speed, with PLL function
  • 8 UARTS, 4 I2C (TWI), 4 SPI channels and 32 PWM outputs
  • 12-bit ADC and 12-bit DAC modules
  • Encryption module to easily add security eg AES, DES
  • Logic module (XCL) to implement flipflops, latches and logic functions on-board the Xmega

These are a powerful set of features and mean it can be used for advanced projects while remaining less daunting than ARM or AVR32. What about the disadvantages? Well the main ones are

  • Different pinout to normal ATmega AVRs
  • Maximum ADC reference voltage is 2.4V
  • Port pins have less drive
  • Not tolerant of 5V peripherals
  • Chip bugs – read the errata sheets before assuming something works as described in the datasheet

If you have a project in mind that needs these additional features like more communication channels or 12-bit ADC then the Xmega is worth looking at. Kanda have a new Xmega Development board which covers all the features of the Xmega, with code examples and descriptions in English unlike a lot of other units available.

Leave a Reply