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, it is generally only necessary to modify the DeviceIoControl routine. This design mainly adds control data transmission functions, start and stop ADC, reset 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:PCI Express Bus Technology White Paper
Next article:Sewing Machine Saver
Recommended ReadingLatest update time:2024-11-17 05:21
- 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)
- 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!
- 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
- UWB Market Outlook
- FPGA Design Rules
- Can single-threaded applications develop asynchronous tasks? How does the ACE JS framework do it?
- Protel/AD design software removes text
- 【FAQ】How to quickly understand LP50xx devices?
- 【GD32L233C-START Review】6. Make a simple host computer for HID devices
- Inventory of common problems and solutions of crystal oscillators
- MicroPython Hands-on (18) - Sound and light sensor on the control board
- Share a MSP430 emulator firmware downgrade software
- 485 communication control problem of LPC824.