AN740: Using the Ember EM358x/EM359x USB

Similar documents
Figure 1. 8-Bit USB Debug Adapter

AN111: Using 8-Bit MCUs in 5 Volt Systems

UG103.8: Application Development Fundamentals: Tools

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

AN962: Implementing Master-Slave Timing Redundancy in Wireless and Packet- Based Network Applications

AN580 INFRARED GESTURE SENSING. 1. Introduction. 2. Hardware Considerations

AN486: High-Side Bootstrap Design Using ISODrivers in Power Delivery Systems

TS1005 Demo Board COMPONENT LIST. Ordering Information. SC70 Packaging Demo Board SOT23 Packaging Demo Board TS1005DB TS1005DB-SOT

AN952: PCIe Jitter Estimation Using an Oscilloscope

AN862. OPTIMIZING Si534X JITTER PERFORMANCE IN NEXT GENERATION INTERNET INFRASTRUCTURE SYSTEMS. 1. Introduction

AN803. LOCK AND SETTLING TIME CONSIDERATIONS FOR Si5324/27/ 69/74 ANY-FREQUENCY JITTER ATTENUATING CLOCK ICS. 1. Introduction

UG103-13: Application Development Fundamentals: RAIL

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

ETRX3USB ETRX3USB-LRS ETRX3USB+8M ETRX3USB-LRS+8M PRODUCT MANUAL

AN922: Using the Command Line Interface (CLI) for Frequency On-the-Fly with the Si5346/47

Making Prototyping Boards for the EFM32 kits

Current Digital to Analog Converter

Bootloader with AES Encryption

USER GUIDE EDBG. Description

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

Telegesis is a trademark of Silicon Laboratories Inc. Telegesis ZigBee Communications Gateway. Product Manual

Backup Power Domain. AN Application Note. Introduction

AN583: Safety Considerations and Layout Recommendations for Digital Isolators

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

RoHs compliant, Pb-free Industrial temperature range: 40 to +85 C Footprint-compatible with ICS , 2.5, or 3.3 V operation 16-TSSOP

QSG108: Blue Gecko Bluetooth Smart Software Quick-Start Guide

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

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

Selecting the Right MCU Can Squeeze Nanoamps out of Your Next Internet of Things Application

How To Develop A Toolstick

AN614 A SIMPLE ALTERNATIVE TO ANALOG ISOLATION AMPLIFIERS. 1. Introduction. Input. Output. Input. Output Amp. Amp. Modulator or Driver

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

1 Software Overview ncp-uart ash-v3-test-app ash-v3-test-app Command Line Options Testing... 2

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

PL-2303 (Chip Rev H, HX, X) USB to Serial Adapter Windows Driver Installer Manual

Connect the EFM32 with a Smart Phone through the Audio Jack

AN0822: Simplicity Studio User's Guide

AN220 USB DRIVER CUSTOMIZATION

AN335 USB DRIVER INSTALLATION UTILITY. 1. Description. 2. Installation Install Package

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

GPS/GLONASS SiRFstarV Evaluation Kit EVA5100-A

Design Considerations in Adding USB Communications to Embedded Applications

AN220 USB DRIVER CUSTOMIZATION

CryptoAuth Xplained Pro

UG103.14: Application Development Fundamentals: Bluetooth Smart Technology

Software Real Time Clock Implementation on MC9S08LG32

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

CPU. PCIe. Link. PCIe. Refclk. PCIe Refclk. PCIe. PCIe Endpoint. PCIe. Refclk. Figure 1. PCIe Architecture Components

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Table 1. RF Pico Boards of the EZRadioPRO Development Kits. Qty Description Part Number

USB Audio Simplified

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

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

Keep it Simple Timing

RN-XV-RD2 Evaluation Board

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

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

ETRX3USB ETRX3USB-LRS ETRX3USB+8M ETRX3USB-LRS+8M PRODUCT MANUAL

UniPi technical documentation REV 1.1

