Transcription

1 AVR1922: Xplain Board Controller Firmware Features USB interface - Mass-storage to on-board DataFlash memory Atmel AVR XMEGA TM reset control 1 Introduction The Xplain board controller, an AT90USB1287, is in charge of some of the lowlevel tasks on boards in the Xplain series. The board controller improves usability of the main microcontroller, and adds features the main controller lacks, like USB. Some of the tasks the board controller can handle are moving data to and from the board over the USB interface, for example mass-storage or USB-to-serial. Note that not all Xplain boards carry multiple microcontrollers; in these cases the main microcontroller will provide the board controller features when applicable. 8-bit Microcontrollers Application Note Figure 1-1. Board controller on the Xplain board marked in a red circle Rev.

2 2 Xplain Board Controller Hardware Features This chapter will walk through the features available when having a separate board controller. 2.1 USB Interface USB-to-serial Interface All Xplain boards features an USB connector. This connector has a dual purpose; power and USB interfaces. When the USB connector is wired to the board controller, it can be used for various tasks depending on the firmware. The main microcontroller will have one UART wired to the board controller. This serial port can then be shared as a CDC/ACM USB class (USB-to-serial) on the USB interface. Having a USB-to-serial interface can be useful for debugging the main application running on the board, or for transferring data back and forth to an external host USB Mass-storage Interface 2.2 AVR XMEGA Reset Line Control 2.3 AVR XMEGA Program and Debug Interface When connected to a PC the Xplain board can share any external memories available for the board controller as mass-storage devices on the USB interface. This will present the on-board flash memory as a block device on the host side, and users are free to use them as they like. Typically storing data files, images, etc. there, for use with the main microcontroller. The board controller has wired an I/O line to the AVR XMEGA reset line. This line can be used to control the reset state of the main microcontroller. To program the main microcontroller, the board controller is wired to the program and debug interface (PDI) on the AVR XMEGA device. This interface can be used to program new firmware into the main microcontroller from the board controller. 2 AVR1922

3 AVR Xplain Board Controller Firmware 3.1 Features The board controller firmware currently supports the following features: DataFlash initialization read and write. AVR XMEGA reset control. USB mass-storage interface. USB mode switching. The firmware will on power up hold the AVR XMEGA device in reset while it tries to probe the on-board DataFlash memory. When the firmware has identified the DataFlash device it will read the level of an I/O line to select USB mode. A low level on the I/O line will make the AT90USB1287 chip enter mass-storage mode and share the DataFlash on the USB interface, thus keeping the AVR XMEGA device in reset. If the I/O is high, the AT90USB1287 chip will release the AVR XMEGA device and enter a slave like presence, not interfering with the AVR XMEGA. The AVR XMEGA is now free to access the DataFlash on the board without interference. Table 3-1. Board Controller USB mode switching functionality overview I/O line level AVR XMEGA reset USB mass-storage Left floating / high level Released after init Disabled Pulled low / low level Held in reset after init Enabled For specific mode switching behavior on the Xplain board, see chapter USB Mode Switching on the Xplain Board on page 4. For more information about the mass-storage interface see chapter USB Massstorage Interface on page 2. 3

4 3.1.1 USB Mode Switching on the Xplain Board To select between the two different USB modes on the Xplain board, the user has to either pull the TDI pin on the JTAG USB header to ground or leave it floating. This is done by placing a jumper between TDI and GND pin, see the figure below. Figure 3-1. USB mode switch pins located on the Xplain board 4 AVR1922

5 AVR Compiling the Board Controller Firmware The following step by step guide will compile the board controller firmware for the Xplain board. 1. Download and uncompress the compressed file archive from -> Application Notes -> AVR1922 Xplain Board Controller Firmware containing the Xplain board controller source code. 2. Open up your favorite command line console and change into the directory extracted from the compressed file archive. 3. Enter the apps/xplain-bc directory. 4. Compile the application by telling the build system what kind of configuration you would like to use. This is done by setting the CONFIG symbol. For additional help, type make help on the command line. See the example below for how to compile for the Xplain board: make CONFIG=xplain-bc 5. The application s output binaries will be in the top level build/xplain-bc/xplain-bc/gnu directory. The xplain-bc.elf and xplain-bc.hex files are probably most interesting. If the user does not use the GNU toolchain, the GCC part of the path must be changed appropriately. Also, the board name must be changed if another configuration has been used. 6. Use your favorite programming software and tool to program the ELF or HEX file into the AT90USB1287 chip on the Xplain board. See chapter 4.1 Reprogramming the Xplain AT90USB1287 and ATxmega128A1 Firmware for further details. 4 Suggested Reading 4.1 Reprogramming the Xplain AT90USB1287 and ATxmega128A1 Firmware 4.2 Display Xplained Firmware Getting Started For details about how to program either device on the Xplain board see the application note AVR1921: Reprogramming the Xplain AT90USB1287 and ATxmega128A1 Firmware. This describes how to program the devices using either a programming tool, like AVRONE!, JTAGICE mkii or AVR Dragon, or programming software, like FLIP. The application note is available from the website at It is recommended to look into the AVR1913: Display Xplained Firmware Getting Started application note, as this describes how the build system works and how to start using the software framework. The application note is available from the website at 5

