Atmel-42084-XMEGA-E5-Xplained-Hardware-Users-Guide Application

Atmel-42084-XMEGA-E5-Xplained-Hardware-Users-Guide Application

APPLICATION NOTE

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s

Guide

Atmel AVR XMEGA E

Features

Atmel

®

AVR

®

ATxmega32E5 microcontroller

OLED display with 128×32 pixels resolution

Ambient light sensor

Analog filter

Rotary Encoder with push button

Digital I/O

Two mechanical buttons

Two user LEDs

Four expansion headers

Board controller with USB interface

One power LED and one status LED

Description

The Atmel AVR XMEGA-E5 Xplained evaluation kit is a hardware platform to evaluate the Atmel ATxmega32E5 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. XMEGA-E5 Xplained evaluation kit.

42084A

−AVR−04/2013

Table of Contents

1.  Related Items ....................................................................................... 3 

2.  General Information ............................................................................. 4 

2.1

 

Preprogrammed firmware ................................................................................. 4

 

2.2

 

Power supply..................................................................................................... 4

 

2.3

  Measuring the Atmel AVR XMEGA power consumption ................................... 5  

2.4

  Communication through the USART-to-USB gateway ...................................... 5  

2.5

  Programming the kit .......................................................................................... 5  

3.  Connectors ........................................................................................... 6 

3.1

  Programming headers ....................................................................................... 6  

3.2

  I/O expansion headers ...................................................................................... 6  

4.  Peripherals ........................................................................................... 9 

4.1

  Mechanical buttons ........................................................................................... 9  

4.2

  LEDs …… .......................................................................................................... 9  

4.3

  Quadrature encoder .......................................................................................... 9  

4.4

  OLED display .................................................................................................... 9  

4.5

  Analog I/O ....................................................................................................... 10  

4.5.1

  Ambient light sensor ......................................................................... 10  

4.6

  Board controller ............................................................................................... 11  

5.  Code Examples .................................................................................. 12 

6.  Revision History ................................................................................. 13 

6.1

 

Revision history of the document .................................................................... 13

 

6.2

 

Revision history of the kit ................................................................................ 13

 

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

2

1.

Related Items

The following list contains links to the most relevant documents, software and tools for the Atmel AVR XMEGA-E5

Xplained:

Atmel AVR Xplained products

Xplained is a series of small-sized and easy-to-use evaluation kits for 8- and 32-bit AVR microcontrollers. It consists of a series of low cost MCU boards for evaluation and demonstration of feature and capabilities of different MCU families.

Atmel Xplained USB CDC driver

The Xplained USB CDC driver file supports both 32- and 64-bit versions of Windows

®

XP and Windows 7. Driver installs are not necessary on Linux

®

operating systems.

XMEGA-E5 Xplained schematics

Package containing schematics, BOM, assembly drawings, 3D plots, layer plots…

AT02667: XMEGA-E5 Xplained Hardware Users Guide

This document.

AT02657: XMEGA-E5 Xplained Software User Guide

This application note is a user guide for the XMEGA-E5 Xplained demo software.

Atmel Studio 6

Atmel Studio 6 is a free Atmel IDE for development of C/C++ and assembler code for Atmel microcontrollers.

Atmel JTAGICE3

JTAGICE3 is a mid-range development tool for Atmel 8- and 32-bit AVR microcontrollers with on-chip debugging for source level symbolic debugging, NanoTrace (if supported by the device) and device programming.

Atmel AVR JTAGICE mkII

AVR JTAGICE mkII is a mid-range development tool for Atmel 8- and 32-bit AVR devices with on-chip debugging for source level symbolic debugging, NanoTrace (if supported by the device), and device programming (superseded by

JTAGICE3).

Atmel AVR ONE!

AVR ONE! is a professional development tool for all Atmel 8- and 32-bit AVR devices with on-chip debug capability. It is used for source level symbolic debugging, program trace, and device programming. The AVR ONE! supports the complete development cycle and is the fastest debugging tool offered from Atmel.

Atmel AVR Dragon

AVR Dragon™ sets a new standard for low cost development tools for 8- and 32-bit AVR devices with on-chip debug

(OCD) capability.

IAR Embedded Workbench

®

for Atmel AVR

IAR™ Embedded Workbench is a commercial C/C++ compiler that is available for 8-bit AVR. There is a 30 day evaluation version as well as a 4k (code size limited) kick-start version available from their website.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

3

2.

General Information

The Atmel AVR XMEGA-E5 Xplained kit is intended to demonstrate the Atmel AVR ATxmega32E5

microcontroller. Figure 2-1

shows the available feature on the board.

Figure 2-1. Overview of the XMEGA-E5 Xplained kit.

Header J 1

Power measurement

PDI header header

USB connector

Header J 3

Mechanical button

SW0

User LEDs

0 and 1