AN335 USB DRIVER INSTALLATION METHODS. 1. Introduction. 2. Relevant Documentation. 3. DPInst Installation and Customization

AN10811 Programming SPI flash on EA3131 boards Rev May 2009 Application note Document information Info Content Keywords Abstract

Bluetooth HC-06 with serial port module Easy guide

TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0

The care and feeding of Pythons at the Redmond Zoo. (Using Micro Python and pyboard with Windows)

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

Lab Experiment 1: The LPC 2148 Education Board

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

User Manual. AS-Interface Programmer

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

AN10866 LPC1700 secondary USB bootloader

Future Technology Devices International Ltd. USB NMC-2.5m. USB to USB Null Modem Cable. Datasheet

User Manual EZR32LG 915MHz Wireless Starter Kit

Virtual COM Port Driver Installation Manual

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

Virtual COM Port Driver Installation Manual

AN75. Si322X DUAL PROSLIC DEMO PBX AND GR 909 LOOP TESTING SOFTWARE GUIDE. 1. Introduction

XPort Universal Demo Board User Guide

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

TivaWare USB Library USER S GUIDE SW-TM4C-USBL-UG Copyright Texas Instruments Incorporated

Introduction. Getting familiar with chipkit Pi

R4/F4 Series Master Development System User's Guide

USB to RS-422/485 Serial Adapter

BLE113 DEVELOPMENT KIT

PAC52XX Clock Control Firmware Design

Design Considerations for DVT and Manufacturing Test of Wireless Devices

Analog to Digital Converter

HANDLING SUSPEND MODE ON A USB MOUSE

AN4128 Application note

TOSR0X-D. USB/Wireless Timer Relay Module. User Manual. Tinysine 2013 Version 1.0

AN104 I NTEGRATING KEIL 8051 TOOLS INTO THE SILICON LABS IDE. 1. Introduction. 2. Key Points. 3. Create a Project in the Silicon Labs IDE

Advanced Data Capture and Control Systems

USB FM Radio-RD USB FM RADIO USER S GUIDE. 1. USB FM Radio Setup. One-time set-up enables configuration of presets and region specific FM band

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM Version 1.32r 10/9/2012 USER MANUAL

Genesi Pegasos II Setup

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

RPLIDAR. Low Cost 360 degree 2D Laser Scanner (LIDAR) System Development Kit User Manual Rev.1

CP2102/ V. 48 MHz Oscillator. USB Function Controller. 640B TX Buffer. 576B RX Buffer 1024B PROM. Figure 1. Example System Diagram

Transcription:

AN740: Using the Ember EM358x/EM359x USB This application note provides key information for using the Ember EM358x/359x USB. The goal of the EM358/359x USB is to act as a COM port replacement for UART-style functionality by enumerating as a communications data class (CDC) USB device. See EM358x/EM359x Errata for the following known issue: When using the integrated USB on the EM358x and EM359x, the EM35xx may fail to enumerate. Additional information is in section 6. USB Certification. KEY POINTS Breakout board configuration Host PC driver Terminal programs On-chip firmware driver Basic serial port functionality USB certification silabs.com Smart. Connected. Energy-friendly. Rev. 0.7

