USB has become the standard way for devices to communicate with PCs, from general-purpose devices (such as flash memory devices and mice) to specialized devices, and the standard has almost completely replaced other serial communication protocols.
USB peripherals cannot communicate with each other, they can only communicate with a USB host device that has control over the bus. Until recently, only PCs had host capabilities. But now, many microcontrollers also have embedded USB host capabilities, which allows embedded applications to connect to a wider range of USB peripherals.
USB flash drives are a widely used USB peripheral device that has become an inexpensive medium for transferring or storing large amounts of data. Many data logging devices have been developed thanks to them. For long-term data logging in remote locations, data can be collected and stored in a flash drive, then brought back to a convenient location for analysis and processing.
Figure 1: PIC24FJ256GB1 microcontroller with embedded USB host function
Flash drives can also be used to transfer high-speed time-correlated data to a PC. PCs are excellent data analysis tools, but their real-time capabilities are limited. Conversely, embedded applications are well suited for real-time data acquisition, but data analysis capabilities are often weak. An embedded real-time data logger can store data on a flash drive and then transfer the data to a PC for analysis, thus giving full play to the advantages of both.
Embedded USB Host Applications
One of the first tasks when starting an embedded design is to select a microcontroller. In order to use a flash drive, the microcontroller must have the ability to be an embedded USB host. If the microcontroller has USB OTG (On-The-Go) or USB Dual Role functions, such as Microchip's PIC24FJ256GB1 microcontroller, as shown in Figure 1, it can also support embedded USB host functions. USB peripherals, sometimes also called USB device mode, can only be used as a flash drive, etc., and cannot communicate with other USB peripherals.
Second, the designer should make sure that a complete set of development tools is available. At a minimum, a device programmer is needed (a debugger is best) and a C compiler, because embedded USB hosts and programs running on microcontrollers are often written in C rather than assembly language.
Finally, designers should also understand what software libraries are available, because the handshake operation when the embedded device discovers the flash drive requires support for the USB device class, FAT32 file system, and other libraries. Designing support for embedded USB host devices from scratch can take months, while a solution consisting of a certified protocol stack can save considerable time.
In order to use the flash drive, the embedded device also needs a USB Mass Storage Class device terminal driver, a hardware command line interface, and a file system interface. Typically, flash drives with 2Gb or less of storage space use the FAT16 file system, while larger capacity flash drives will use the FAT32 file system.
Design Requirements
● If the embedded host needs to support the USB device class, it must be able to provide 500mA of current to power the peripherals.
● If the embedded host needs to support any device that consumes more than 100mA, it must also be able to provide 500mA of current.
● If the embedded host needs to support devices that consume 100mA or less, the VBUS voltage limit can be reduced to 4.4V. However, if the embedded host needs to support devices that consume more than 100mA, the VBUS voltage limit is 4.75V, just like a full-featured host.
● The overcurrent protection mechanism must be redesigned to reset without user intervention.
● The transmission delay from the USB connector to the transceiver must be within 8ns.
● The capacitance on VBUS of the embedded USB host must be greater than 120μF, and the capacitance on VBUS of the USB OTG device must be 1.0~6.8μF.
In addition to the above rules, the user interface of the embedded USB host application must also be carefully considered. USB peripherals are usually used on PCs, and detailed error information can be provided in case of errors. If the LED indicator flashes, the user can know that the connection has failed. The USB specification also makes mandatory provisions that certified USB embedded host devices must provide error information. In other words, all error information must be clearly notified to the application layer, that is, to the user.
USB Device Certification
USB certification is mainly used to ensure that USB devices comply with the requirements of the USB specification. Certification can be carried out by various independent testing agencies. Once a product passes the certification, the manufacturer is allowed to use the USB logo, but also needs to comply with additional license restrictions (refer to the USB Implementers Forum: http://www.usb.org/developers/logo_license).
Products can also be manufactured and sold directly without USB certification. Without USB certification, manufacturers can declare that their products support USB, but they cannot use the USB logo anywhere on the device or packaging. Generally, it is not difficult to obtain USB embedded host device certification.
Communicating over USB
One of the biggest challenges in implementing a USB embedded host is communicating with the wide variety of USB peripherals. Although not all flash drive products are certified, users will not be happy if one flash drive works fine in an embedded device, but another does not work for no apparent reason.
It's OK if the flash drive needs to power up twice or half as long as the maximum allowed, or because the flash drive locks up when the host polls at the maximum allowed rate, or because the flash drive requires a different sequence of SCSI commands to establish communication, etc. But users will criticize the host if such a flash drive doesn't work on the host but works fine on the PC. So make sure to do extensive testing to communicate with a variety of non-certified USB peripherals, even if it's just a thumb-sized flash drive or a cable.
Although embedded USB host devices can provide USB class-level support, restrictions on support for special USB peripherals should also be considered during design and testing, and the product can be used normally in the designed application field by identifying the VID (Vendor ID) and PID (Product ID). This ID list refers to the Target Peripheral List (TPL) published by the USB Implementers Forum, which is a list of inspection items that must be followed in order to obtain embedded host certification. Complete OTG certification actually only requires interoperability with products marked with the VID/PID in the TPL list.
Previous article:Classification and working principle of printers
Next article:Software Design of X-ray Energy Spectrum Analyzer Based on Fieldbus
Recommended ReadingLatest update time:2024-11-16 15:33
- Popular Resources
- Popular amplifiers
- Virtualization Technology Practice Guide - High-efficiency and low-cost solutions for small and medium-sized enterprises (Wang Chunhai)
- usb_host_device_code
- Image acquisition and processing system for panoramic map applications
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Capacitive touch MSP430FR2676 MCU motherboard
- ESP32 simple Bluetooth support shared by foreign netizens
- Tutorial: How to use Vivado HLS to accelerate algorithm development on FPGA
- How is the brightness of LCD segment code screen defined?
- Thank you for being there - I am grateful for the forum which has given me a lot of technical help and helped me grow very fast.
- fpga download program
- nios data transmission problem
- The embedded operating systems I have come into contact with
- [Repost] 5 ways to reduce the total failure rate of UPS power supply
- EEWORLD University Hall----Live Replay: CAN SIC signal improvement function