6 Disclaimer Headquarters International Atmel Corporation 2325 Orchard Parkway San Jose, CA USA Tel: 1(408) Fax: 1(408) Atmel Asia Unit 1-5 & 16, 19/F BEA Tower, Millennium City Kwun Tong Road Kwun Tong, Kowloon Hong Kong Tel: (852) Fax: (852) Atmel Europe Le Krebs 8, Rue Jean-Pierre Timbaud BP Saint-Quentin-en- Yvelines Cedex France Tel: (33) Fax: (33) Atmel Japan 9F, Tonetsu Shinkawa Bldg Shinkawa Chuo-ku, Tokyo Japan Tel: (81) Fax: (81) Product Contact Web Site Technical Support Sales Contact Literature Request 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 ATMEL S TERMS AND CONDITIONS OF SALE LOCATED ON ATMEL S WEB SITE, 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 OF 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 s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life Atmel Corporation. All rights reserved. Atmel, Atmel logo and combinations thereof, AVR, AVR logo, DataFlash and others, are the registered trademarks, XMEGA TM and others are trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others.

AVR922: Add a Serial Number to your USB Device Features 20 characters Serial Number Unique ID for your device Enabled/Disabled by software 1 Introduction Adding to the VID (Vendor ID) and the PID (Product

AVR1900: Getting started with ATxmega128A1 on STK600 1 Introduction This document contains information about how to get started with the ATxmega128A1 on STK 600. The first three sections contain information

AVR282: USB Firmware Upgrade for AT90USB Features Supported by Atmel FLIP program on all Microsoft O/S from Windows 98SE and later FLIP 3.2.1 or greater supports Linux Default on chip USB bootloader In-System

AVR32138: How to optimize the ADC usage on AT32UC3A0/1, AT32UC3A3 and AT32UC3B0/1 series 1 Introduction This application note outlines the steps necessary to optimize analog to digital conversions on AT32UC3A0/1,

AVR1309: Using the XMEGA SPI Features Introduction to SPI and the XMEGA SPI module Setup and use of the XMEGA SPI module Implementation of module drivers Polled master Interrupt controlled master Polled

AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2 1. Introduction The purpose of this application note is to show how to compile any of the application and driver examples

AVR32934: EVK1104AU Getting Started Guide Features Powering up the board Preparing the board for audio playback Playing music 1 Introduction The EVK1104AU is a reference design and development system for

AVR033: Getting Started with the CodeVisionAVR C Compiler Features Installing and Configuring CodeVisionAVR to Work with the Atmel STK 500 Starter Kit and AVR Studio Debugger Creating a New Project Using

AVR32788: AVR 32 How to use the SSC in I2S mode Features I²S protocol overview I²S on the AVR32 I²S sample rate configurations Example of use with AT32UC3A on EVK1105 board 32-bit Microcontrollers Application

AVR293: USB Composite Device Features Combining several USB applications using ONE DEVICE No HUB needed Bus powered 1. Introduction Adding to the flexibility given to the user with the Hot Plug & Play,

AVR1301: Using the XMEGA DAC Features 12 bit resolution Up to 1 M conversions per second Continuous drive or sample-and-hold output Built-in offset and gain calibration High drive capabilities Driver source

APPLICATION NOTE Atmel AVR32848: Android Accessory Demo 32-bit Atmel Microcontrollers Features Control an accessory from an Android device Send data to and from an Android device to an accessory Supported

AVR100: Using the XMEGA ADC Features Up to 12 bit resolution Up to 2M samples per second Signed and unsigned mode Selectable gain Pipelined architecture 4 virtual channels Result comparator Automatic calibration

USER GUIDE ZigBit USB Stick User Guide Introduction This user guide describes how to get started with the Atmel ZigBit USB sticks. The ZigBit USB sticks is targeted for evaluating the USB features of the

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR Features How to open a new workspace and project in IAR Embedded Workbench Description and option settings for compiling the c-code Setting

AVR305: Half Duplex Compact Software UART Features 32 Words of Code, Only Handles Baud Rates of up to 38.4 kbps with a 1 MHz XTAL Runs on Any AVR Device Only Two Port Pins Required Does Not Use Any Timer

C51 General Information about Bootloader and In System Programming Overview This document describes the Atmel Bootloaders for 8051 family processors. Abreviations ISP: In-System Programming API : Applications

USER GUIDE EDBG Description The Atmel Embedded Debugger (EDBG) is an onboard debugger for integration into development kits with Atmel MCUs. In addition to programming and debugging support through Atmel

Features Three Selectable Outputs All Outputs Can Be Used Either for Standard (5V) or High Voltage (9V) Maximum Output Current at All Outputs Up to 150 ma On-chip Low-EMI RF Oscillator With Spread-spectrum

AVR2004: LC-Balun for AT86RF230 Features Balun for AT86RF230 with lumped elements Simulation results S-Parameter file 1 Introduction In some cases the used balun on the ATAVR RZ502 Radio Boards must be

AVR055: Using a 32kHz XTAL for run-time calibration of the internal RC Features Calibration using a 32 khz external crystal Adjustable RC frequency with maximum +/-2% accuracy Tune RC oscillator at any

AVR303: SPI-UART Gateway Features Communicate with a SPI slave device using a RS232 terminal SPI Modes 0 3, bit order and slave select (SS) is supported SPI clock frequency 28kHz to 1.8MHz when using a

AVR 8-bit Microcontrollers AVR182: Zero Cross Detector APPLICATION NOTE Introduction One of the many issues with developing modern applications is to keep the spikes and EMI at a minimum, especially when

AVR125: ADC of tinyavr in Single Ended Mode Features Up to 10bit resolution Up to 15kSPS Auto triggered and single conversion mode Optional left adjustment for ADC result readout Driver source code included

Atmel AVR 8-bit Microcontroller AVR151: Setup and Use of the SPI APPLICATION NOTE Introduction This application note describes how to set up and use the on-chip Serial Peripheral Interface (SPI) of the