Design of communication interface for DSP core signal acquisition system

Publisher:平和思绪Latest update time:2011-05-17 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0. Introduction

With the continuous development of digital signal processing technology theory, the development of digital signal processors is also changing with each passing day. Not only is the speed of executing instructions getting faster and faster, but its power consumption is also getting lower and lower. Many instruments or detection equipment have applied DSP to systems with huge data volumes and real-time data transmission. Nuclear signal data acquisition systems are no exception. Using DSP, the collected signals can be processed effectively in real time, and the processed data can be sent to the host computer for further processing. Usually, the communication between the lower computer and the host computer of the data acquisition system adopts the serial port method, which is not only simple in protocol, but also convenient in connection. However, the data transmission rate of this method is not high, and the USB bus interface has the advantages of convenience, plug-and-play support, and high-speed data communication, and is widely used in many fields. The transmission rate of the USB bus interface can reach 12Mbps under the USB1.1 protocol and 480Mbps under the USB2.0 protocol, which can fully meet the current data acquisition control system's increasingly high requirements for real-time data transmission rate.

Therefore, in this system design, the communication mode adopts USB (Universal Serial Bus) bus interface mode. The USB control chip adopts Cypress's EZ-USB SX2 series CY7C68001 control chip, and the DSP uses TI's fixed-point DSP chip TMS320VC5502.

1. Introduction to CY7C68001USB control chip

CY7C68001 is a high-speed USB chip developed by Cypress Corporation of the United States, supporting USB2.0 protocol. It integrates USB transceiver (physical layer), USB serial interface engine SIE (link layer, implementing the underlying communication protocol), 4KB FIFO, voltage regulator, and phase-locked loop; it can work in two transmission modes: full speed (12Mb/s) and high speed (480Mb/s), supports 8-bit and 16-bit data bus modes, and has synchronous and asynchronous FIFO interfaces. CY7C68001 is used to connect with controllers such as DSP, ASIC, FPGA, etc. to realize USB functions, and does not contain a microcontroller. At the same time, CY7C68001 provides 4 transmission modes (control transmission, interrupt transmission, bulk transmission, and synchronous transmission), which can meet the user's requirements for various transmission modes. Since the control chip does not contain a microcontroller, the USB application layer protocol should be implemented by DSP programming, and the loading of USB firmware must be completed by DSP controlling CY7C68001.

2. Communication interface system hardware design

The entire acquisition system includes sensor signal conditioning circuit, A/D conversion circuit, FIFO data buffer unit, DSP controller, FLASH program storage unit, CPLD logic control unit, and USB communication unit connected to the host computer. The hardware interface block diagram of the USB unit communicating with the PC is shown in the figure below.




Figure 1 Hardware interface diagram of data acquisition system communicating with PC

As can be seen from Figure 1, the communication part is mainly composed of CY7C68001 USB controller, CPLD logic unit, E2PROM, and TMS320VC5502. Since the number of devices required for the entire system is large, the resulting logic control is relatively complex, and the DSP's I/O interface is limited, so a CPLD logic control unit is added to the system to generate the logic state required in the circuit. At the same time, the register function is also implemented in the CPLD. This part of the register is used to represent various status information during USB communication, which is convenient for DSP to query.

The CY7C68001 USB controller and TMS320VC5502 use EMIF connection mode, and the memory in the USB controller is configured to CE1 space. At the same time, the asynchronous read and write mode is used to complete the data and command exchange between TMS320VC5502 and CY7C68001. The role of E2PROM in the system is to complete the bootstrap of the description table of the USB controller. There are two bootstrap modes for the CY7C68001 controller: EEPROM and microcontroller. This system uses the EEPROM mode.

3. Communication interface system software design

3.1 Host software design

The main function of the host software is to complete the reception, display, and analysis of data uploaded by the lower computer. Since the amount of signal acquisition data is large, batch transmission is adopted in USB transmission.

The design of host software includes three aspects:

(1) USB driver design

