The high-performance, low-power 8/16-bit AVR XMEGA microcontroller combines 16KB ISP flash memory (4KB boot code section) with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, four-channel event system, a programmable multi-level interrupt controller, 34 general purpose I/O lines, a 16-bit real time counter, four flexible 16-bit timer/counters with compare modes and PWM, two USARTs, two Two-Wire Interfaces (TWIs), two Serial Peripheral Interfaces (SPIs), one 12-channel/12-bit A/D converter with optional differential input with programmable gain, two analog comparators with window mode, a programmable watchdog timer with separate internal oscillator, accurate internal oscillators with PLL and prescaler, and programmable brown-out detection. The Program and Debug Interface (PDI), a fast 2-pin interface for programming and debugging, is available. By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching 1 MIPS per MHz, balancing power consumption and processing speed.