Power & Status LEDs

Quadrature encoder selection switch

SW103

Mechanical button

SW1

Quadrature encoder

SW102

Light sensor

2.1

Header J 2 OLED display Header J 4

Preprogrammed firmware

The ATxmega32E5 on the XMEGA-E5 Xplained is pre-programmed with a default firmware. The detailed description of the software is available in the AT02657 XMEGA-E5 Xplained Software User Guide. Project and source files are available within Atmel Studio and Atmel Software Framework.

2.2

Power supply

The kit needs an external power supply that can deliver 5V and up to 500mA. The actual current requirement for the board is much less than 500mA but in order to be able to power optional expansion boards this margin is recommended.

The power can be applied to the board either via the USB connector or on pin 10 on the header J3. The USB connector is the preferred input because it is then possible to connect expansion boards on top of the J3 header.

The 5V (USB supply voltage) is regulated down to 3.3V with an onboard LDO regulator, which provides power to the entire board. Expansion top boards that require 5V will get this from the header J3 pin 10.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

4

2.3

Measuring the Atmel AVR XMEGA power consumption

As part of an evaluation of the Atmel AVR ATxmega32E5, it can be of interest to measure its power consumption.

Because the XMEGA has a separate power plane (VCC_MCU_P3V3) on this board it is possible to measure the current consumption by measuring the current that is flowing into this plane. The VCC_MCU_P3V3 plane is connected via a jumper to the main power plane (VCC_P3V3) and by replacing this with an ampere meter it is possible to determine the current consumption. To locate the power measurement header, please refer to

Figure 2-1 .

Warning:

Do not power the board without having the jumper or an ampere meter mounted since this can cause latch-up of the Atmel AVR ATxmega32E5 due to current flow into the I/O pins.

2.4

Communication through the USART-to-USB gateway

The ATxmega32E5 USART is connected to a USART on the Atmel AT32UC3B1256. The ATxmega32E5 USART is communicating at 57600 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 ATxmega32E5 is passed to a (virtual) COM port. This means that it is possible to use a terminal program on a PC to receive the transmitted data. Similarly data transmitted from the PC COM port is passed to the ATxmega32E5 USART through the gateway.

2.5

Programming the kit

The kit can be programmed using an external programming tool.

How a programmer can be connected to the kit is described in Section

3.1

.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

5

3.

Connectors

The Atmel AVR XMEGA-E5 Xplained kit has four 10-pin, 100mil headers and one 6-pin 100mil header. The 6-pin header is used for programming the Atmel AVR ATxmega32E5, and the 10-pin headers are used to access spare analog and digital pins on the Atmel AVR XMEGA (expansion headers).

3.1

3.2

Programming headers

The XMEGA can be programmed and debugged by connecting an external programming/debugging tool to the PDI header shown in

Figure 2-1 .

The grey XMEGA PDI adapter must be used on the Atmel AVR JTAGICE mkII probe when connecting to the XMEGA-

E5 Xplained board.

The green standoff adaptor nr.3 (ref.A08-0254) has to be used on the Atmel AVR ONE! probe when connecting to the

XMEGA-E5 Xplained board.

Table 3-1. XMEGA programming and debugging interface – PDI.

4

5

6

Pin on programming header

1

2

3

PDI

DATA

VCC

-

-

CLK

GND

I/O expansion headers

The Atmel AVR XMEGA-E5 Xplained headers J1, J2, J3, and J4 offer access to the I/Os of the microcontroller in order to expand the board, for example by mounting a top module onto the board.

The header J1 offers digital communication interfaces like UART, TWI and SPI.

Table 3-2

shows how the Atmel AVR

XMEGA is connected to the header.

Note:

When using TWI please note that no pull-ups are mounted on the board from the factory, so it is required to enable the internal pull-ups of the device.

Table 3-2. Expansion header J1.

Pin on J1

7

8

5

6

3

4

1

2

9

10

Notes:

Name on J1

SDA

SCL

RXD

TXD

SS

MOSI

MISO

SCK

GND

XMEGA pin

PC0

PC1

PC2

PC3

PC4

PC7

PC6

PC5

-

Shared with onboard functionality

Connected to the Board Controller

(1)

Connected to the Board Controller

(1)

-

-

Connected to the Board Controller

(2)

Connected to the Board Controller

(2)

Connected to the Board Controller

(2)

Connected to the Board Controller

(2)

-

VCC_P3V3 - -

1. Need to mount R408/R409 to connect TWI lines to Board Controller.

2.

Need to mount R410/R411/R412/R413 to connect SPI lines to Board Controller.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

6

The header J2 is connected to analog ports of the XMEGA as shown in Table 3-3

.

Table 3-3. Expansion header J2.

6

7

8

9

10

Pin on J2

1

2

3

4

5

Name on J2

ADC0

ADC1

ADC2

