XMEGA-A1 Xplained Hardware User`s Guide

Atmel AVR1924: XMEGA-A1 Xplained Hardware
User's Guide
Features
• Atmel® ATxmega128A1 microcontroller
• External memory
- 8MB SDRAM
• Atmel AT32UC3B1256
- Communication gateway
- Programmer for Atmel AVR® XMEGA®
• Analog input (to ADC)
- Temperature sensor
- Light sensor
• Analog output (from DAC)
- Mono speaker via audio amplifier
• Digital I/O
- UART communication through USB gateway
- Eight mechanical button switches
- Eight LEDs
- Eight spare analog pins
- 24 spare digital pins
8-bit Atmel
Microcontrollers
Application Note
Preliminary
1 Introduction
The Atmel XMEGA-A1 Xplained evaluation kit is a hardware platform to evaluate
the Atmel ATxmega128A1 microcontroller.
The kit offers a larger range of features that enables the Atmel AVR XMEGA user
to get started using XMEGA peripherals right away and understand how to
integrate the XMEGA device in their own design.
Figure 1-1. XMEGA-A1 Xplained evaluation kit.
Rev. 8370C-AVR-12/11
2 Related items
Atmel FLIP (Flexible In-system Programmer)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
Atmel AVR Studio® 4 (free Atmel IDE)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725
Atmel AVR JTAGICE mkII (on-chip programming and debugging tool)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3353
Atmel AVR ONE! (on-chip programming and debugging tool)
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4279
3 General information
This document targets the Atmel XMEGA-A1 Xplained evaluation kit, revision 9. The
schematic, layout, and bill of materials can be found online in the zip files associated
with this application note at:
http://www.atmel.com/products/AVR/xplain.asp?family_id=607&source=redirect.
The XMEGA-A1 Xplained kit is intended to demonstrate the Atmel ATxmega128A1
microcontroller, and the hardware that relates to the Atmel AT32UC3B1256 is,
therefore, not covered in this document.
Figure 3-1. Overview of the XMEGA-A1 Xplained kit.
ATxmega128A1 JTAG and PDI
XMEGA PORT F
USB (COM and PSU)
Power jumper
XMEGA PORT D/R
Light sensor
Temp. sensor
Audio amp.
Speaker
AT32UC3B1256
DataFlash footprint
XMEGA PORT A
SDRAM
ATxmega128A1
XMEGA PORT C
3.1 Preprogrammed firmware
The Atmel ATxmega128A1 and AT32UC3B1256 that come with the Atmel XMEGAA1 Xplained kit are both preprogrammed.
The preprogrammed firmware in the XMEGA plays different sounds when the
mechanical button switches are pushed.
2
Atmel AVR1924
8370C-AVR-12/11
Atmel AVR1924
The preprogrammed Atmel AT32UC3B1256 firmware offers features such as a boot
loader for self-programming and a UART-to-USB gateway.
3.2 Power supply
The kit is powered via the USB connector, which leaves two options to power it:
Connect the kit either to a PC through a USB cable, or to a 5V USB power supply
(AC/DC adapter).
3.3 Measuring the XMEGA power consumption
As part of an evaluation of the Atmel ATxmega128A1, it can be of interest to measure
its power consumption. The power jumper (J300) is connected between the 3.3V
regulated voltage from the regulator and the ATxmega128A1 supply. By replacing the
jumper with an ammeter, it is possible to measure the current consumption of the
ATxmega128A1. No other components are connected to the same supply as the
ATxmega128A1, and other components, therefore, do not affect the measurement of
the ATxmega128A1 current consumption (except the DC leakage in the decoupling
capacitors).
3.4 Programming the XMEGA through the UART-to-USB gateway
The ATxmega128A1 has a pre-programmed UART boot loader. How to program the
device through the UART-to-USB gateway is described in the Atmel application note
“AVR1927: XMEGA-A1 Xplained Getting started guide”.
3.5 Communication through the UART-to-USB gateway
The XMEGA UARTC0 is connected to a UART on the AT32UC3B1256. The
AT32UC3B1256 UART is communicating at 115200 baud, using one start bit, eight
data bits, one stop bit, and no parity.
When the AT32UC3B1256 device is enumerated (connected to a PC), the data
transmitted from the XMEGA is passed on to a (virtual) COM port. This means that it
is possible to use a terminal program to receive the transmitted data on a PC.
Similarly, data transmitted from the PC COM port is passed on to the XMEGA UART
through the gateway.
NOTE
The AT32UC3B1256 is also connected to the shared SPI and TWI lines, and so it is
also possible to add TWI and SPI gateway functionality for these serial interfaces, if
desired. This gateway functionality is not available in the default firmware for the
AT32UC3B1256. Please refer to the schematics for more information about these
connections.
3
8370C-AVR-12/11
4 Connectors
The Atmel XMEGA-A1 Xplained kit has five 10-pin, 100mil headers. One header is
used for programming the Atmel ATxmega128A1, and the others are used to access
spare analog and digital pins on the XMEGA (expansion headers).
4.1 Programming headers
The XMEGA can be programmed and debugged by connecting an external
programming/debugging tool to the JTAG and PDI header (J201). The header has a
standard JTAG programmer pin-out (refer to online help in the Atmel AVR Studio),
and tools like the JTAGICE mkII or AVR ONE! can thus be connected directly to the
header. If it is desired to use PDI programming/debugging, an adapter must be used.
Due to physical differences of the JTAGICE mkII and AVR ONE! probes, the PCB has
an opening below the JTAG and PDI header. This is to make room for the orientation
tap on the JTAGICE mkII probe.
Because JTAG TDO and PDI DATA are connected on the PCB for this kit, JTAG
must be disabled on the device in order to use PDI. The reason for this is that when
JTAG is enabled it will enable a pull-up internally on TDO which interferes with the
PDI initialization sequence.
The connection of JTAG_TDO with PDI_DATA is also an issue when the application
on the device uses the JTAG_TDO pin e.g. by driving this pin actively or by using a
pull-up. This will interfere with ongoing PDI communication. Additionally, when JTAG
is disabled and the application is driving the JTAG_TDO pin it might even be not
possible to establish a PDI connection. A workaround for this is to add a ~1k resistor
from PDI_CLK/RESET to GND. This will keep the device in reset while PDI is
enabled. When a PDI connection is established the flash can be erased or JTAG can
be enabled in order to "unlock" the kit.
Table 4-1. XMEGA programming and debugging interface – JTAG and PDI.
J201 pin
JTAG (1)
PDI (2)
1
TCK
-
2
GND
GND (3)
3
TDO
DATA
4
VCC
VCC (3)
5
TMS
-
6
nSRST
CLK
7
-
-
8
-
-
9
TDI
-
10
GND
GND (3)
Notes:
1. Standard pin-out for JTAGICE mkII and other Atmel programming tools.
2. Requires adapter to connect a JTAGICE mkII (refer to AVR Studio help).
3. It is only required to connect on VCC/GND pin.
The Atmel AT32UC3B1256 can be programmed through its boot loader. The boot
loader is evoked by shorting the J600 jumper before applying power to the board. The
4
Atmel AVR1924
8370C-AVR-12/11
Atmel AVR1924
programming is performed through the FLIP plug-in in AVR Studio (which can also be
started as a standalone application).
FLIP (Flexible In-system Programmer) is free Atmel proprietary software that runs on
Windows® 9x/Me/NT/2000/XP and Linux® x86. FLIP supports in-system programming
of flash devices through RS232, USB, or CAN.
Alternatively, the AT32UC3B1256 can be programmed by connecting a programming
tool, such as JTAGICE mkII, to test points TP600-607.
NOTE
It is not recommended to program the AT32UC3B1256 using a programming tool, as
this will erase the boot loader.
4.2 I/O expansion headers
The XMEGA analog PORTA is available on the J2 header. This allows the user to
connect external signals to the analog-to-digital converter (ADC), digital-to-analog
converter (DAC), and analog comparators on PORTA.
The XMEGA digital PORTF and PORTC are available on the J1 and J4 headers,
respectively. These ports feature general-purpose I/O and various communication
modules (USART, SPI, and TWI). PORTD and PORTF are mixed on the J3 header.
NOTE
The communication modules on PORTC and PORTF can be interconnected to test
various functions and features: The USART can loop back communication with a
jumper, or communicate between the two USARTs on the port. The native SPI and
the USART in SPI master mode can be connected, and the TWI module can be
enabled in both master and slave modes at the same time to get loop-back behavior.
(Pull-up resistors can be mounted on R101 and R102. These are not mounted from
the factory.)
5
8370C-AVR-12/11
5 Attached memories
The Atmel XMEGA-A1 Xplained kit demonstrates how to use the external bus
interface (EBI) module to connect a 4-bit SDRAM. An 8MB SDRAM (16Mb x 4) is
attached in three-port EBI mode (PORTH, PORTK, and PORTJ).
6
Atmel AVR1924
8370C-AVR-12/11
Atmel AVR1924
6 Miscellaneous I/O
6.1 Mechanical button switches
Eight mechanical button switches are connected to XMEGA PORTD(PD0:PD5) and
PORTR(PR0:PR1). Internal pull-ups should be enabled to detect when the buttons
are pushed, as they short the respective line to GND.
NOTE
Buttons share the pins with the J3 header: Pushing the buttons potentially affects
communication or other functionality on these pins.
6.2 LEDs
Eight yellow LEDs are connected to XMEGA PORTE. The LEDs are active low, and
thus light up when the respective lines are output low by the XMEGA.
One green and one red LED are inside the same package and therefore the colors
can be mixed to orange when both are activated. The red LED can be activated by
driving the connected I/O line to GND. The green LED is controlled via a FET and is
by default on when the board is powered. However this power indicator LED can also
be turned off by driving the gate of the FET to GND. Both LEDs are controlled by the
Atmel AT32UC3B1256. The default firmware will use the red LED to signal activity on
the UART to USB bridge by toggling the LED.
6.3 Analog I/O
An NTC temperature sensor and a light sensor are connected to PORTB on PB0 and
PB1, respectively. These analog references can be used as input to the ADC.
An audio amplifier (and mono speaker) is connected to PORTB on pin PB2. This pin
is connected to the XMEGA DAC, and thus offers a way to generate sound.
7
8370C-AVR-12/11
7 Included code example
The example application is based on the Atmel AVR Software Framework found
online at http://asf.atmel.no. For documentation, help, and examples on the drivers
used, please see the website.
For more information about the included code example, see the Atmel application
note “AVR1927: XMEGA-A1 Xplained Getting Started Guide”.
7.1 Compiling and running
The code examples to be found in ASF can be compiled by running make on the
makefile included in the project, or by opening the project in IAR™, and compiling the
project within IAR.
8
Atmel AVR1924
8370C-AVR-12/11
Atmel AVR1924
8 Further code examples and drivers
Several Getting-Started trainings for the Atmel XMEGA-A1 Xplained kit can be
downloaded from the Atmel website. These trainings offer general introduction to
XMEGA peripherals. Please refer to AVR1500 through AVR1510.
Further information and drivers for XMEGA can be downloaded as application notes,
also distributed from the Atmel website.
9
8370C-AVR-12/11
9 Known issues
9.1 Light sensor
The output range of the light sensor is 0V – 3.3V. The ADC reference must therefore
be high enough to match the output range of the light sensor when performing
measurements.
9.2 USB test points
Touching the test points of the USB data lines on the reverse side of the board while
there is an ongoing communication, might interrupt the device and cause the device
to stop responding. The kit must be reconnected to start working properly again.
9.3 PDI initialization
Because JTAG_TDO and PDI_DATA are connected on the PCB for this kit, JTAG
must be disabled on the device in order to use PDI. The reason for this is that when
JTAG is enabled it will enable a pull-up internally on TDO which interferes with the
PDI initialization sequence.
The connection of JTAG_TDO with PDI_DATA is also an issue when the application
on the device uses the JTAG_TDO pin e.g. by driving this pin actively or by using a
pull-up. This will interfere with ongoing PDI communication. Additionally, when JTAG
is disabled and the application is driving the JTAG_TDO pin it might even not be
possible to establish a PDI connection. A workaround for this is to add a ~1k resistor
from PDI_CLK/RESET to GND. This will keep the device in reset while PDI is
enabled. When a PDI connection is established the flash can be erased or JTAG can
be enabled in order to "unlock" the kit.
10
Atmel AVR1924
8370C-AVR-12/11
Atmel AVR1924
10 Revision history
The revision of the evaluation kit can be found on the sticker on the reverse side of
the PCB.
10.1 Revision 7
The Atmel XMEGA-A1 Xplained kit, revision 7, is the first released revision of the
XMEGA-A1 Xplained kit.
This kit replaces the Atmel Xplain evaluation kit. Information about the original Xplain
evaluation kit can be found in the Atmel application note AVR1907: Xplain Hardware
User’s Guide.
10.2 Revisions 1 to 6
Not released.
11
8370C-AVR-12/11
11 Table of contents
Features ............................................................................................... 1
1 Introduction ...................................................................................... 1
2 Related items.................................................................................... 2
3 General information......................................................................... 2
3.1 Preprogrammed firmware.................................................................................... 2
3.2 Power supply ....................................................................................................... 3
3.3 Measuring the XMEGA power consumption ....................................................... 3
3.4 Programming the XMEGA through the UART-to-USB gateway ......................... 3
3.5 Communication through the UART-to-USB gateway .......................................... 3
4 Connectors ....................................................................................... 4
4.1 Programming headers......................................................................................... 4
4.2 I/O expansion headers ........................................................................................ 5
5 Attached memories.......................................................................... 6
6 Miscellaneous I/O............................................................................. 7
6.1 Mechanical button switches ................................................................................ 7
6.2 LEDs.................................................................................................................... 7
6.3 Analog I/O............................................................................................................ 7
7 Included code example ................................................................... 8
7.1 Compiling and running ........................................................................................ 8
8 Further code examples and drivers ............................................... 9
9 Known issues................................................................................. 10
9.1 Light sensor ....................................................................................................... 10
9.2 USB test points.................................................................................................. 10
9.3 PDI initialization ................................................................................................. 10
10 Revision history ........................................................................... 11
10.1 Revision 7........................................................................................................ 11
10.2 Revisions 1 to 6 ............................................................................................... 11
11 Table of contents ......................................................................... 12
12
Atmel AVR1924
8370C-AVR-12/11
Atmel Corporation
2325 Orchard Parkway
San Jose, CA 95131
USA
Tel: (+1)(408) 441-0311
Fax: (+1)(408) 487-2600
www.atmel.com
Atmel Asia Limited
Unit 01-5 & 16, 19F
BEA Tower, Milennium City 5
418 Kwun Tong Road
Kwun Tong, Kowloon
HONG KONG
Tel: (+852) 2245-6100
Fax: (+852) 2722-1369
Atmel Munich GmbH
Business Campus
Parkring 4
D-85748 Garching b. Munich
GERMANY
Tel: (+49) 89-31970-0
Fax: (+49) 89-3194621
Atmel Japan
16F, Shin Osaki Kangyo Bldg.
1-6-4 Osaki Shinagawa-ku
Tokyo 104-0032
JAPAN
Tel: (+81) 3-6417-0300
Fax: (+81) 3-6417-0370
© 2011 Atmel Corporation. All rights reserved.
®
®
®
®
®
Atmel , Atmel logo and combinations thereof, AVR , AVR Logo , AVR Studio , XMEGA and others are registered trademarks or
®
trademarks of Atmel Corporation or its subsidiaries. Windows and others are registered trademarks of Microsoft Corporation in U.S.
and or other countries. Other terms and product names may be trademarks of others.
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to
any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL
TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE
LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION,
DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO
USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or
warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and
product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically
provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or
warranted for use as components in applications intended to support or sustain life.
8370C-AVR-12/11