Design of High-Speed ​​USB Data Acquisition System

Publisher:asdfrewqppLatest update time:2011-11-05 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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;
}
}
}
}

Reference address:Design of High-Speed ​​USB Data Acquisition System

Previous article:An acquisition system for capturing 16-bit voltage measurement data using USB
Next article:Some understanding and experience on WiMAX testing

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号