The function of USB driver is mainly to realize USB discovery, configuration, shutdown and data transmission interface control. The design of USB device driver is based on WDM (Windows driver model). WDM adopts a layered driver model, which is divided into a higher-level USB device driver and a lower-level USB function layer. The USB function layer consists of two parts: a higher-level universal serial bus module (US-BD) and a lower-level host controller driver module (HCD). In the above USB layered module, the USB function layer is provided by the operating system and is responsible for managing the communication between the USB device driver and the USB controller, loading and unloading the USB driver, and establishing communication with the USB device universal endpoint to perform device configuration, data and USB protocol framework and packaging format bidirectional conversion tasks.

(2) Install USB information file (.inf)

This step is used to bind the driver to the Verdor ID (VID) and Product ID (PID) of a specific device. When a USB device is plugged into a computer, the computer automatically sends a query request after detecting the device is plugged in; the USB device responds to the request and sends the device's VID/PID. The computer loads the corresponding device driver based on these two IDs to complete the enumeration.

(3) User application

The user application is the core of the data acquisition system. Its main functions are: turning on or off USB devices, detecting USB devices, setting USB data transmission pipelines, setting A/D states and data acquisition ports, collecting data from the USB interface in real time, and displaying and analyzing data. The entire application is written in Microsoft Visual C++, and A/D sampling and data display are achieved through interface control.

Here are some application-related functions:

BOOLEAN OpenDriver ( ) ;

BOOLEAN CloseDriver ( ) ;

PVO ID Sx2GetDeviceDesc ( );

PVO ID Sx2GetStringDesc (int stringIndex);

PVO ID Sx2GetConfigDesc ( );

BOOLEAN Sx2GetPipe Info (PVO ID p Interface);

BOOLEAN Sx2SendVendorReq (PVO ID myRequest, char * buffer, int bufferSize, int *

recnBytes);

BOOLEAN Sx2GetPipe Info (PVO ID p Interface);

3.2 DSP Software Programming

The data transmission between the USB host and the device is carried out through the endpoints in the device. These endpoints are identified by the endpoint number and the input and output direction, and a fixed FIFO storage area is allocated for data transmission. During initialization, this system configures the four endpoints of CY7C68001 as a batch transmission type. Among them, FIFO2 and FIFO4 are output endpoints for receiving data from the host computer; FIFO6 and FIFO8 are input endpoints for storing data to be sent. Each FIFO is set to asynchronous working mode. After initialization, the DSP turns on the USB external interrupt, writes the descriptor table to CY7C68001, and waits for its enumeration interrupt. After the enumeration is successful, the DSP performs other configurations on CY7C68001 and clears the FIFO, and then waits for the host to send a user request and performs corresponding processing. The software program flow chart is shown in Figure 2.


Figure 2 DSP software programming flow chart

DSP software programming mainly includes DSP initialization, USB descriptor table writing, other command register configuration and corresponding processing of user requests. DSP initialization mainly initializes the clock rate, configures the EMIF port, configures the McBSP port, etc. The USB descriptor table is mainly used to complete the initial configuration inside the USB chip, and the command register configuration is to complete the opening of the USB interrupt, the endpoint data transmission capacity and direction configuration, etc. The user request is the user application, which completes the corresponding data transmission according to the request sent by the user.

4. Conclusion

This system uses the USB interface to complete the data transmission between the nuclear signal acquisition system and the host computer. The user program of the host computer displays the transmitted data and the waveform. The verification shows that this method is simple to connect and reliable in transmission. Compared with the ordinary serial port, its speed has also been improved.

The innovation of this paper is to use the traditional DSP signal acquisition system for nuclear signal acquisition, and improve the serial port mode of communication with the host computer to USB mode. The use of this plug-and-play interface not only facilitates the connection with the host computer but also improves the transmission rate.

Reference address:Design of communication interface for DSP core signal acquisition system

Previous article:Design of Universal Controller for LCD Based on DSP
Next article:Implementation of IRIG-B Encoder Based on FPGA

Latest Industrial Control 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号