1 Overall system design
The USB specification divides USB into five parts: controller, controller driver, USB chip driver, USB device, and client driver for different USB devices. According to the different requirements of the device for system resources, the USB specification stipulates four different data transmission methods: isochronous transmission method (isochronous), interrupt transmission method (interrupt), control transmission method (control) and batch (bulk) transmission method. These transmission methods have their own characteristics and are used in different places. USB requires support from three aspects: host hardware, operating system and peripherals to work. At present, motherboards generally use control chipsets that support USB functions, and also install USB interface sockets. According to the USB specification, the design of the entire virtual oscilloscope system is divided into the host software part and the external hardware part (see Figure 1).
The development of this virtual oscilloscope integrates the functions of three practical instruments.
(1) Dual-channel broadband oscilloscope functions: real-time waveform display and calculation, waveform storage and printing, spectrum analysis, etc.
(2) Digital/needle dual display high-precision multimeter functions: voltage measurement, current measurement, resistance measurement, etc.
(3) High-precision customizable signal generator function: triangle wave generation, sine wave generation, square wave generation, custom waveform generation, etc.
2 System plug-in hardware design
The system plug-in hardware design structure is shown in Figure 2.
The plug-in hardware of this system uses Philips' PDIUSBD12 full-speed USB interface chip to form the USB interface unit. For detailed information on the PDIUSBD12 chip, please visit Philips' website www.philips.com. The analog-to-digital conversion chip uses MAX's latest AD chip MAX108. The control unit uses the AT908515 microcontroller as a controller to control the coordinated work of the entire hardware part. The two channels of measured signals can enter the dual-channel AD unit at the same time. The digital signals after analog-to-digital conversion pass through the signal preprocessing unit, which performs preliminary processing on the signals and converts the signals into a data form that is easy to store. After that, the data is sent to the cache and waits for the USB interface unit to gradually input the host. The path of the system output signal is opposite, and finally it is converted by the DA unit into an analog signal defined by the user. The control unit controls the start and stop of AD and DA conversion, the processing actions of the signal preprocessing unit, the access of the cache, and assists the input and output of the USB interface unit.
3 USB driver design
This USB driver uses isochronous pipes to transfer data and control pipes to transfer instructions and information. Isochronous pipes can be used to achieve regular time-sensitive data exchange between the host and the device. The bus driver will use 90% of the bus bandwidth for isochronous and interrupt transmission.
To open a USB pipe, you must first know the GUID and pipe name of the USB device. After obtaining the handle, you can use ReadFile/WriteFile to read and write.
The USB driver complies with WDM (Windows Driver Model). This driver is developed using Microsoft's DDK2000 and uses Windows 2000 as the platform. Due to space limitations, only the design of the USB driver main entry routine is provided here.
The main entry routine of a WDM driver is the DriverEntry routine, which is called by the I/O manager. For the DriverEntry routine of this WDM driver, its main task is to fill in various function pointers into the driver object. These pointers indicate the location of various subroutines in the driver library to the operating system. They include the following pointer members (in the driver object):
(1) DriverUnload points to the driver's cleanup routine. The I/O manager calls this routine before unloading the driver.
(2) DriverExtension→AddDevice points to the driver's AddDevice function. The PnP manager will call the AddDevice routine once for each hardware instance.
(3) DriverStartIo The driver uses the standard IRP (interrupt request package) queue.
(4) The MajorFunction driver may need to process several types of IRPs, so the pointer elements corresponding to those IRP types should be set to point to the corresponding dispatch functions. According to the actual requirements of the virtual instrument system, the main function IRPs to be processed by this driver are: IRP-MJ-CREATE; IRP-MJ-CLOSE; IRP-MJ-DEVICE-CONTR; IRP-MJ-WRITE; IRP-MJ-READ; IRP-MJ-SYSTEM-CONTROL; IRP-MJ-PNP; IRP-MJ-POWER.
In the main entry routine, you must set the pointer elements corresponding to these IRP types so that they point to the corresponding dispatch functions.
4 Customer Service Software Design
The entire customer service software is written using VC++ and is designed into the following main modules.
4.1 Communication module between driver layer and application layer
If the communication function block is implemented directly in the main thread of the application, then when the application communicates data with the driver, the main interface will freeze. To solve this problem, we directly create a child thread to complete the communication task with the driver alone, allowing the main interface to focus on responding to the messages of the window interface. In the child thread, the IO operation of the USB device is implemented by calling the Windows API function. Among them, the DeviceIoControl() function is used to transmit device configuration information; CreateFile() is used to create a device object; WriteFile() and ReadFile() are used to read and write data to the USB device.
4.2 Control Panel Module
On the customer service interface, we created six main control function buttons: RUN, STOP, SINGLE, spectrum analysis, LOAD and SAVE to realize its main control functions. This part of the design system completes the control functions such as start, stop, single step, store and load data files.
4.3 Real-time waveform display module
The display window is customized according to user habits, and the waveform is displayed, refreshed and certain operations are performed on the waveform according to the specified parameters of the control panel.
4.4 FFT module
The spectrum analysis is performed using Fast Fourier Transform (FFT). The spectrum analysis in this software uses the time-decimated FFT algorithm, and then the amplitude spectrum analysis and phase spectrum analysis results are displayed in the form of coordinate curves on the user interface. 4.5 Other modules
It includes waveform storage, printing, playback, digital/needle dual display high-precision multimeter and high-precision customizable signal generator function modules.
5 Conclusion
With the introduction of USB2.0 standard, the application scope of USB is getting wider and wider, and it has involved almost all computer peripherals. The characteristics of USB provide new ideas for solving some problems of current virtual instruments. This paper is an exploratory study on introducing USB interface into virtual instruments and instrument systems.
Previous article:Two ways to measure voltage with an oscilloscope
Next article:How an oscilloscope captures and reproduces transient signals
- 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