ADC3

ADC4

ADC5

ADC6

ADC7

GND

VCC_P3V3

PA5

PA6

PA7

-

-

XMEGA pin

PA0

PA1

PA2

PA3

PA4

-

-

-

-

Shared with onboard functionality

-

-

-

Quadrature Encoder Button

(1)

Quadrature Encoder Output

(2)

Quadrature Encoder Output

(2)

The header J3 is connected to digital ports of XMEGA.

Table 3-4 shows the mapping of the XMEGA I/O to J3.

Table 3-4. Expansion header J3.

5

6

7

8

9

10

Pin on J3

1

2

3

4

Name on J3

GPIO0

GPIO1

GPIO2

GPIO3

GPIO4

GPIO5

GPIO6

GPIO7

GND

VCC_P5V0

XMEGA pin

PR0

PR1

QENC_A

QENC_B

PC4/ SS

PC7/MOSI

PC6/MISO

PC5/SCK

-

-

-

-

Shared with onboard functionality

Shared with OLED display: data/cmd function

Shared with OLED display: CS function

Quadrature Encoder Output

(3)

Quadrature Encoder Output

(3)

Can be disconnected from onboard functionality by cut-straps.

2. Can be disconnected using SW103 mechanical switch.

3. Quadrature encoder outputs can be accessible on this header when SW103 mechanical switch is pushed up.

The header J4 offers digital communication interfaces such as UART and TWI but care must be taken because some pins are also connected to on-board peripherals.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

7

Table 3-5. Expansion header J4.

3

4

5

6

7

8

Pin on J4

1

2

9

10

Name on J4

SDA

SCL

RXD

TXD

SS

MOSI

MISO

SCK

GND

VCC_P3V3

-

-

XMEGA pin

PD0

PD1

PD2

PD3

PD4

PD7

PD6

PD5

-

-

Shared with onboard functionality

Shared with button SW100 (silkscreen SW0)

Shared with Light sensor

(1)

Shared with button SW101(silkscreen SW1)

Shared with OLED display: reset function

Shared with LED D100 (silkscreen LED0)

Connected to the Board Controller

(2)

Connected to the Board Controller

(2)

Shared with LED D101 (silkscreen LED1)

Can be disconnected from onboard functionality by cut-strap J100.

2.

RXD and TXD lines swapped from PD3 and PD4 and used for communication with board controller.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

8

4.

4.1

4.2

4.3

4.4

Peripherals

Mechanical buttons

Two mechanical buttons are connected to Atmel AVR XMEGA. All buttons have no external pull-ups so user has to activate internal pull-ups in order to use them. When a button is pressed it will drive the I/O line to GND.

Table 4-1. Mechanical button connection.

Pin on XMEGA

PD0

PD2

Silkscreen text on PCB

SW0

SW1

LEDs

There are two yellow LEDs available on the board that can be turned on and off. The LEDs can be activated by driving the connected I/O line to GND.

Table 4-2. LED connections.

Pin on XMEGA

PD4

PD5

LED

Yellow LED0

Yellow LED1

One green LED (power indicator) and one red LED (status) are also present inside the same package and therefore the colors can be mixed to orange when both are activated. Those two LEDs are controlled via the Board Controller and user has no access to them.

Quadrature encoder

The Quadrature Encoder (SW102) is made of one mechanical button and two outputs. These outputs are connected to a mechanical switch (SW103) which enables to either connect them to the XMEGA pins or let them accessible on J3 header.

Table 4-3. Quadrature encoder connections.

Pin on XMEGA

PA5

PA6

PA7

NA

NA

Pin on J3 header

NA

NA

NA

PIN3

PIN4

Switch SW103

NA

2-1 (switch pushed down)

5-4 (switch pushed down)

2-3 (switch pushed up)

5-6 (switch pushed up)

Quadrature Encoder pins

5 (button)

1 (channel A)

3 (channel B)

1 (channel A)

3 (channel B)

OLED display

The OLED display on the XMEGA-E5 Xplained board is UG-2832HSWEG04 manufactured by WiseChip

Semiconductor Inc. It has a resolution of 128 × 32 pixels. In the design the display is connected via a SPI based interface. Detailed information about the display can be obtained from the display datasheet.

The connection between the MCU and the OLED display is shown in Table 4-4 .

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

9

Table 4-4. OLED display connection.

Pin on XMEGA

PR0

PC5

PC7

PC4

PD3

QButton

Data_command

SCK

MOSI

SS

RESET

4.5

Analog I/O

4.5.1 Ambient light sensor

The ambient light sensor TEMT6000X01 from Vishay Semiconductors is sensitive to visible light much like the human eye. The measurement circuitry is configured to measure the illuminance from ~10 to ~900lx when the internal VCC/1.6 reference is used.

The data in Table 4-6