Breakout Board Configuration 1. Breakout Board Configuration The 710-0680-000 C breakout board (EM358x) has a USB connector located next to the RCM. To use USB on this breakout board, the J40 jumper next to the USB connector must be set in the USB EN state. With USB enabled, PA0, PA1, PA2, and PA3 are not functional anywhere else on the breakout board. The EM359x USB connector is located on the RCM. When used with the 710-0682-000 A0 breakout board, the J2/J3 Vin selector should be disconnected. 1.1 GPIO Configuration and Control The USB driver code will ignore any existing GPIO configuration by directly setting PA0, PA1, PA2, and PA3 as needed. PA0 and PA1 are the only pins that support USB data. The default configuration of the driver is to use PA2 for enumeration control and PA3 for VBUS monitoring. Board file abstraction allows PA2 and PA2 functionality to be changed to other GPIO. The board file uses the macro USB_SELFPWRD_STATE to define if the system is bus-powered or self-powered by a source other than the USB connection. By default USB_SELFPWRD_STATE is set to 1 indicating the device is self-powered. When USB_SELFPWRD_STATE is set to 1, VBUS monitoring is required. To conform to USB Certification, when USB is not physically connected (no voltage on VBUS) enumeration control will be configured for de-enumeration and the on-chip driver will not allow enumeration. When USB is physically connected, VBUS monitoring will sense the VBUS change and enumeration control will be returned to the desired enumeration state. 1.1.1 PA0 and PA1 PA0 and PA1 are for D- and D+ bus signaling and configured as GPIOCFG_ANALOG. Board file abstractions use USBDM for PA0 and USBDM for PA1 in the names. 1.1.2 PA2 PA2 is for enumeration control. The EM358x/359x must always be able to control enumeration. PA2 connects to the necessary pull-up resistor allowing software on the device to specifically enumerate or de-enumerate as needed. When enumerated, PA2 is set to GPIOCFG_OUT in a logic high state. When de-enumerated, PA2 is set to GPIOCFG_IN. Board file abstractions use ENUMCTRL in the names. 1.1.3 PA3 PA3 is configured as GPIOCFG_IN for monitoring VBUS to know if the USB cable is physically connected. When a design is self-powered, VBUS monitoring is required. The 5 volt VBUS must be routed through a resistor-divider or similar circuit so that the EM358x/ EM359x sees an acceptable voltage level on an input GPIO. Board file abstractions use VBUSMON in the names. 1.1.4 PA3 interaction with PA2 For USB devices that are configured as self-powered, the USB specification requires that the enumeration pull-up resistor only be applied if VBUS is present. If PA3 does not sense VBUS, PA2 will be configured as de-enumerated. The on-chip driver will not allow PA2 to attempt enumeration until PA3 detects VBUS. The on-chip driver will monitor for any change of VBUS state. PA2 s actual configuration will appropriately track the desired enumeration state and the VBUS state. 1.1.5 VBUS Monitoring To properly monitor a change in VBUS an IRQ must be used. The IRQ must be configured to monitor both a rising and falling edge of VBUS to allow PA2 to be configured properly. The default configuration is to use PA3 for VBUS monitoring which means a selectable IRQ must be used. The two available selectable IRQs are IRQC and IRQD. IRQD is the default choice. The behavior of the VBUS monitoring IRQ is derived from the behavior of buttons. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 1

Host PC Driver 2. Host PC Driver 2.1 Windows The EM358x/359x USB device is designed to work with the Silicon Laboratories USB CDC driver, which builds upon the Windows USB CDC driver (usbser.sys). This driver is digitally-signed by WHQL and can be optionally installed alongside Simplicity Studio. Installers for 32-bit and 64-bit PCs can be run to install the driver without using Windows Device Manager. Alternatively, when the EM358x/359x is connected to the computer via USB, direct Windows Device Manager to tool/em358cdcdriverinstaller/silabs-cdc.inf to install the driver software. After installation, Windows Device Manager should now list Silicon Labs CDC Serial port under Ports (COM & LPT). Nothing more is needed to configure this new device. The USB serial number the EM358x/359x device reports to Windows is the EUI64 of the chip. That means that if the physical USB port is changed on a given machine the EM358x/359x will enumerate as the same COM port number and two EM358x/359x devices on the same machine won t result in the same COM port number. 2.2 Mac OSX and Linux CDC USB devices on Mac OSX and Linux do not require any additional driver software to enumerate. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 2

Terminal Programs 3. Terminal Programs With the EM358x/359x acting as a COM port, any terminal program, such as PuTTY (Windows), HyperTerminal (Windows), or miniterm (Mac OSX/Linux), or scripting languages that can interact with a COM port should work. Classic UART configurations such as baud rate, parity bits, and flow control do not have any effect in these terminal programs and can be ignored. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 3

