Page 1
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 1
Embedded Systems I
© Ulrich Schaarschmidt
FH Düsseldorf, WS 2016/17
Themen am 22.11.2016: 8/16 – Bit Mikrocontroller von Atmel XMEGA
„neue“ Baugruppen (z.B. ADC, DMA, DAC) anhand von
Beispielen (1. Teil)
Bitte OHP-/Tafel-Notizen selbst mitschreiben! ES1_16_V7
22.11.2016 (c) U.G. Schaarschmidt, HS D 2
Literaturhinweise
Inneltek, nn.:
Atmel AVR XMEGA
Workshop am 05.11.09
Atmel, nn.:
Atmel Traning: XMEGA Basics
Workshop am 05.11.09
Atmel, nn.:
Atmel Training DMAC
Workshop am 05.11.09
Atmel, nn.:
Atmel Traning: XMEGA Event System Hands-on
Workshop am 05.11.09
Atmel, nn.:
AVR_AVR32_ Quick Reference Guide.pdf
Page 2
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 2
22.11.2016 (c) U.G. Schaarschmidt, HS D 3
Literaturhinweise
Atmel, nn.:
Atmel AVR XMEGA A Manual
Atmel Datenblatt
Atmel, nn.: AVR® XMEGA (TM ) – PMIC Introduction
XMEGA Training: Programmable Multilevel Interrupt Controller
Atmel, nn.:
Getting Started With the XMEGA Event System
Atmel AN AVR1001
Atmel, nn.:
AVR® XMEGA™ – Analog to Digital Converter Introduction
XMEGA Training: Analog to Digital Converter (ADC)
Atmel, nn.: XMEGA-ADC-Hands-on.pdf
Quellenhinweise
Cullen, Gerard; Editor, Staff of Geist Technology:
Low-Cost Web Servers (Web-Enable Almost Anything for Almost
Nothing)
www.geisttek.com
www.atmel.com/dyn/products/datasheets.asp?family_id=682
http://de.wikipedia.org/wiki/Atmel_AVR32
http://www.avrfreaks.net/wiki/
http://www.avrtv.com/2007/06/29/avrtv-special-002/
http://myavr.de/
http://www.t2-project.org/architectures/avr32/?architectures/avr32.html
Tanenbaum, Andrew S.: Computerarchitektur; 5. Aufl. 2006 Pearson
Studium
22.11.2016 (c) U.G. Schaarschmidt, HS D 4
Page 3
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 3
Spezielle Atmel - Websites
http://www.atmel.com/avr
Selection Guides, Data Sheets and Errata Sheets
Application Notes and Reference Library
Atmel and Third Party ToolsS
Software, User Guides
Consultants, Distributors and Atmel Representatives
http://support.atmel.no
Official Atmel MCU technical support center with FAQ and email notification
service
http://www.avrtv.com
Official AVR podcasts
http://www.avrfreaks.net
AVR Experts Discussion Forum, Selection Guides for Tools and Products, Third
Party Tools Information, FAQs
22.11.2016 (c) U.G. Schaarschmidt, HS D 5
Xplain evaluation board
ATxmega128A1
Switches (8x)
LEDs (8x)
32kHz RTC crystal
NTC resistor
Speaker
Potmeter
64Mbit SDRAM
4Mbit Dataflash
AT90USB1287
Gateway to USB
JTAG connector
USB-powered
22.11.2016 6 (c) U.G. Schaarschmidt, HS D
Page 4
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 4
AVR XMEGA Key Benefits
picoPower technology for ultra low power consumption
True 1.6 volt operation and CPU speed up to 32 MHz
Event System and DMA Controller
High speed, high resolution 12-bit ADC and DAC
Crypto engine, Timers/Counters and fast
communication interfaces
Accurate and flexible Clock System with dynamic clock
switching
22.11.2016 (c) U.G. Schaarschmidt, HS D 7
Einige Key Benefits
herausgehoben und erläutert
Pico Power wird auf den folgenden Folien
erläutert.
DMA -> Direct Memory Access – direkter
Zugriff auf das Speichersystem OHNE die
CPU zu belasten (d.h., dass die CPU
schlafen (Energie sparen) oder etwas
ganz anderes machen/rechnen kann).
22.11.2016 (c) U.G. Schaarschmidt, HS D 8
Page 5
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 5
DMA – direct memory access
22.11.2016 (c) U.G. Schaarschmidt, HS D 9
DMA-Controller
22.11.2016 (c) U.G. Schaarschmidt, HS D 10
[ http://www.atmel.com/products/microcontrollers/avr/xmega_technical_details.aspx ]
Page 6
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 6
Xmega - Event-System
22.11.2016 (c) U.G. Schaarschmidt, HS D 11
[AVR1005: Getting started with XMEGA]
Event-System
22.11.2016 (c) U.G. Schaarschmidt, HS D 12
8 Event Routing Channels
CPU and DMA independent operation
Page 7
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 7
picoPower - Best MCU power budget
Atmel’s picoPower technology reduces
power consumption in both sleep and
active mode. With picoPower technology
the embedded designer can reduce the
applications power consumption while
maintaining performance.
22.11.2016 (c) U.G. Schaarschmidt, HS D 13
True 1.6 Volt Operation
AVR XMEGA offers true 1.6 Volt
operation. All functions including ADC,
DAC, Flash- and EEPROM memories are
all operating down to 1.6V. This allows
safe operation directly from a 1.8V ±10%
power supply. It also enables deeper
battery discharge to increase battery life.
22.11.2016 (c) U.G. Schaarschmidt, HS D 14
Page 8
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 8
Minimized Leakage Current Ultra
Low Power 32 kHz Crystal Oscillator
AVR XMEGA leakage current is only 100
nA while still maintaining full RAM and
register retention. This reduces power
consumption for applications spending
most time in sleep mode.
AVR XMEGA’s Real Time Counter
consumes only 500 nA while running from
a 32.768 kHz Crystal Oscillator.
22.11.2016 (c) U.G. Schaarschmidt, HS D 15
AVR® XMEGA
TM – Demo
SRAM
Buffer
Timer Trigger
Event System Event Channel 0 Event Channel 1
... Event Channel 7
PORT
DMA
Trigger
Source
A timer triggers a DMA transfer from a SRAM buffer to
a port in an endless loop without CPU load.
22.11.2016 16 (c) U.G. Schaarschmidt, HS D
Page 9
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 9
Stromverbrauch durch differenzierte
Sleep-Modes reduzieren
Minimized Leakage Current
AVR XMEGA leakage current is only 100 nA while still maintaining
full RAM and register retention. This reduces power consumption
for applications spending most time in sleep mode.
Ultra Low Power 32 kHz Crystal Oscillator
AVR XMEGA’s Real Time Counter consumes only 500 nA while
running from a 32.768 kHz Crystal Oscillator.
Sleep modes
XMEGA has five different sleep modes to turn off unused modules
and reduce the power consumption in the application. Many
sleep modes makes it easy to find the perfect fit for the application.
The granularity is further enhanced by the innovative Power
Reduction Register technology.
22.11.2016 (c) U.G. Schaarschmidt, HS D 17
Stromverbrauch durch differenzierte
Sleep-Modes reduzieren
in idle sleep mode all peripherals operate while the CPU is
sleeping to reduce the power consumption. with up to 50%, while
event handling, communication and data input/output still run.
in power-save mode, XMEGA uses 650nA to run the Real Time
Counter and have full SRAM and register retention offering industry
leading low power numbers. Enabling Watchdog and Brown Out
adds only 1uA.
in power-down mode, XMEGA uses only 100nA with SRAM and
register retetion, and 5us wake-up time from pin change on any i/O
pin and TWi address match.
Standby and extended standby sleep modes are identical to
power-down and power-save, except the external oscillator is kept
running to reduce wake-up time.
22.11.2016 (c) U.G. Schaarschmidt, HS D 18
Page 10
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 10
XMEGA – Betriebsmodi
zum Energiesparen
22.11.2016 (c) U.G. Schaarschmidt, HS D 19
XMEGA – Betriebsmodi
zum Energiesparen
22.11.2016 (c) U.G. Schaarschmidt, HS D 20
Page 11
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 11
XMEGA – Betriebsmodi
zum Energiesparen
22.11.2016 (c) U.G. Schaarschmidt, HS D 21
Atmel‘s 2nd
generation
„pico power“
True 1.6V operation
Flash, Analog, EEPROM, Oscillators down to
1.6V
Enable 1.8V +/-10% power supply
Lowest power 32 kHz Crystal Oscillator
650nA RTC
Low leakage Process Technology
100nA
1 μA Watchdog and Brown-Out
22.11.2016 (c) U.G. Schaarschmidt, HS D 22
Page 12
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 12
XMEGA A3B
Include all XMEGA A3 features, plus:
32-bit Real Time Counter with Battery Backup System
Targets low power applications that require battery
backup for the clock
Real Time Counter keeps running when main power
is lost
Automatic power switching
Only 500 nA to power:
32-bit Real Time Counter
32.768 kHz Crystal
Backup register
32.768 kHz XTAL oscillator failure detection
22.11.2016 (c) U.G. Schaarschmidt, HS D 23
Atmel XMEGA
(Aufruf der pdf-Dateien)
XMEGA introduction.pdf
AVR_XMEGA_A_Manual.pdf
XMEGA-Basics Introduction.pdf
XMEGA-Basics Hands-on.pdf
XMEGA-Basics Summary.pdf
22.11.2016 (c) U.G. Schaarschmidt, HS D 24
Page 13
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 13
AVR CPU und Befehlssatz
(Instruction Set)
The AVR XMEGA uses the AVR RISC
CPU which is created for high level C code
development. The instruction set and CPU
design are tuned for minimum code size
and maximum execution speed. Due to the
true single cycle execution of arithmetic and
logic operations, AVR microcontrollers
perform close to 1 MIPS per MHz.
22.11.2016 (c) U.G. Schaarschmidt, HS D 25
AVR CPU und Befehlssatz
(Instruction Set)
22.11.2016 (c) U.G. Schaarschmidt, HS D 26
Central in the AVR architecture is the
fast-access register file with 32 x 8-bit
general purpose working registers
directly connected to the Arithmetic Logic
Unit. Within a single clock cycle the ALU
can be fed two arbitrary registers, do a
requested operation, and write back the
result. The AVR XMEGA instruction set
also support atomic 16-bit register
access, 32-bit arithmetics, and have
three 24-bit memory pointers.
Page 14
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 14
Packaging Range 1/2
22.11.2016 (c) U.G. Schaarschmidt, HS D 27
Packaging Range 2/2
22.11.2016 (c) U.G. Schaarschmidt, HS D 28
Page 15
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 15
AVR XMEGA is delivered in diff. package
options, including fully green versions
22.11.2016 (c) U.G. Schaarschmidt, HS D 29
22.11.2016 (c) U.G. Schaarschmidt, HS D 30
Page 16
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 16
Crypto Engine
AVR XMEGA includes a crypto engine for 64-bit DES
and 128-bit AES encryption and decryption.
There are no export limitations for the AVR XMEGA with
crypto engine, so using XMEGA for crypto function do
not limit where you can sell your product.
22.11.2016 (c) U.G. Schaarschmidt, HS D 31
Analog – Digital - Wandler
AVR XMEGA is highly integrated
with high performance 12-bit
ADC and DAC. The ADC support
up to 2 million samples
per second. The DAC has
conversion rates up to 1 msps
and comes with built-in offset and
gain compensation. XMEGA
also include several analog
comparators with window
function and flexible input
selection.
22.11.2016 (c) U.G. Schaarschmidt, HS D 32
Page 17
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 17
Clock – System
(Zeit-Management)
AVR XMEGA’s clock system allow flexible change of
frequency. Dynamic Clock Switching allows the Embedded
Designer to tune performance and power consumption to
fit the application. The internal PLL and prescaler can be
used to scale the clock sources dynamically up or down to
further match application requirements. With a built-in
External Oscillator failure detection and internal RC
oscillator with ± 1% accuracy over temperature and
voltage, XMEGA offers the most safe, reliable and flexible
clock system.
22.11.2016 (c) U.G. Schaarschmidt, HS D 33
Clock – System
(Zeit-Management)
22.11.2016 (c) U.G. Schaarschmidt, HS D 34
Page 18
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 18
Flexible Input / Output
Konfiguration
AVR XMEGA offers flexible I/O pin configu-
ration with various sensing, wake-up,
synchronous/asynchronous, and driver
settings. I/O pin’s direction, value and logic
state are read through separate registers.
The optional Slew-Rate limitation reduces
EMI. Virtual ports registers allow single cycle
pin manipulation. This makes software for
bit-banging smaller and faster. 22.11.2016 (c) U.G. Schaarschmidt, HS D 35
Timer / Counter
All AVR XMEGA Timer/Counter modules are
16-bit with Input Capture and Pulse Width
Modulation (PWM) functionality. Up to 128 MHz
PWM is possible from internal PLL by using the
Hi-Res extension. Using the Event System and
Advanced Waveform Extension (AWeX) and
high resolution extention, implementation
ofadvanced motor control (AC, BLDC, SR, and
Stepper) and power control applications is made
easy.
22.11.2016 (c) U.G. Schaarschmidt, HS D 36
Page 19
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 19
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 37
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 38
Page 20
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 20
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 39
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 40
Page 21
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 21
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 41
Timer / Counter
22.11.2016 (c) U.G. Schaarschmidt, HS D 42
Page 22
Embedded Systems 1 22.11.2016
HS Düsseldorf (c) U.Schaarschmidt 22
Interfaces
22.11.2016 (c) U.G. Schaarschmidt, HS D 43
Übungsaufgaben zu Xmega
AVRs (vom 22.11.16)
Welche „Features“ aus der „großen“ EDV
wurden zur Leistungssteigerung in die
Atmel - XMega-Familie eingebaut?
Wie ist das Energiemanagement in der
XMega-Familie realisiert?
Notieren Sie 5 Erweiterungen/neue
Features/Verbesserungen/Unterschiede
von Atmega zu ATXmega!
22.11.2016 (c) U.G. Schaarschmidt, HS D 44