which shows the relationship between illuminance and output voltage of the sensor circuitry is generated based on the symbols and formulas in

Table 4-5

.

Table 4-5. Symbol description for illuminance calculation.

Symbols

ICA

Ev

I

U

R

Ev = 100 × I / ICA

I = U / R

U = (Ev × R × ICA) / 100

Description

Calibrated sensor responsitivity at 100lx. This is 50µA according to the sensor datasheet

Illuminance

Current through the sensor

Output voltage of the sensor circuitry that is provided to the ADC

Series resistor of the sensor circuitry. 4.7kΩ has been chosen in this design

Illuminance is calculated based on the relation of the actual current through the sensor to the calibrated value at 100lx

Since the ADC measures the voltage across the series resistor of the sensor circuitry it is necessary to calculate the voltage based on the current

Based on the current and the illuminance the output voltage of the sensor circuitry can be calculated

Table 4-6. Illuminance vs. ADC input voltage.

40

50

60

70

80

90

100

200

300

400

Illuminance [lux]

1

10

20

30

ADC input [V]

0.0024

0.0235

0.0470

0.0705

0.0940

0.1175

0.1410

0.1645

0.1880

0.2115

0.2350

0.4700

0.7050

0.9400

Illuminance

Dusk

Dusk

Dusk

Dusk

Dusk

Living room

Living room

Living room

Living room

Living room

Living room

Office lighting

Office lighting

Office lighting

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

10

4.6

Illuminance [lux]

500

600

700

800

900

1000

ADC input [V]

1.1750

1.4100

1.6450

1.8800

2.1150

2.3500

Illuminance

Office lighting

Office lighting

Office lighting

Office lighting

Office lighting

Overcast day

Board controller

The Atmel AT32UC3B1256 board controller and the Atmel ATxmega32E5 are connected through TWI, SPI, and

USART interfaces. All interfaces can be used to communicate between the devices, but only the USART is implemented by default on the board controller.

Table 4-7. ATxmega32E5 and board controller communication interface.

Interface

UART RX

(1)

UART TX

(1)

TWI SCL

(2)

TWI SDA

(2)

SPI SS

(3)

SPI MOSI

(3)

SPI MISO

(3)

SPI SCK

(3)

ATxmega32E5 pin

PD6

PD7

PC1

PC0

PC4

PC7

PC6

PC5

Atmel AT32UC3B1256 pin

PA24

PA23

PA09

PA10

PA16

PA14

PA25

PA17

Notes:

1. This represents the RX and TX on the ATxmega32E5. The RX is connected to TX on the other device, and vice versa.

2.

3.

These TWI signals can be reconnected by placing a 0 ohm resistor or a solder drop on R408 and R409 footprints.

These SPI signals can be reconnected by placing a 0 ohm resistor or a solder drop on R410, R411, R412 and R413 footprints

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

11

5.

Code Examples

The example application is based on the Atmel AVR Software Framework that is included in Atmel Studio 6. The AVR

Software Framework can also be found as a separate package online at: http://www.atmel.com/tools/avrsoftwareframework.aspx

.

For more information about the code example, see the application note Atmel AT02657 XMEGA-E5 Xplained Software

Users Guide.

The Atmel AT32UC3B1256 board controller is also pre-programmed with a bootloader and an USART-to-USB gateway application which can be used to communicate with the target controller ATxmega32E5.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

12

6.

6.1

6.2

Revision History

Revision history of the document

Doc. Rev.

42084A

Date

04/2013

Comments

Initial document release

Revision history of the kit

To identify the revision of the Atmel AVR XMEGA-E5 Xplained kit, locate the bar-code sticker on the back side of the board. The first line on the sticker shows the product ID and the revision. For example “A09-1842/1” can be resolved to

ID=A09-1842 and revision=1.

Atmel AT02667: XMEGA-E5 Xplained Hardware User’s Guide [APPLICATION NOTE]

42084A −AVR−04/2013

13

Atmel Corporation

1600 Technology Drive

San Jose, CA 95110

USA

Tel: (+1)(408) 441-0311

Fax: (+1)(408) 487-2600 www.atmel.com

Atmel Asia Limited

Unit 01-5 & 16, 19F

BEA Tower, Millennium 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 G.K.

16F Shin-Osaki Kangyo Building

1-6-4 Osaki, Shinagawa-ku

Tokyo 141-0032

JAPAN

Tel: (+81)(3) 6417-0300

Fax: (+81)(3) 6417-0370

© 2013 Atmel Corporation. All rights reserved. / Rev.: 42084A

−AVR−04/2013

Atmel

®

, Atmel logo and combinations thereof, AVR

Corporation or its subsidiaries. Windows

®

®

, Enabling Unlimited Possibilities

®

, XMEGA

®

, and others are registered trademarks or trademarks of Atmel

is a registered trademark 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 products 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.

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project