On-Chip Firmware Driver 4. On-Chip Firmware Driver The USB driver files can be found at hal/micro/cortexm3/usb/ and should be included in any application wanting to use USB in its build. The USB driver source code does not have to be modified for basic serial port functionality, but for custom USB devices, refer to the USB sections of the Reference Manual and the Application Framework API. Changes to which GPIO are used for ENUMCTRL and VBUSMON should be done in the board file. The USB data lines are fixed to PA0 and PA1. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 4

Basic Serial Port Functionality 5. Basic Serial Port Functionality Because the USB driver is designed to work below the UART and serial library, the serial library will function as it does for the UART. While the UART uses port 1, the USB uses port 3. 5.1 Build Options The following build options should be used: EMBER_SERIAL3_MODE=EMBER_SERIAL_FIFO EMBER_SERIAL3_TX_QUEUE_SIZE=128 EMBER_SERIAL3_RX_QUEUE_SIZE=64 EMBER_SERIAL3_BLOCKING The TX and RX queue sizes are best left at 128 and 64, respectively, or greater for optimal throughput with USB. Smaller values could result in the USB getting locked up, which could trigger a watchdog reset. The USB implicitly blocks serial port behavior as dictated by the host system so the serial build options should indicate this. 5.2 Initialization emberserialinit(3, 0, 0, 0); Because the last three parameters are ineffective with USB, they can simply be left as 0. Initialization not only sets up the serial library but also initializes the chip s USB driver and causes the device to enumerate. Refer to section 1.1 GPIO Configuration and Control for more detail as to what state the GPIO are set. 5.3 Reading and Writing All serial functions, such as emberserialprintf(3, foo ); and emberserialreadbyte(3, *databyte); behave as they do with the UART. emberserialguaranteedprintf will also function but being on USB, timing is not guaranteed. Due to the fact that both Printf are blocking, it is safe to interleave uses of emberserialguaranteedprintf and emberserialprintf knowing that one will run to completion before the other is executed. 5.4 Suspend, Resume, Wakeup In order to properly suspend and resume the device, the USB device driver provides a delayed service routine which will reduce the main clock by ¼ when the device has detected a suspend signal. To enable suspend in an application, simply include usbsuspenddsr( ); in the main loop. Note that this function will abruptly shut down the stack and all peripherals in order to reduce power consumption to match bus powered USB certification specifications (<2.5 ma for remote wakeup enabled devices). Remote wakeup can be enabled using the USB_REMOTEWKUPEN_STATE parameter found in the board header. The function USBD_ RemoteWakeup will trigger a remote wakeup from the device. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 5

USB Certification 6. USB Certification The USB driver provides a simple interface for an application to support suspend, resume, or remote wakeup, but is not guaranteed to meet USB specification for all applications. Additionally, the clocking requirements necessitate reducing the frequency of all on-chip clocking by a factor of 4, which impacts timing dependent peripherals such as but not limited to Serial Controller 1s UART mode or the General Purpose Timers. Note: The integrated USB on the EM358x and EM359x may fail to enumerate. For more information including affected conditions and the work-around, see the EM358x/EM359x Errata. silabs.com Smart. Connected. Energy-friendly. Rev. 0.7 6

Smart. Connected. Energy-Friendly. Products www.silabs.com/products Quality www.silabs.com/quality Support and Community community.silabs.com Disclaimer Silicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Trademark Information Silicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, Bluegiga, Bluegiga Logo, Clockbuilder, CMEMS, DSPLL, EFM, EFM32, EFR, Ember, Energy Micro, Energy Micro logo and combinations thereof, "the world s most energy friendly microcontrollers", Ember, EZLink, EZRadio, EZRadioPRO, Gecko, ISOmodem, Precision32, ProSLIC, Simplicity Studio, SiPHY, Telegesis, the Telegesis Logo, USBXpress and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA http://www.silabs.com