Implementation of an embedded CCD Image Data Acquisition System Based on USB

Source: Internet
Author: User
Implementation of an embedded CCD Image Data Acquisition System Based on USB
[Date: 2008-6-3] Source: EDNchina Author: Wang Liping Li chuanjun [Font: large, medium, and small]

 

Compared with ordinary Video signal acquisition, CCD has a high data transmission rate and many transmission channels. At present, the General CCD Image Data Acquisition Method is inserted in the computer high-speed data acquisition card, acquisition card and CCD camera through point-to-point physical layer interface (such as RS-422, RS-485) for data transmission, the high-speed data acquisition card receives the data and writes the data into the computer memory through the PCI bus. Then, the data is written into the computer hard disk through the IDE interface using the storage function of the acquisition card. This method is simple and reliable, but it has some limitations in data transmission and storage for multi-channel and high-speed image data collection, which may lead to the loss of data frames. As the number of transmission channels increases, the number of transmission wires increases, and the power consumption and noise of the system increase. Universal Serial Bus USB can solve these problems well, with convenient connection, no external power supply, plug-and-play, support for hot swapping, high bandwidth, low power consumption, low cost, dynamic loading driver, the cascade star topology expands the number of peripherals and other special advantages. It can achieve simple, fast, bidirectional, and reliable connection and communication between the host and the data collection system.

  1. Hardware Design

The system design should be stable, flexible, and universal. Stability means not only data transmission without distortion, but also continuous data storage without frame loss. Flexibility is reflected in the modularization and reconfiguration of the system's signal input path, system storage capacity, and disk connection mode. The system can be used for acquisition of other high-speed video images with slight flexibility. Versatility is reflected in the system's ability to adapt to multiple channels, CCD image data collection at different rates, that is, the system is required to achieve channel merging and a wide data transmission band.

The hardware structure of the USB data collection system is shown in Figure 1.

  

The analog signal output by the sensor is connected to the signal amplifier through multiple switches. The signal amplifier can automatically adjust the gain and enlarge the input signal within the range of the/D converter, then the/D conversion is controlled by the ARM chip, and the converted digital signal is sent to the embedded microcontroller, and the USB interface circuit is passed to the PC for data processing, at the same time, the control signal sent from the client application on the PC is transmitted to the data collection system with the ARM chip as the core through the USB interface.

  1.1 solution Selection

  1.1.1 selection of USB interface chip and master controller chip

USB controller has two types, one is integrated with the USB interface single chip microcomputer, such as Cypress Company produced EZ-USB (based on 8051) series chip CY7C68013, CY7C64613, etc.; the other is a separate USB controller, for example, PDIUSBD12, ISP1581, NetChip NET2888, National USBN9603, and USBN9604 of Philips. Although the programming of the first chip is simple, it needs to purchase a special development system with a large investment and limited performance of the single chip. The latter features low price, convenient connection, and high reliability, however, the chip does not contain a CPU. Therefore, you must select a microprocessor for protocol processing and data exchange. The system selects the cost-effective USB 2.0 control chip ISP1581 without CPU on the chip. It fully complies with the USB 480 specifications and the speed can reach Mbps. ISP1581 can be used to quickly develop high-performance USB2.0 devices. To meet the speed requirements, the master controller chip selects the high-performance, low-power ARM chip b0x.

  1.1.2 selection of signal amplification circuit and A/D Conversion Chip

In the high-speed data collection system, the field input signal is a high-frequency analog signal with a large variation range. If a single gain amplification is used, the amplified signal amplitude may exceed the/D conversion range, so the gain of the amplifier must be adjusted accordingly based on the signal changes. The system selects AD8321, which features low bandwidth, low noise, and numerical control of gain. It is also suitable for the high-frequency analog signal conditioning chip used for pre-amplification in the data acquisition system. The high-frequency analog signal is amplified and sent to the analog-to-analog converter. Although the b0x itself is integrated with eight 10-bit ADC, the/D conversion of its internal integration can only input 0 ~ Because the analog signal of HZ does not have a sampling and holding circuit, it needs to be expanded. To meet the 8-way collection requirements, the high-speed A/D conversion chip AD7829 is selected, the maximum conversion rate is 2 MSPS, and the conversion time is 420ns.

  1.2 hardware interface circuit

The system hardware interface circuit connection 2 is shown.

  

