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 has gradually replaced 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, and 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.
Fig.1 Data acquisition system block
diagramFig.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 adopts the measures of limiting, reducing voltage, filtering and increasing input impedance to protect the conversion chip at the back end.
Driver and firmware design
USB device driver is based on WDM. WDM type driver is a kernel program. Different from the standard Win32 user mode program, it adopts a layered processing method. Through it, users do not need to deal with hardware directly, but only need to access the hardware through the interface provided by the lower driver. Therefore, the USB device driver does not need to program the hardware specifically. 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 with little or no modification. Software developers spend a lot of time 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. [page]
FW.C: FW.C contains the MAIN function of the program framework, which manages the operation of the entire 51 core. Because the functions of this part have been carefully divided, they generally do not need to be changed.
Figure 3 Conditioning circuit
PERIPH.C: The user must instantiate PERIPH.C, which is responsible for the interconnection of the system's peripheral devices. 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 external FIFO status detection and data transmission are mainly completed in TD_poll(). 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:MSP430---FLASH reading and writing
Next article:Analysis of the design of mobile music robot
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Should the PCB trace angle be 90°?
- How to draw this shape of 0.35x0.35
- T6963C displays garbled characters
- [Construction Monitoring and Security System] 6. Kaluga's adc_button case combined with lvgl
- Analog IIC output does not reach the power supply voltage
- CCS5.5 compiles the project and always prompts an error, see the following figure
- Detailed explanation of stack pointer register SP
- Atmel launches AVR contactless compact card reader
- RF Low Noise Amplifier
- FDS9721_LP3 chip usage