Atmel AVR4921: ASF - USB Device Stack Differences between ASF V1 and V2. 8-bit Atmel Microcontrollers. Application Note. Features.



Similar documents
Atmel AVR4920: ASF - USB Device Stack - Compliance and Performance Figures. Atmel Microcontrollers. Application Note. Features.

Atmel AVR4903: ASF - USB Device HID Mouse Application. Atmel Microcontrollers. Application Note. Features. 1 Introduction

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

Application Note. Atmel ATSHA204 Authentication Modes. Prerequisites. Overview. Introduction

Application Note. 8-bit Microcontrollers. AVR270: USB Mouse Demonstration

AVR32701: AVR32AP7 USB Performance. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR32138: How to optimize the ADC usage on AT32UC3A0/1, AT32UC3A3 and AT32UC3B0/1 series. 32-bit Microcontrollers. Application Note.

AVR1922: Xplain Board Controller Firmware. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

AVR115: Data Logging with Atmel File System on ATmega32U4. Microcontrollers. Application Note. 1 Introduction. Atmel

Introducing a platform to facilitate reliable and highly productive embedded developments

APPLICATION NOTE. Atmel AT04389: Connecting SAMD20E to the AT86RF233 Transceiver. Atmel SAMD20. Description. Features

AVR287: USB Host HID and Mass Storage Demonstration. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

Atmel AVR1017: XMEGA - USB Hardware Design Recommendations. 8-bit Atmel Microcontrollers. Application Note. Features.

APPLICATION NOTE. Atmel LF-RFID Kits Overview. Atmel LF-RFID Kit. LF-RFID Kit Introduction

Application Note. Atmel CryptoAuthentication Product Uses. Atmel ATSHA204. Abstract. Overview

Atmel AVR4950: ASF - USB Host Stack. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

AVR1510: Xplain training - XMEGA USART. 8-bit Microcontrollers. Application Note. Prerequisites. 1 Introduction

8-bit. Application Note. Microcontrollers. AVR282: USB Firmware Upgrade for AT90USB

APPLICATION NOTE. Atmel AT02985: User s Guide for USB-CAN Demo on SAM4E-EK. Atmel AVR 32-bit Microcontroller. Features. Description.

AVR1318: Using the XMEGA built-in AES accelerator. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Using CryptoMemory in Full I 2 C Compliant Mode. Using CryptoMemory in Full I 2 C Compliant Mode AT88SC0104CA AT88SC0204CA AT88SC0404CA AT88SC0808CA

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

AT91SAM ARM-based Flash MCU. Application Note

AVR32788: AVR 32 How to use the SSC in I2S mode. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

USER GUIDE EDBG. Description

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

Application Note. 8-bit Microcontrollers. AVR272: USB CDC Demonstration UART to USB Bridge

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

How To Design An Ism Band Antenna For 915Mhz/2.4Ghz Ism Bands On A Pbbb (Bcm) Board

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR1600: Using the XMEGA Quadrature Decoder. 8-bit Microcontrollers. Application Note. Features. 1 Introduction. Sensors

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AT01095: Joystick Game Controller Reference Design. 8-/16-bit Atmel Microcontrollers. Features.

Atmel AVR4027: Tips and Tricks to Optimize Your C Code for 8-bit AVR Microcontrollers. 8-bit Atmel Microcontrollers. Application Note.

Atmel AVR4905: ASF - USB Device HID Generic. 8-/32-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

AT88CK490 Evaluation Kit

AVR1301: Using the XMEGA DAC. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR293: USB Composite Device

Atmel AT32UC3A3256 microcontroller 64MBit SDRAM Analog input (to ADC) Temperature sensor RC filter

AT89C5131A Starter Kit... Software User Guide

8051 Flash Microcontroller. Application Note. A Digital Thermometer Using the Atmel AT89LP2052 Microcontroller

USER GUIDE. ZigBit USB Stick User Guide. Introduction

General Porting Considerations. Memory EEPROM XRAM

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AVR443: Sensor-based Control of Three Phase Brushless DC Motor. Atmel AVR 8-bit Microcontrollers. Features.

Software Prerequisites Linux Ubuntu LTS. Estimated completion time: 15min. The goal of this hands-on is to:

AVR353: Voltage Reference Calibration and Voltage ADC Usage. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Secure Personalization with Transport Key Authentication. ATSHA204A, ATECC108A, and ATECC508A. Introduction.

Atmel AVR4904: ASF - USB Device HID Keyboard Application. Atmel Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AVR600: STK600 Expansion, Routing and Socket Boards. Atmel Microcontrollers. Introduction

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

AVR2006: Design and characterization of the Radio Controller Board's 2.4GHz PCB Antenna. Application Note. Features.

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Designing Feature-Rich User Interfaces for Home and Industrial Controllers

AVR1324: XMEGA ADC Selection Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Authentication Counting. Atmel CryptoAuthentication. Features. Introduction

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Atmel AVR ATxmega384C3 microcontroller OLED display with pixels resolution Analog sensors. Ambient light sensor Temperature sensor

