news

high speed data transmission technology of USB interfaceMore

Time:2024-07-25

With the rapid development of software radio technology, high-speed sampling technology has been widely used. In the signal system with low real-time requirement, a large amount of data needs to be transmitted to ipc for processing. To meet this requirement, this paper proposes a high-speed data transmission method based on FT232H chip. At the same time, the control interface is designed by using LabVIEW software to verify the playback of the transmitted data.

The universal serial bus is an emerging data communication method that gradually replaces other interface standards. It was jointly developed by Intel, Compaq, Digital, IBM, Microsoft, NEC and Northern Telecom in 1995 and gradually formed the industry standard. USB bus as a high-speed serial bus, its extremely high transmission speed can meet the requirements of high-speed data transmission application environment, and the bus also has the advantages of simple power supply, convenient installation and configuration, simple expansion port, diversified transmission modes, and good compatibility. At present, the interface bus has been developed to the USB 3.0 cable standard, and has been widely used in computers.

LabVIEW is a graphics programming language and development environment based on the computer platform. Under the same hardware conditions, different instrument functions can be realized by using LabVIEW to write different software, which realizes the design concept of "software is instrument". Through graphical programming, users can design the control interface that simulates the real instrument panel, and its rich graphical controls can meet users' needs of numerical input/output, chart/text display, etc., so as to develop a friendly and interactive human-machine interface.

1 USB hardware circuit

1.1 FT232H chip

FTDI's FT232H chip is a single-channel high-speed USB to UART/FIFO interface chip that can be used in a variety of serial and parallel I/O configurations. It contains a proprietary dynamic bidirectional data bus that can be configured for its working mode through external storage. It supports not only asynchronous serial interfaces, but also many synchronous I/O interfaces, such as SPI, I2C, JTAG, and FPGA interfaces, through its built-in multi-protocol synchronous serial engine. Its specific functional characteristics are as follows:

(1) Power supply: bus power supply, dc power supply;

(2) Through the function configuration of external EEPROM, the chip can realize a variety of single-channel USB to serial and parallel interfaces;

(3) Internally integrated complete firmware program;

(4) Communication rate: full speed 12Mbit/s, high speed 480Mbit/s;

(5) In asynchronous 245FIFO mode, the data transmission rate is 8Mbytes/s;

(6) VCP and D2xx drivers are provided, among which VCP is used to drive USB serial port design, and D2xx is used to drive USB communication applications。

1.2 The hardware circuit

The hardware circuit design of USB interface is shown in figure 1. The FT232H chip is powered by bus. The output pin of the bus power is connected to the VREGIN pin of the chip through a filter circuit to power the entire USB hardware circuit. The differential data line of USB interface is connected to the DM pin and DP pin of FT232H chip respectively for data transmission. FT232H chip is connected with 12MHz crystal vibration, which is connected to the OSCI pin and OSCO pin of the chip respectively. The PLL power supply of FT232H chip is provided by the chip itself, which is connected to the VPLL pin through an LC filter circuit, and the required working clock signal is generated by the internal PLL.

The communication mode of USB interface adopts asynchronous 245FIFO mode, and the data transmission rate is 64Mbit/s. In this mode, the FT232H chip ADBUS0 ~ ADBUS7 is connected to the data input pin D0 ~ D7 respectively to receive the data to be transmitted. FPGA generates USB interface transmission control signal, which is connected to FT232H chip ACBUS0 ~ ACBUS4, which is read preparation signal, write preparation signal, read signal, write signal and sleep wake signal, etc., for controlling the data transmission process.

The configuration of USB interface communication mode needs to be completed with the aid of external EEPROM. The circuit USES 93LC56B chip, which is a 128×16bit low-voltage serial EEPROM. The chip can work under the power supply of +2.5 ~ + 5.5v, and use the three-wire serial I/O port which conforms to the working standard to transmit data. It can be directly connected with FT232H chip. Built in power on and power off data protection circuit to prevent data loss, can be stored for more than 200 years. Through the EEPROM, when configuring the communication mode, it can also configure the VID, PID, product description string and other OEM information of the USB interface, so as to facilitate users to develop their own products.

2 USB interface software development

To develop a complete USB interface, its process is relatively complex, in addition to its hardware circuit design, also includes the software design process, mainly including the interface chip firmware programming, device driver development and application software design and other three aspects. The firmware of USB interface chip is its various underlying functions, which are used to realize chip reading and writing operations. Device driver is mainly used to drive USB devices, so that the connection to the upper computer can be recognized. The device driver also needs to complete the firmware download so that the user can apply the firmware. After writing the interface chip firmware and device driver, write the user control software, and control the USB interface communication process according to the user requirements.

2.1 Chip firmware

