Storage testing is a dynamic testing technology that places a miniature data acquisition and storage tester on the object to be tested or at the test site, with no effect on the object to be tested or the effect is within the allowable range, to complete the rapid acquisition and memory of information on site in real time, and then recover and process and reproduce the test information by computer afterwards. The main technical feature of storage testing is to complete dynamic data acquisition and storage memory on site in real time, especially to complete dynamic parameter testing under various harsh environments and compact design conditions, and then recover and process and reproduce it. Traditional storage testers have the following shortcomings:
(1) The storage medium is placed inside the instrument, and the entire instrument must be collected to read back the data. Due to the complex test environment faced by storage testing, complex and bulky protective bodies are often installed or placed in shelters, which makes it difficult to disassemble and recycle the instrument. Outdoor readback and analysis of data are often difficult to continue due to limited conditions. (2) With the development of storage testing technology, the challenges and environments faced by storage testing are becoming increasingly complex, and the test time and required capacity are flexible and variable, and are gradually increasing. Due to the limitations of the design structure of traditional storage testers, different capacities mean that new instruments must be redesigned and produced.
(3) The current computer motherboards generally integrate USB interfaces, and the "large ports" that storage testers have always used, such as parallel ports and serial ports, have gradually been abandoned. Some newly launched motherboards even only integrate USB ports. The storage tester interface must adapt to this change and implement communication based on USB ports through certain measures. This design uses the CH375 of Nanjing Qinheng Company and the ATMEGA32 microcontroller of Atmel to effectively overcome the above shortcomings and achieve good results in practical applications. As a new type of mobile storage device, the U disk is highly favored for its small size, fast speed, vibration resistance and strong versatility. The system uses the microcontroller to read and write the U disk, and the collected data is directly stored in the U disk in the form of files, which can effectively improve the data storage speed and reliability. It is particularly suitable for occasions with long-term and large-capacity data collection, which facilitates data exchange with host computers such as PCs, thereby realizing on-site data collection and indoor data analysis. By replacing the U disk, the system capacity can be flexibly selected, which greatly improves the versatility of the storage tester and reduces the test cost.
2 USB OTG and Mass Storage Device Protocol
As a supplementary specification of USB 2.0, USB OTG (On The Go) has dual powerful functions to free USB devices from complete dependence on PCs. USB peripherals can be directly interconnected for communication without the participation of a PC host. USB communication is carried out in a layered manner, which can be generally divided into a functional layer, a USB device layer, and a bus interface layer. The USB flash drive belongs to the USB Mass Storage device in the USB family. It is a random storage device based on blocks/sectors. It communicates with the host in a "control/bulk/interrupt" (CBI) mode or a "bulk" (Bulk-Only) mode. The USB communication protocol specification is very complex. The USB mass storage protocol includes four independent sub-class specifications, namely CBI, Bulk-Only, ATA, and UFI. The first two sub-specifications define the transmission method of data/command/status on the USB bus, and the latter two sub-specifications define the operation commands of the storage medium. Among them, the ATA command specification is used for hard disks, and the UFI command specification is formulated for USB mobile storage. Before saving data, the USB flash drive must be formatted according to the regulations of a certain file system. Compared with computer hard disk, the storage capacity of USB flash disk is much smaller. Therefore, FAT16 file system can achieve relatively high comprehensive efficiency and good compatibility in USB flash disk, and is widely used in mobile storage devices such as USB flash disk. The structure of FAT16 file system is divided into 5 parts: MBR area, DBR area, FAT area, FDT area, and DATA area. Among them, MBR area is the master boot record area, DBR area is the operating system boot record area, FAT area stores file allocation table, FDT area stores file directory table, and DATA area is the real data storage area.
3 System Hardware Design
The system uses the powerful single-chip AT-mega32 from the AVR high-end machine series as the central processing chip, and the CH375 from Nanjing Qinheng Electronics Company as the USB host control chip. The working principle block diagram of the hardware system is shown in Figure 1:
ATMEGA32 is a low-power 8-bit microcontroller based on AVR RISC structure. The performance of an external 16 MHz crystal oscillator can reach 16 MI/S. AT-mega32 contains 32 kB of in-system programmable FLASH, 1kBE2PROM, 2kB SRAM, 32 general I/O ports, 32 general working registers, an 8-channel 10-bit A/D converter with selectable gain differential input
The schematic diagram of the interface between ATMEGA32 and CH375 in the actual design is shown in Figure 2:
[page]
4 System Software Design
The software structure diagram of USB mass storage device is shown in 3:
Generally, the MCU or embedded system needs to implement several layers on the left side of Figure 3 to process the file system of USB storage devices, and the right side is the internal structure layer of the USB storage device. Since CH375 is not only a general USB-HOST hardware interface chip, but also has built-in related firmware programs, it simplifies external programming. The built-in firmware includes the UFI command layer on the left side of the above figure, the USB basic transmission command layer and the Bulk-Only protocol layer, so the actual MCU program only needs to process the FAT file system layer, and even this layer can be implemented by the CH 375 U disk file-level subroutine library. CH375 provides a C language subroutine library. The file-level interface of the USB storage device, these application layer interface APIs include commonly used file-level operations, which can be transplanted and embedded into various commonly used MCU programs.
Here, ICC AVR software is used to write the ATMEGA32 program, and the AVRU disk file-level subroutine library CH375HFB. A provided by CH375 is called. After the program is run and initialized, the system enters the waiting trigger state. After the trigger signal is detected, a new file is created through CH375FileCreate, and the data collected by AD is written to the U disk through CH375FileWrite. After the file is full, CH375FileClose is called to close the file. After the acquisition is completed, the external U disk can be directly removed and taken back for indoor analysis. Due to the use of the file management mode, the required operation is very simple, just like reading files in the U disk.
5 Conclusion
After testing, the system achieved the expected effect in actual use and overcame some shortcomings of previous storage testers. In particular, it achieved good results for the acquisition of slow-changing large-capacity signals. Since CH375 only supports USB1.1 protocol and uses a single-chip microcomputer as a controller to manage the operation of the entire system, it is bound to affect the sampling rate of the instrument. Therefore, the selection of OTG devices that support USB 2.0 protocol and the use of better-performing controllers such as DSP, CPLD, etc. can greatly improve the sampling rate of the instrument to meet higher requirements.
Previous article:Gas detection method and implementation in mobile cabin based on telemetry
Next article:Design of a high-precision infrared temperature measurement system based on SOC
Recommended ReadingLatest update time:2024-11-17 00:42
- 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
- Teach you to learn 51 single chip microcomputer-C language version (Second Edition) (Song Xuefeng)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- PIC18 microcontroller
- Ek314 video test problem
- [TI millimeter wave radar evaluation]_3_mmwave_studio usage problems
- MM, be careful, your secret to sleeping has been discovered!
- Is CD4051 VEE negative voltage problem?
- Motion and Environmental Sensor Development Board X-NUCLEO-IKS01A3 Related Materials
- Gaoyun Cloud Source Editor causes cursor movement when using Chinese
- How to reduce the cost of Bluetooth
- Why can elderly devices costing only a few hundred yuan measure body temperature, but smart phones costing thousands of yuan cannot?
- [Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] Part 2: Understanding the Reading and Writing of Bluetooth BLE LED Light Services