AVR106: C Functions for Reading and Writing to Flash Memory. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR1003: Using the XMEGA Clock System. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

APPLICATION NOTE. Atmel AT01180: Barcode and QR code scanner User Guide. Atmel 32-bit Microcontroller. Features. Introduction

Application Note. 1. Introduction. 2. Associated Documentation. 3. Gigabit Ethernet Implementation on SAMA5D3 Series. AT91SAM ARM-based Embedded MPU

AT09333: USB Host Interface (UHI) for Communication Class Device (CDC) Introduction. Atmel Microcontrollers APPLICATION NOTE

AVR245: Code Lock with 4x4 Keypad and I2C LCD. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AVR2033: SAM-ICE Adapter Hardware User Manual. 8-bit Atmel Microcontrollers. Features. Introduction

Application Note. C51 Bootloaders. C51 General Information about Bootloader and In System Programming. Overview. Abreviations

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary. Features. Applications. 1. Description

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

AT91 ARM Thumb Microcontrollers. AT91SAM CAN Bootloader. AT91SAM CAN Bootloader User Notes. 1. Description. 2. Key Features

Introduction to Version Control in

CryptoAuth Xplained Pro

Quest vworkspace Virtual Desktop Extensions for Linux

New Features and Enhancements

8-bit Atmel Microcontrollers. Application Note. Atmel AVR211: Wafer Level Chip Scale Packages

Atmel AVR4029: Atmel Software Framework User Guide. Atmel Microcontrollers. Application Note. Features. 1 Introduction

More Secure, Less Costly IoT Edge Node Security Provisioning

1Mb (64K x 16) One-time Programmable Read-only Memory

Dell Statistica. Statistica Document Management System (SDMS) Requirements

Dell One Identity Cloud Access Manager How to Configure vworkspace Integration

AT11805: Capacitive Touch Long Slider Design with PTC. Introduction. Features. Touch Solutions APPLICATION NOTE

RFRB0413 RF Ranging Base (Preliminary)

etpu Host Interface by:

formerly Help Desk Authority Quest Free Network Tools User Manual

ChangeAuditor 6.0 For Windows File Servers. Event Reference Guide

Dell Spotlight on Active Directory Server Health Wizard Configuration Guide

AN3354 Application note

Two mechanical buttons Two user LEDs Four expansion headers. Board controller with USB interface. One power LED and one status LED

AVR106: C functions for reading and writing to Flash memory. 8-bit Microcontrollers. Application Note. Features. Introduction

Capacitive Touch Technology Opens the Door to a New Generation of Automotive User Interfaces

Application Note. USB Mass Storage Device Implementation. USB Microcontrollers. References. Abbreviations. Supported Controllers

APPLICATION NOTE. AT03155: Real-Time-Clock Calibration and Compensation. SAM3 / SAM4 Series. Scope

Top 10 Most Popular Reports in Enterprise Reporter

Transcription:

Atmel AVR4921: ASF - USB Device Stack Differences between ASF V1 and V2 Features Advantages Implementation differences Integration Migration from stack V1 to stack V2 8-bit Atmel Microcontrollers Application Note 1 Introduction Atmel has always provided a USB device stack to support AVR products with a USB hardware interface. The Atmel AT32UC3A and Atmel AT32UC3B products are supported in Atmel AVR Software Framework (ASF) version 1 (V1) with a specific USB device stack. Since ASF version 2 (V2), a new USB device stack has been delivered to support all AVR products. The aim of this document is to explain the implementation advantages of the new USB device stack for AT32UC3A and AT32UC3B MCUs as well as the major differences from the former USB device stack. NOTE In the rest of the document, the former USB stack will be referred to as USB Device stack V1, while new stack will be referred to as USB device stack V2. Rev.

2 Abbreviations ASF USB AVR Software Framework Universal serial bus 2 Atmel AVR4921

Atmel AVR4921 3 Advantages The following list shows the advantages of USB device stack V2 over USB device stack V1: All Atmel AVR products are supported: Atmel megaavr, Atmel AVR XMEGA, and Atmel AVR UC3 Eases migration between all AVR products DMA is used when applicable for all USB transfers Increases speed and reduces CPU usage The stack is managed only by interrupt Reduces latency Avoids any task scheduler The implementation supports all AVR power reduction features Helps to create a very low-power device All USB protocol errors are taken into account Robust software solution Better software architecture Easiest to use No USB-specific code in the application Reduces development time Various detailed application notes are available Reduces development time A new USB class implementation is supported Provides peripheral health device class (PHDC) The V2 and V1 footprints (code/ram size) are the same Does not require a larger memory target space All classes available in USB device stack V1 will be supported by USB device stack V2. Table 3-1. USB device class status. Class ASF V1 status ASF V2 status Template No Q3 2011 Composite (HIDs, CDC, MSC) No ASF2.3.2 HID mouse Available ASF2.3.2 HID keyboard No ASF2.3.2 HID generic No ASF2.3.2 Mass storage (MSC) Available ASF2.3.2 Communication (CDC) Available ASF2.3.2 Personal health device (PHDC) No ASF2.3.2 Audio Available Q4 2011 Device firmware upgrade (DFU) Available Q3 2011 3