The FT232H chip is integrated with the firmware needed for USB interface communication, which does not require the user to write independently and simplifies the software development work. The USB interface chip can be configured for two different modes of communication, one is high-speed USB to serial port communication, and the other is single-channel USB communication. USB serial port communication method is to simulate FT232H as a virtual serial port, so that users can connect with the serial port of the upper computer and communicate through FT232H. This mode is designed using the virtual serial port driver provided by the chip company. This transmission mode has a low transmission rate and is often used to upgrade and extend the existing serial communication circuit. This paper adopts single channel USB communication mode, which has a high transmission rate. To realize this mode of communication, a D2xx driver needs to be installed in the upper computer, and the application software can control the chip by calling various driver functions. This mode greatly simplifies the USB development process. The main driver functions are described below:

(1) FT_CreateDeviceInfoList: this function is used to view the details of a USB device;

(2) FT_OpenEx: this function opens a specified USB device according to the USB string code, device description and other information, and returns a handle through which subsequent functions can identify the device.

(3) FT_Read: this function is used to read data from a USB device specified by a handle;

(4) FT_Write:This function is used to write data to the USB device specified by a handle;

(5) FT_GetStatus:This function is used to obtain the status information of a device;

(6) FT_Purge:This function clears the send and receive buffers for a specified USB device;

(7) FT_ResetDevice:This function is used to reset a specified USB device。

2.2 Device drivers

The device driver is mainly used to drive the USB device, so that it can be recognized in the upper computer after connecting to the upper computer. In addition, the device driver has to complete the firmware download, the firmware will be downloaded to the chip to control the chip operation. Use the CDM20814 driver software provided by FTDI to drive the device. After the installation of the USB device driver, the user needs to configure the external EEPROM to set the various information of the USB device and the working mode of the USB interface.

USB interface communication mode is configured as asynchronous 245FIFO mode through FT_Prog software. The USB interface device VID is 0403, the PID is 6014, the product is described as DAQSYS_USB, and the application pin is configured.

3 Application software development based on LabVIEW

As a graphics programming language and development environment based on the computer platform, LabVIEW is more and more widely accepted by the industry, academia and laboratories for its convenient, fast and visual programming methods. Its application fields have been widely covered by test and measurement, embedded, motion control, image processing, FPGA and many other fields.

3.1 LabVIEW programming

LabVIEW software is used to write the USB communication application software, which can quickly build the application program and realize the high-speed data transmission of the USB interface by calling the method of dynamic connection library and calling the firmware driver of the USB interface device provided by FTDI company. The steps are as follows:

(1) Install the dynamic link library: install the firmware driver provided by FTDI to the host computer;

(2) Call dynamic connection library: through the LabVIEW software "interconnect interface" module to achieve the call of dynamic connection library: "interconnect interface" → "library and executable program" → "call library function node" module;

(3) Write control software: use LabVIEW software to call various driver functions, realize the development of USB interface application program。

After the USB interface hardware is electrified, the software opens the USB device and establishes a communication connection with it. Then the USB device is initialized, the USB interface device is reset, and the data in the data cache is cleared. After initialization, the application software queries the status of the USB device to determine whether data is written to the data cache. When data is written, the cache data is read out, and the data is analyzed to determine whether the data is accurate, and then the communication data is displayed. If there is no data in the query data cache, the wait continues.

3.2 USB interface high-speed data transmission debugging

The front panel of USB interface communication application program control is shown in figure 4. The FPGA hardware circuit is used to transmit the sinusoidal signal generated by its internal DDS to the USB interface hardware circuit. The USB interface circuit transmits data to the application program。

First, set the USB device to be opened as "DAQSYS_USB" and clear both the send and receive caches before starting. After the configuration is completed, the USB interface is started for data transmission and the USB status is monitored. The status monitoring column in the interface will display various control states of current USB devices. Using DDS in FPGA to sample at 8MHz to generate sinusoidal signal of 1MHz frequency, output through the USB interface, data is transmitted to the upper computer interface through the USB interface, the upper computer interface to display the transmitted data, the length of the transmitted data statistical display. Through the experiment, the application program can accurately realize the communication between the host computer and the USB device, so as to finally achieve the purpose of program design.

4 conclusion

Based on FTDI's FT232H chip, this paper studies the high-speed data transmission technology of USB bus interface, and proposes an application method of high-speed data transmission based on USB chip. The hardware design method and software development process are described, and the application program is developed by using LabVIEW software, and the high-speed data transmission function of USB interface is verified in the experiment. The USB interface system designed in this paper is simple in structure, stable in performance, easy to develop and fast in transmission rate. With the help of LabVIEW software development tool, the development cycle of the application program is greatly shortened, and the design efficiency and quality of the system are improved.