The system expands the two-way port by using the PD port of b0x. The CONVST of AD7829 is connected to the PD1 of b0x to generate a conversion pulse. The EOC of AD7829 is connected to the PD0 of b0x, used to generate a conversion end signal. After the signal is converted to A/D, the data is first stored in the registers of the b0x, and the control signal of the b0x is sent to the ISP1581 first. Here, the buffer zone of the ISP1581 is defined as eight, write eight converted data records respectively. The PC is connected to ISP1581 through the USB interface, and ISP1581 is responsible for classifying and interpreting the signals sent from the PC. The specific operation procedure is as follows: the data sent by the PC to the USB device is written into the ISP1581 cache in the form of a package. When the cache is full or the data is sent, ISP1581 sends an interrupt signal to the ARM, the ARM responds to the interrupt signal and enters the interrupt service program to execute corresponding packet processing. On the other hand, USB devices cannot send data to the host. ARM writes the data required by the host to the cache of the corresponding ISP1581 endpoint only when the PC asks the USB device to send data.

Data collection is a conversion pulse CONVST generated by the PD port of b0x as the AD7829. When the AD7829 conversion ends, the EOC outputs an effective low level, and the next address is sent after the switch of b0x receives a valid level, then read the data. When the AD7829 and the signal are valid, when the data is read into the data buffer zone of b0x, the next path address is entered. In this way, 8 analog inputs are collected cyclically until the data collection ends, the flowchart 3 of this process is shown in.

  

  2.2USBSome software designs

The USB system software consists of three parts: firmware program, USB system driver program, and application program.

  2.2.1 development of firmware programs

The firmware program is actually a program file placed inside the microcontroller to help the hardware complete communication tasks. The ISP1581 INT interrupt signal is used to connect to the EINT0 Interrupt Port of the microcontroller b0x. when data is received or sent successfully, the interrupt occurs. The task of the firmware program is to respond to these interruptions, configure the device to let the USB driver know the device capabilities, receive data from the USB master controller, and send data to the host. The device firmware program is the core of the device operation. The system uses Keil C for compiling. The firmware program of SP1581 adopts a modular design, including the main loop program, interrupt service program, USB standard request processing, and batch data transfer request processing. The firmware module structure is shown in Figure 4.

  

  2.2.2 Application

Applications include Win32DLL and user applications. The Win32 dynamic Connection Library contains binary files that share the function library and can be used by multiple applications at the same time. Customer applications are software programs that implement the functions of the data collection system. In this system, Visual C ++ is used for compiling.

  2.2.3 USB system driver

The driver program of the USB system adopts a layered structure (WDM) model, which defines a layered driver. The driver program of the USB device does not directly communicate with the hardware, instead, the USB request block is submitted to the bus driver through the USB driver interface to complete hardware operations. From a system perspective, after a USB device is inserted into the host, the host detects a USB device, reads the device descriptor, and then the host is based on the vendor ID and product ID provided in the device descriptor, enable the corresponding USB driver to read the configuration descriptor, interface descriptor, and Endpoint descriptor from the USB device. Select the appropriate configuration, interface, and endpoint as needed to determine the transmission mode. After this process is completed, data can be transmitted between the PC and the USB device.

The features of the USB bus make it very suitable for the communication interface between the small instrument and the host, achieving simple, fast and reliable connection between the host and the portable instrument. Applying the USB interface to the data collection system improves the speed of the data collection system, and enhances the system's anti-interference capability and data transmission reliability. This article introduces in detail the software and hardware design and development scheme of the Data Collection System Based on the ARM chip b0x and USB interface control chip ISP1581. the design and development process is complicated, it involves the joint use of various software programs and hardware circuits. Through experimental tests, the results are good.

  References

[1] Luo Hao, Yang Xiaofei. Design of offline data collection system [J]. Microcomputer Information, (4): 93-95.

[2] Data Acquisition System Based on USB interface and embedded chip Bus [J]. Instrumentation Technology and sensor, 2005, (8): 51-53.

[3] Wei, Liu Kaihua. Design of USB2.0 Interface of Data Collection System [J]. Electronic Measurement Technology, (1): 12-13.

[4] Xia Yimin, Wang Guangjun. High-Speed Data Collection System Based on USB Bus [J]. foreign electronic components, 2003, (10): 20-23

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.