Design of High-Speed ​​USB Data Acquisition System

Publisher:梦中徐来Latest update time:2012-04-16 Keywords:USB 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, 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;
}
}
}
}

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

Previous article:PCI Express Bus Technology White Paper
Next article:Sewing Machine Saver

Recommended ReadingLatest update time:2024-11-17 05:21

Isolated USB to Isolated RS-485/Isolated RS-232 Interface
Evaluation and Design Support    Circuit Evaluation Board    CN-0373 Circuit Evaluation Board (EVAL-CN0373-EB1Z)    Design and Integration Documentation    Schematics, layout files, bill of materials    Circuit Function and Advantages    The circuit shown in Figure 1 provides a completely isolated co
[Industrial Control]
Isolated USB to Isolated RS-485/Isolated RS-232 Interface
USB interface application design based on single chip microcomputer PIC18F4550
introduction USB is a fast, bidirectional synchronous transmission, inexpensive and hot-swappable serial interface. Using USB bus technology, various instruments and equipment suitable for scientific research and industrial production are developed to replace the instruments and equipment using serial RS232 or paral
[Microcontroller]
USB interface application design based on single chip microcomputer PIC18F4550
Technical Article: Programming and Application of USB Device Mode in AWorks
USB is the abbreviation of Universal Serial Bus, which is a fast and flexible bus interface. USB provides a single, easy-to-use standard connection type for all USB peripherals, simplifying the design of USB peripherals. The USB interface supports hot plugging, and the computer system can dynamically detect the pluggi
[Mobile phone portable]
Technical Article: Programming and Application of USB Device Mode in AWorks
Wireless audio system based on USB host and ZigBee
  1 Introduction   In recent years, with the rapid development of embedded system technology, network communication technology and home appliance industry, information technology is gradually penetrating into people's lives, and smart home design is gradually coming into view. However, the current smart home design
[Microcontroller]
Wireless audio system based on USB host and ZigBee
Reference design for energy efficient, small form factor 240W USB PD3.1 EPR adapter
The trend of larger-capacity batteries requiring the same or faster charging time is accelerating the adoption of USB-C PD with greater power and higher output voltage. The USB PD organization has released the latest USB PD3.1 EPR specification, enabling maximum output Reach 48V 5A, 240W power . When designing USB PD
[Power Management]
Reference design for energy efficient, small form factor 240W USB PD3.1 EPR adapter
stm32 usb_istr.c file analysis
I recently worked on a project, in which a part of the internal part of the stm32 is used to store my own code, and a space is opened up to store the FPGA code. Every time the machine is turned on, the stm32 writes code to the FPGA. The method of writing code to a certain space of stm32: (1) ST_LINK Utility software
[Microcontroller]
stm32 usb_istr.c file analysis
Impedance and insertion loss testing of USB 3.0 cables and connectors
Impedance and Insertion Loss Testing of USB 3.0 Cables and Connectors The next generation of serial data standards are using high data rates that have moved into the microwave domain. For example, the upcoming SuperSpeed ​​USB (USB 3.0) will deliver 5Gb/s over twisted pair cables. Transmitting such high data rates t
[Test Measurement]
Impedance and insertion loss testing of USB 3.0 cables and connectors
Design of USB interface for ECG and blood pressure monitor based on single chip microcomputer
Introduction The home ECG and blood pressure monitoring system consists of a collection and recording device and a host electronic medical record management system. Therefore, the problem of data transmission needs to be solved. The traditional communication interface uses a simple RS-232 serial UART, which is
[Medical Electronics]
Design of USB interface for ECG and blood pressure monitor based on single chip microcomputer
Latest Analog Electronics 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号