4 Implementation 4.1 File organization 4.1.1 USB device stack V1 The specific USB device stack for Atmel AVR UC3 A and Atmel AVR UC3 B 32-bit products is prefixed by a _asf_v1 folder in the ASF package, and is stored in the following folders: File USB constant defines usb_ids.h Path avr32/services/usb/_asf_v1/class/ USB device core files avr32/drivers/usbb/_asf_v1/enum/ usb_task.c/h device/usb_device_task.c/h device/usb_standard_request.c/h Class protocol files avr32/services/usb/_asf_v1/class/foo/ foo.h Class and USB descriptor files duplicated in application folder device_class_task.c/h usb_specific_request.c/h usb_descriptors.c/h Driver files for AVR UC3 avr32/drivers/usbb/_asf_v1/ usb_drv.c/h usbb.h Configuration files usb_conf.h (This configuration file is mandatory) 4.1.2 USB device stack V2 The USB device stack V2 for all AVR products is stored in the following folders: 4 Atmel AVR4921 File USB constant defines usb_protocol.h (from usb.org) usb_atmel.h (from Atmel) USB device core files udc.c/h udc_desc.h udi.h udd.h Class protocol files usb_protocol_foo.h Class and USB descriptor files Path common/services/usb/ common/services/usb/udc/ common/services/usb/class/foo/ common/services/usb/class/foo/device/

udi_foo.c/h udi_foo_desc.c udi_foo_conf.h Driver files for AVR UC3 avr32/drivers/ usbb/usbb_device.c/h usbb/usbb_otg.h usbc/usbc_device.c/h usbc/usbc_otg.h Driver files for AVR XMEGA xmega/drivers/ usb/usb_device.c/h Configuration files usb_conf.h (This configuration file is mandatory) Atmel AVR4921 4.2 Integration 4.2.1 USB device stack V1 The USB device stack V1 requires the initialization and scheduling of USB core tasks and class tasks in the main code section. It also requires the class implementation and USB descriptors in the user application: Main code section // Initialize USB clock (on PLL1) pcl_configure_usb_clock(); // Initialize USB task usb_task_init(); // Initialize device mouse USB task device_mouse_hid_task_init(); // No OS here. Need to call each task in round-robin mode. while (true) { usb_task(); device_mouse_hid_task(); } Class implementation and user interface, for example: device_class_task.c/h Class setup implementation: usb_specific_request.c/h USB descriptors: usb_descriptors.c/h 4.2.2 USB device stack V2 The USB device stack V2 requires the clock manager software module (/common/services/clock) and sleep manager software module (/common/services/sleepmgr) from ASF. Intialization of the clock, sleep manager and 5

USB services is required in the main code section. The class implementation and USB descriptors are provided by ASF, and require only the definition of the user interface. For more information concerning integration, refer to the Atmel AVR4903 to AVR4909 USB device class application notes. Main code section // Initialize the sleep manager service sleepmgr_init(); // Initialize the clock service sysclk_init(); // Enable USB Stack Device udc_start(); User interface only, for example: ui.c/h 6 Atmel AVR4921

5 Migration from stack V1 to stack V2 Atmel AVR4921 The USB device stack V2 requires the clock manager software module and sleep manager software module from ASF V2. In the USB device stack V1 applications, however, clock configuration and sleep mode control are done by the user application code, which calls UC3 clock and sleep drivers. Because of this fundamental difference between stack V1 and stack V2, there can be no straightforward migration. It is recommended to start again from existing V2 example projects. 7

6 Conclusion Moving to USB device stack V2 in ASF offers greater robustness as well as ease of use for both beginners and advanced users when developing firmware with USB. It also adds performance in managing low-level USB, and takes advantage of all USB hardware features implemented in Atmel AVR products. The stack provides full support of many USB classes, with example projects in ASF and Atmel AVR Studio 5. The stack allows the sharing of code among Atmel megaavr, AVR XMEGA and AVR UC3 products. Maintenance and portability from one architecture to another is also improved. 8 Atmel AVR4921

Atmel AVR4921 7 Table of contents Features... 1 1 Introduction... 1 2 Abbreviations... 2 3 Advantages... 3 4 Implementation... 4 4.1 File organization... 4 4.1.1 USB device stack V1... 4 4.1.2 USB device stack V2... 4 4.2 Integration... 5 4.2.1 USB device stack V1... 5 4.2.2 USB device stack V2... 5 5 Migration from stack V1 to stack V2... 7 6 Conclusion... 8 7 Table of contents... 9 9

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. Atmel, Atmel logo and combinations thereof, AVR, AVR Studio, megaavr, XMEGA, and others are registered trademarks or 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.