In some high-speed and high-precision applications such as image processing and transient signal measurement, high-speed data acquisition is required. The USB 2.0 interface is gradually replacing the traditional ISA and PCI data buses with its advantages such as high speed , and its hot-swap feature also makes it the preferred interface for various PC peripherals. EZ-USB FX2 is a microprocessor with integrated USB 2.0 launched by Cypress. It integrates USB 2.0 transceiver, SIE (serial interface engine), enhanced 8051 microcontroller and programmable peripheral interface. This article will introduce the design of a high-speed data acquisition system based on the EZ-USB FX2 series CY7C68013 chip. The system has a limit protection function, and the firmware and driver are easy to write, which can complete high-speed data acquisition and transmission.
Data acquisition system design
The block diagram of the data acquisition system is shown in Figure 1, and the hardware circuit is shown in Figure 2. Among them, AD1674 is a 12-bit analog-to-digital conversion chip that works in a successive comparison mode. CPLD is mainly used to control the timing of ADC and FIFO, control the start and stop of ADC, and query the status of ADC. FIFO mainly plays the role of high-speed data buffer.
Figure 1 Data acquisition system block diagram
Figure 2 System hardware circuit
CY7C68013 and AD1674 are connected through CPLD to realize the decoding of related control lines and data lines. Under the control of CY7C68013, AD1674 is first sampled at intervals, and then the results are transferred to FIFO. After a certain amount of data is collected, CY7C68013 packages the data and transmits it to PC through USB bus, and the advanced application performs data processing. The extended RS232 interface can communicate with external devices. When powered on, CY7C68013 automatically loads the external E2PROM into the internal RAM through I2C bus, which is convenient for firmware modification and upgrade.
The conditioning circuit of the data acquisition front end is shown in Figure 3. This design uses limiting, voltage reduction, filtering and increasing input impedance to protect the back-end conversion chip.
Driver and firmware design
The USB device driver is based on
WDM
. The WDM driver is a kernel program. Unlike the standard Win32 user-mode program, it adopts a layered processing method. Through it, users do not need to deal with the hardware directly, but only need to access the hardware through the interface provided by the lower-level driver. Therefore, the USB device driver does not need to program the hardware specifically, and all USB commands, read and write operations are transferred to the USB device through the bus driver. However, the USB device driver must define the communication interface and data format with the external device, and must also define the interface with the application. Cypress provides a complete CY7C68013 driver source code, control panel program and firmware framework, which greatly speeds up the user's development progress. Users only need to modify the existing driver slightly or without any modification. Software developers spend a lot of time mainly on the development of applications and firmware. According to the user's own needs, generally only the DeviceIoControl routine needs to be modified. This design mainly adds control data transmission functions, starts and stops ADC, resets FIFO, etc. Cypress provides a development framework for CY7C68013, two of which are as follows.
FW.C: FW.C contains the MAIN function of the program framework, which manages the operation of the entire 51 kernel. Because the functions of this part have been carefully divided, they generally do not need to be modified.
Figure 3 Conditioning circuit
PERIPH.C: The user must instantiate PERIPH.C, which is responsible for the interconnection of the peripheral devices of the system. The design of the firmware is mainly for this file. The user must instantiate this file according to the needs of his own system to achieve the required functions. In the firmware program, the most important are the two functions TD_init() and TD_poll(). Taking the TD_poll() function as an example, the main functions of TD_poll() are to detect the external FIFO status and transmit data. The main part of the program is as follows. When debugging the firmware, you can use the EZ-USB control panel provided by Cypress.
Void TD_Poll(void)
{
If(GPIFTRIG & 0x80) //Judge whether GPIF is idle
{
If(EXTFIFONOTEMPTY ) //Judge whether external FIFO is not empty
{
If(!(EP24FIFOFLGS & 0x01)) //Judge whether FIFO is not full
{
IF(enum_high_speed)
{
SYNCDELAY;
GPIFTCB1=0x02; //Set processing countSYNCDELAY
;
GPIFTCB0=
0x00;
SYNCDELAY;
}
Else
{
SYNCDELAY;
GPIFTCB1=0x00;
SYNCDELAY;
GPIFTCB0=0x20;
SYNCDELAY;
}
Setup_FLOWSTATE_Read();
SYNCDELAY;
GPIFTRIG=GPIFTRIGRD|GPIF_EP2;
SYNCDELAY;
While(!(GPIFTRIG & 0x80))
{;}
SYNCDELAY;
}
}
}
}
Previous article:An acquisition system for capturing 16-bit voltage measurement data using USB
Next article:Some understanding and experience on WiMAX testing
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- I thought there was something wrong with IAR, but it turns out that I can input in multiple locations at the same time.
- Permanent magnet brushless motor and its driving technology
- Using cartridges and the ESP8266 microcontroller, a master gave Game Boy the ability to surf the Internet
- A way to significantly improve the distortion of audio playback systems
- MSP430F149
- It is time to accumulate some knowledge on GaN power device design when developing switching power supplies
- Brief Introduction to the Principle and Design of Flyback Converter
- WIFI development software tool sharing
- 【Renovation of old things】Graffiti lamp 1 Material preparation
- [TI recommended course] #[High Precision Laboratory] Interface: RS-485#