ATxmega128/64/32/16A4U
AVR
®
XMEGA
®
Data Sheet
Introduction
The Microchip AVR
®
XMEGA
®
is a family of low power, high performance, and peripheral rich 8/16-bit
microcontrollers based on the AVR enhanced RISC architecture. By executing instructions in a single
clock cycle, the AVR XMEGA devices achieve CPU throughput approaching one million instructions per
second (MIPS) per megahertz, allowing the system designer to optimize power consumption versus
processing speed.
Features
• High-performance, low-power Microchip AVR
®
XMEGA
®
8/16-bit Microcontroller
• Nonvolatile program and data memories
- 16K - 128KB of in-system self-programmable flash
- 4K - 8KB boot section
- 1K - 2KB EEPROM
- 2K - 8KB internal SRAM
• Peripheral Features
- Four-channel DMA controller
- Eight-channel event system
- Five 16-bit timer/counters
• Three timer/counters with 4 output compare or input capture channels
• Two timer/counters with 2 output compare or input capture channels
• High-resolution extensions on all timer/counters
• Advanced waveform extension (AWeX) on one timer/counter
- One USB device interface
• USB 2.0 full speed (12Mbps) and low speed (1.5Mbps) device compliant
• 32 Endpoints with full configuration flexibility
- Five USARTs with IrDA support for one USART
- Two Two-wire interfaces with dual address match (I
2
C and SMBus compatible)
- Two serial peripheral interfaces (SPIs)
- AES and DES crypto engine
- CRC-16 (CRC-CCITT) and CRC-32 (IEEE
®
802.3) generator
2011-2020 Microchip Technology Inc.
DS40002166A-page 1
ATxmega128/64/32/16A4U
- 16-bit real time counter (RTC) with separate oscillator
- One twelve-channel, 12-bit, 2msps Analog to Digital Converter
- One two-channel, 12-bit, 1msps Digital to Analog Converter
- Two Analog Comparators with window compare function, and current sources
- External interrupts on all general purpose I/O pins
- Programmable watchdog timer with separate on-chip ultra low power oscillator
- QTouch
®
library support
• Capacitive touch buttons, sliders and wheels
• Special microcontroller features
- Power-on reset and programmable brown-out detection
- Internal and external clock options with PLL and prescaler
- Programmable multilevel interrupt controller
- Five sleep modes
- Programming and debug interfaces
• PDI (program and debug interface)
• I/O and packages
- 34 Programmable I/O pins
- 44 - lead TQFP
- 44 - pad VQFN
- 49 - ball VFBGA
• Operating voltage
- 1.6 – 3.6V
• Operating frequency
- 0 – 12MHz from 1.6V
- 0 – 32MHz from 2.7V
2011-2020 Microchip Technology Inc.
Data Sheet Complete
DS40002166A-page 2
ATxmega128/64/32/16A4U
Table of Contents
1
2
3
4
5
6
Ordering Information ............................................................................... 8
Pinout/Block Diagram ............................................................................ 10
Overview ................................................................................................. 12
3.1
Block Diagram ................................................................................................. 13
Resources ............................................................................................... 14
4.1
Recommended reading ................................................................................... 14
Capacitive touch sensing ...................................................................... 14
AVR CPU ................................................................................................. 15
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
Features .......................................................................................................... 15
Overview.......................................................................................................... 15
Architectural Overview..................................................................................... 15
ALU - Arithmetic Logic Unit ............................................................................. 16
Program Flow .................................................................................................. 17
Status Register ................................................................................................ 17
Stack and Stack Pointer .................................................................................. 17
Register File .................................................................................................... 18
7
Memories ................................................................................................ 19
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11
7.12
Features .......................................................................................................... 19
Overview.......................................................................................................... 19
Flash Program Memory ................................................................................... 20
Fuses and Lock bits......................................................................................... 21
Data Memory ................................................................................................... 21
EEPROM ......................................................................................................... 22
I/O Memory...................................................................................................... 22
Data Memory and Bus Arbitration ................................................................... 23
Memory Timing ................................................................................................ 23
Device ID and Revision ................................................................................... 23
I/O Memory Protection..................................................................................... 23
Flash and EEPROM Page Size....................................................................... 23
8
DMAC – Direct Memory Access Controller .......................................... 25
8.1
8.2
Features .......................................................................................................... 25
Overview.......................................................................................................... 25
2011-2020 Microchip Technology Inc.
DS40002166A-page 3
ATxmega128/64/32/16A4U
9
Event System .......................................................................................... 26
9.1
9.2
Features .......................................................................................................... 26
Overview.......................................................................................................... 26
10 System Clock and Clock options ......................................................... 27
10.1
10.2
10.3
Features .......................................................................................................... 27
Overview.......................................................................................................... 27
Clock Sources ................................................................................................. 28
11 Power Management and Sleep Modes ................................................. 30
11.1
11.2
11.3
Features .......................................................................................................... 30
Overview.......................................................................................................... 30
Sleep Modes.................................................................................................... 30
12 System Control and Reset .................................................................... 32
12.1
12.2
12.3
12.4
Features .......................................................................................................... 32
Overview.......................................................................................................... 32
Reset Sequence .............................................................................................. 32
Reset Sources ................................................................................................. 32
13 WDT – Watchdog Timer ......................................................................... 34
13.1
13.2
Features .......................................................................................................... 34
Overview.......................................................................................................... 34
14 Interrupts and Programmable Multilevel Interrupt Controller ........... 35
14.1
14.2
14.3
Features .......................................................................................................... 35
Overview.......................................................................................................... 35
Interrupt vectors............................................................................................... 35
15 I/O Ports .................................................................................................. 37
15.1
15.2
15.3
15.4
15.5
Features .......................................................................................................... 37
Overview.......................................................................................................... 37
Output Driver ................................................................................................... 37
Input sensing ................................................................................................... 40
Alternate Port Functions .................................................................................. 40
16 TC0/1 – 16-bit Timer/Counter Type 0 and 1 ......................................... 41
16.1
16.2
Features .......................................................................................................... 41
Overview.......................................................................................................... 41
17 TC2 - Timer/Counter Type 2 .................................................................. 43
17.1
Features .......................................................................................................... 43
2011-2020 Microchip Technology Inc.
DS40002166A-page 4
ATxmega128/64/32/16A4U
17.2
Overview.......................................................................................................... 43
18 AWeX – Advanced Waveform Extension ............................................. 44
18.1
18.2
Features .......................................................................................................... 44
Overview.......................................................................................................... 44
19 Hi-Res – High Resolution Extension .................................................... 45
19.1
19.2
Features .......................................................................................................... 45
Overview.......................................................................................................... 45
20 RTC – 16-bit Real-Time Counter ........................................................... 46
20.1
20.2
Features .......................................................................................................... 46
Overview.......................................................................................................... 46
21 USB – Universal Serial Bus Interface ................................................... 47
21.1
21.2
Features .......................................................................................................... 47
Overview.......................................................................................................... 47
22 TWI – Two-Wire Interface ...................................................................... 49
22.1
22.2
Features .......................................................................................................... 49
Overview.......................................................................................................... 49
23 SPI – Serial Peripheral Interface ........................................................... 50
23.1
23.2
Features .......................................................................................................... 50
Overview.......................................................................................................... 50
24 USART ..................................................................................................... 51
24.1
24.2
Features .......................................................................................................... 51
Overview.......................................................................................................... 51
25 IRCOM – IR Communication Module .................................................... 52
25.1
25.2
Features .......................................................................................................... 52
Overview.......................................................................................................... 52
26 AES and DES Crypto Engine ................................................................ 53
26.1
26.2
Features .......................................................................................................... 53
Overview.......................................................................................................... 53
27 CRC – Cyclic Redundancy Check Generator ...................................... 54
27.1
27.2
Features .......................................................................................................... 54
Overview.......................................................................................................... 54
28 ADC – 12-bit Analog to Digital Converter ............................................ 55
28.1
Features .......................................................................................................... 55
2011-2020 Microchip Technology Inc.
DS40002166A-page 5