AVR32924: UC3-L0 XPLAINED Hardware User's Guide Features • Atmel® AT32UC3L064 microcontroller • Atmel AT32UC3B1256 - Board controller - Communication gateway • Analog input (to ADC) - Temperature sensor - RC filter • Digital I/O - One mechanical button switch - Three LEDs - Four expansion headers • Footprints for external memory ® - Atmel AT45DB series DataFlash serial flash - Atmel AT25DF series industry standard serial flash • Touch - One Atmel QMatrix™ slider (alt. four QMatrix buttons) - One Atmel QTouch® button 32-bit Microcontrollers Application Note 1 Introduction The Atmel UC3-L0 Xplained evaluation kit is a hardware platform to evaluate the Atmel AT32UC3L064 microcontroller. The kit offers a large range of features that enables the Atmel AVR® UC3™ user to get started using UC3 peripherals right away and understand how to integrate the UC3 device in their own design. Figure 1-1. UC3-L0 Xplained evaluation kit. Rev. 32156A-AVR-01/11 2 Related items AVR32 Studio® (free Atmel 32-bit IDE) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4116 AVR JTAGICE mkII (on-chip programming and debugging tool) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3353 AVR ONE! (on-chip programming and debugging tool) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4279 AVR Software Framework (ASF) http://asf.atmel.no/selector/show.php?device=uc3&store=app 3 General information This document targets the Atmel AT32UC3L064 evaluation kit revision 4, and parts of the document may, therefore, be inconsistent with earlier revisions of the product. For earlier revisions, please refer to the schematics, which is the only documentation available for these revisions. The Atmel UC3-L0 Xplained kit is intended to demonstrate the AT32UC3L064 microcontroller, and the hardware that relates to the Atmel AT32UC3B1256 (board controller) is, therefore, not covered in detail in this document. Figure 3-1. Overview of the UC3-L0 Xplained kit. 2 AVR32924 32156A-AVR-01/11 AVR32924 Figure 3-2. Functional overview of the Atmel UC3-L0 Xplained kit. EXPANSIONS Four standard 10 pin headers that can be used with various top cards Button LEDs Dataflash HID QTouch button MEMORIES QMatrix slider AT32UC3L064 Temperature Sensor, PWM Voltage generation JTAG USART/TWI AT32UC3B1256 DEBUG USB Device 3.1 Preprogrammed firmware The Atmel AT32UC3L064 and the Atmel AT32UC3B1256 that come with the Atmel UC3-L0 Xplained kit are both preprogrammed. The preprogrammed firmware in the AT32UC3L064 is set up with a small demo with the Atmel QMatrix touch slider and Atmel QTouch button that can be used to control the RGB LED. The device also features a UART boot loader that can be used to program new firmware to the device. Hold the mechanical button while applying power to start the boot loader. The boot loader can be used with the command line tool “batchISP” delivered with FLIP. The preprogrammed AT32UC3B1256 firmware offers features such as a boot loader for self-programming of the board controller itself and a UART-to-USB gateway. The bootloader can be started by shorting the 2-pin header (not mounted) while applying power to the board. The bootloader can be used with the command line tool “batchISP” delivered with FLIP. 32156A-AVR-01/11 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). The 5V is regulated down to 3.3V with an onboard LDO regulator, which provides power to the entire board. The Atmel AT32UC3L064 is powered by 3.3V, but if 1.8V operation is desired, some modifications to the board are needed. This includes replacing the regulator with one that delivers 1.8V output and rerouting the power to the device (see schematic for explanation). As some of the other ICs on the Atmel UC3-L0 Xplained require 3.3V to operate correctly, these devices have to be removed also. 3.3 Measuring the AT32UC3L064 power consumption As part of an evaluation of the AT32UC3L064, it can be of interest to measure its power consumption. The two-pin header with a jumper mounted on it is the only connection between the common power plane VCC_P3V3 and the VCC_MCU_P3V3 power plane. By replacing the jumper with an ampere meter, it is possible to determine the current consumption of the AT32UC3L064. To locate the power measurement header, please refer to Figure 3-1. WARNING Do not power the board without having the jumper or an ampere meter mounted. Otherwise, the device may be damaged. 3.4 Programming the AT32UC3L064 through the UART-to-USB gateway The AT32UC3L064 can be programmed through the UART-to-USB gateway. This can be accomplished using the UART boot loader preprogrammed in the device. Press and hold the mechanical button switch while powering up the board to enter the boot loader, and use 32-bit AVR Studio to set up a programming connection to the device. NOTE If the default board controller firmware is replaced, programming of the AT32UC3L064 may not be possible as the UART-to-USB functionality might be missing. NOTE If any external programming tool is used on the AT32UC3L064, the boot loader might be erased, and it will not be possible to program the device through the UART-to-USB gateway. In this case the boot loader has to be restored with an external programming tool. 3.5 Communication through the UART-to-USB gateway The AT32UC3L064 UART is connected to a UART on the Atmel AT32UC3B1256. The AT32UC3B1256 UART 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 AT32UC3L064 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 AT32UC3L064 UART through the gateway. 4 AVR32924 32156A-AVR-01/11 AVR32924 4 Connectors The Atmel UC3-L0 Xplained kit has five 10-pin, 100mil headers. Two headers have a fixed communication interface (J1 and J4). One header has analog functionality (J2), and the last header (J3) has general purpose digital I/O. The 90° angled header is the JTAG programming and debugging header for the AT32UC3L064. For the location of the respective headers, refer to Figure 3-1. 4.1 Programming headers The Atmel AT32UC3L064 can be programmed and debugged by connecting an external programming/debugging tool to the JTAG header. The header has a standard JTAG programmer pinout (refer to online help in AVR Studio), and tools such as JTAGICE mkII or AVR ONE! can thus be connected directly to the header. NOTE The grey female 10-pin header on JTAGICE mkII has to be used when connecting to the kit. A scoring in the board is made to fit the orientation tab on the header. NOTE A standoff adapter (no. 1) is needed Pin 1 on the JTAG header is at the top right corner. This is rotated 180° compared to the other headers (J1, J2, J3, and J4).J1, J2, J3, and J4). Table 4-1. UC3 programming and debugging interface – JTAG. Pin JTAG (1) 1 TCK 2 GND 3 TDO 4 VCC 5 TMS 6 nSRST 7 - 8 - 9 TDI 10 GND Note: 1. Standard pinout for JTAGICE mkII and other Atmel programming tools. The Atmel AT32UC3B1256 can be programmed through its boot loader. The boot loader is evoked by shorting the two holes close to the device before applying power to the board. The two holes have 100mil spacing, so the user can solder in a two-pin header and use a jumper to easily enter the boot loader. Programming is performed through the boot loader programmer target in the Atmel AVR32 Studio. Alternatively, the AT32UC3B1256 can also be programmed by connecting a programming tool, such as JTAGICE mkII, to the 10-pin test points on the bottom side of the board (marked with BC JTAG). NOTE 32156A-AVR-01/11 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 There are four available I/O expansion headers on the kit. Because of the low pin count on the device, the I/O expansion header pins are shared with onboard functionality. If “clean” expansion ports are needed, cut-straps are available on some of the ADC inputs. Otherwise, it is only needed to remove a series resistor to remove onboard functionality. Table 4-2 show what is shared on the respective header pins. Table 4-2. UC3 I/O expansion header – J1. Pin J1 UC3 pin Shared with onboard functionality 1 TWI SDA PA21 Header J4, board controller 2 TWI SCL PB05 Header J4, board controller 3 UART RX PB11 Header J4 4 UART TX PB10 Header J4 5 SPI CS1 PA08 - 6 SPI MOSI PB03 Header J4, DataFlash® 7 SPI MISO PB02 Header J4, DataFlash 8 SPI SCK PB01 Header J4, DataFlash 9 GND - - 10 VCC_P3V3 - - Table 4-3. UC3 I/O expansion header – J2. Pin UC3 pin Shared with onboard functionality ADC0 (1) PA14 RC filter output ADC1 (2) PA15 QMatrix slider X0 ADC2 (1) PA16 Shorted to GND 4 ADC4 (1) PA18 NTC 5 ADC7 PB07 - PB08 QMatrix slider X3 PB06 - PB19 QMatrix slider X1 1 2 3 J2 6 ADC8 7 ADC6 (2) (2) 8 ADC5 9 GND - - 10 VCC_ANA_P3V3 - - Notes: 1. ADC channels can be disconnected from onboard functions by cutting the available cut-straps on the bottom side of the board. 2. ADC channels are shared with the Atmel QMatrix slider. Remove resistors on the lines to separate the sensors from the ADC. 6 AVR32924 32156A-AVR-01/11 AVR32924 Table 4-4. UC3 I/O expansion header – J3. Pin J3 UC3 pin Shared with onboard functionality 1 PWM0 PA13 RGB LED (RED), RC filter input 2 PWM1 PA17 RGB LED (GREEN) 3 PWM2 PA20 RGB LED (BLUE) 4 PWM3 PA22 QMatrix slider X2 5 PWM4 PB12 QTouch SNS 6 PWM5 PB09 QTouch SNSK 7 PWM6 PB04 LED1 PA11 LED0, mechanical button - - - - 8 PWM7 9 GND 10 (1) VCC_P5V0 Notes: (2) 1. Mechanical button and LED0 are sharing I/O. Use input with pull-up to turn off LED, and output low to turn on LED. 2. The VCC pin on this header has 5V and is connected to the USB power. Table 4-5. UC3 I/O expansion header – J4. 32156A-AVR-01/11 Pin J4 UC3 pin Shared with onboard functionality 1 TWI SDA PA21 Header J1, board controller 2 TWI SCL PB05 Header J1, board controller 3 UART RX PB11 Header J1 4 UART TX PB10 Header J1 5 SPI CS4 PB00 - 6 SPI MOSI PB03 Header J1, DataFlash 7 SPI MISO PB02 Header J1, DataFlash 8 SPI SCK PB01 Header J1, DataFlash 9 GND - - 10 VCC_P3V3 - - 5 Memories The Atmel UC3-L0 Xplained does not have any external memories mounted on the board. Footprints are available for adding either an industrial standard or a proprietary Atmel DataFlash serial flash. NOTE The footprints share the same SPI lines, including the chip select, and so it is not possible to mount a device on both footprints at the same time. Table 5-1. Compatible devices for the footprints. AT45DB AT25DF AT45DB64D2-CNU AT25DF641A-SH AT45DB321D-MWU AT25DF321A-SH AT45DB161D-SS AT25DF161-SH AT45DB081D-SS AT25DF081-SSH AT45DB041D-SS AT25DF021-SSH AT45DB021D-SS AT45DB011D-SS 8 AVR32924 32156A-AVR-01/11 AVR32924 6 Miscellaneous I/O 6.1 Mechanical button switch The board is equipped with one mechanical button switch. The button is shared with LED0, and onboard protection circuitry is added to avoid a short when driving the port high at the same time as pushing the button, which will short it to ground. To be able to use both button and LED, time multiplexing has to be used. To be able to detect a button press, the firmware has to periodically set the I/O pin to input with pull-up and check if it is low. When done fast enough, the human eye will not see any change on the LED. 6.2 LEDs The Atmel UC3-L0 Xplained has three LEDs mounted onboard that are connected to the Atmel AT32UC3L064. These include two standard yellow LEDs and one RGB LED. The two yellow LEDs are active low, while the RGB LED is active high. LED0 is shared with the mechanical button. When turning this LED on, set the I/O pin to output low. When turning the LED off, set the I/O pin as input with pull-up. When the LED is turned on, the protection circuitry added to the button will make the LED shine brighter when the button is pressed. When the LED is off, any button press will light up the LED. One additional dual LED is mounted near the USB connector. This is the power and status LED, which is connected to the board controller. This LED will be green when power is applied, and will toggle between green and orange when communication over USB is ongoing. 6.3 Analog I/O A RC filter and an NTC are connected to ADC0 and ADC4 respectively. These analog references can be used as input to the ADC. Both analog references can be disconnected by cutting the cut-straps on the bottom side of the board. The RC filter (1st order low-pass) has an approximate 3dB cut-off frequency of 160Hz. The input to the RC filter is one of the UC3 GPIO pins that can be configured to output a PWM signal to the RC filter. This can be used to generate a DC voltage on the output of the RC filter, which can be measured on the ADC. As this is a 1st order filter, the ripple on the DC voltage is proportional to the input frequency. A higher input frequency will give lower ripple on the output. 6.4 Touch The UC3-L0 Xplained kit has one Atmel QTouch button and one Atmel QMatrix slider implemented onboard. The button and the slider are connected to the built-in CAT module in the AT32UC3L064. The QMatrix slider can be reconfigured to be used as four separate buttons instead of as a slider. 32156A-AVR-01/11 Table 6-1. UC3 touch connections. Touch sensor onboard reference QTouch method pin name QMatrix method pin name CAT module pin name UC3 pin Selection bit in PINMODEx register QSlider X0 X7 CSB6 PA15 SP6 QSlider X1 X10 CSA10 PA19 SP10 QSlider X2 X11 CSB10 PA22 SP10 QSlider X3 X13 CSB12 PB08 SP12 QSlider YK0 YK3 CSB7 PA05 SP7 - Y3 CSA7 PA04 SP7 QButton SNSK0 SNSK15 CSB15 PB09 SP15 - SNS15 CSA15 PB12 SP15 NOTE As the device has a very low pin count, a tradeoff has been made to be able to have as many I/O lines as possible routed to the headers. The sensor lines to the Atmel QTouch button and the Atmel QMatrix slider are shared with some of the headers. The sensitivity of the sensor lines is very high on these exposed pins, and so touching the I/O pins will give erroneous result in the touch sensing mechanism. NOTE Adding top modules to the board with functionality connected to these pins is not recommended. Top modules without functionality on these pins will only add some capacitive load and will not affect the QMatrix sensor significantly. 6.5 Board controller The board controller and the Atmel AT32UC3L064 are connected together through TWI and UART. Both interfaces can be used to communicate between the devices, but only the UART is implemented by default in the board controller. Table 6-2. AT32UC3L064 and board controller communication interface. Interface UART RX (1) UART TX (1) Atmel AT32UC3B1256 pin PA07 PA24 PA06 PA23 TWI SCL PB05 PA09 TWI SDA PA21 PA10 Note: 10 Atmel AT32UC3L064 pin 1. These represent the RX and TX on the device. The RX on one device is connected to TX on the other device, and visa versa. AVR32924 32156A-AVR-01/11 AVR32924 7 Included code example The example application is based on the Atmel AVR Software Framework found online at http://asf.atmel.no. The example can be found in the path “avr32\applications\uc3-l0_xplained” in the ASF. For documentation, help, and examples on the drivers used, please see the website. 7.1 Compiling and running The code examples that can 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 Known Issues 8.1 Light sensor The output range on 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 doing measurements. 8.2 USB test points Touching the test points for the USB data lines on the back side of the board while there is ongoing communication might interrupt the device and cause the device to stop responding. The kit must be reconnected to start working properly again. 32156A-AVR-01/11 9 Revision history Revision 4 of the Atmel UC3-L0 Xplained kit is the first revision released. 9.1 Revision 4 Revision 4 of the UC3-L0 Xplained kit can be identified by a bar-code sticker on the back side with the following product ID: A09-1053/4. 12 AVR32924 32156A-AVR-01/11 AVR32924 10 EVALUATION BOARD/KIT IMPORTANT NOTICE This evaluation board/kit is intended for use for FURTHER ENGINEERING, DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY. It is not a finished product, and may not (yet) comply with some or any technical or legal requirements that are applicable to finished products, including, without limitation, directives regarding electromagnetic compatibility, recycling (WEEE), FCC, CE, or UL (except as may be otherwise noted on the board/kit). Atmel supplied this board/kit “AS IS,” without any warranties, with all faults, at the buyer’s and further users’ sole risk. The user assumes all responsibility and liability for proper and safe handling of the goods. Further, the user indemnifies Atmel from all claims arising from the handling or use of the goods. Due to the open construction of the product, it is the user’s responsibility to take any and all appropriate precautions with regard to electrostatic discharge and any other technical or legal concerns. EXCEPT TO THE EXTENT OF THE INDEMNITY SET FORTH ABOVE, NEITHER USER NOR ATMEL SHALL BE LIABLE TO EACH OTHER FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES. No license is granted under any patent right or other intellectual property right of Atmel covering or relating to any machine, process, or combination in which such Atmel products or services might be or are used. Mailing Address: Atmel Corporation, 2325 Orchard Parkway, San Jose, CA 95131 32156A-AVR-01/11 11 Table of Contents Features ............................................................................................... 1 1 Introduction ...................................................................................... 1 2 Related items.................................................................................... 2 3 General information......................................................................... 2 3.1 Preprogrammed firmware.................................................................................... 3 3.2 Power supply ....................................................................................................... 4 3.3 Measuring the AT32UC3L064 power consumption ............................................ 4 3.4 Programming the AT32UC3L064 through the UART-to-USB gateway .............. 4 3.5 Communication through the UART-to-USB gateway .......................................... 4 4 Connectors ....................................................................................... 5 4.1 Programming headers......................................................................................... 5 4.2 I/O expansion headers ........................................................................................ 6 5 Memories .......................................................................................... 8 6 Miscellaneous I/O............................................................................. 9 6.1 Mechanical button switch .................................................................................... 9 6.2 LEDs.................................................................................................................... 9 6.3 Analog I/O............................................................................................................ 9 6.4 Touch................................................................................................................... 9 6.5 Board controller ................................................................................................. 10 7 Included code example ................................................................. 11 7.1 Compiling and running ...................................................................................... 11 8 Known Issues................................................................................. 11 8.1 Light sensor ....................................................................................................... 11 8.2 USB test points.................................................................................................. 11 9 Revision history ............................................................................. 12 9.1 Revision 4.......................................................................................................... 12 10 EVALUATION BOARD/KIT IMPORTANT NOTICE ...................... 13 11 Table of Contents......................................................................... 14 14 AVR32924 32156A-AVR-01/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 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chou-ku, Tokyo 104-0033 JAPAN Tel: (+81) 3523-3551 Fax: (+81) 3523-7581 © 2011 Atmel Corporation. All rights reserved. / Rev.: CORP072610 ® ® ® ® ® Atmel , Atmel logo and combinations thereof, AVR , AVR Studio , DataFlash , QTouch and others are registered trademarks of Atmel Corporation or its subsidiaries. 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. 32156A-AVR-01/11