Based on CY7C68013-100AC chip to improve the design of MPEG video card
Ora pubblicata: 2020-05-14 14:10:34
Universal Serial Bus (Universal Serial Bus, or USB) has become a widely used peripheral connection specification in the PC field due to its convenient plug-and-play and hot-swap characteristics and high transmission rate. At present, the USB1.1 specification is generally adopted at home and abroad. It supports two transmission rates: 1.5Mbps and 12Mbps, and is mainly used in occasions where low-speed transmission is required. The USB2.0 specification released in 2000 provides a transmission rate of 480Mbs to meet faster data transmission requirements.
In order to enable the MPEG video card to quickly transfer a large amount of data to the PC, we used USB2.0 technology when designing the interface between the MPEG video card and the PC. For the design and development of USB, we are based on the CY7C68013-100AC chip and its FX2 development kit of the EZ-USB FX2 series of CYPRESS.
1. Hardware design
The traditional MPEG video card with PCI interface not only occupies a limited PCI slot, is inconvenient to install, but also does not support hot swap and plug and play. Therefore, in this design, we chose the USB2.0 interface chip to improve the traditional MPEG video card.
The scheme of the improved USB2.0 interface is shown in Figure 1.
Figure 1 MPEG video card with USB interface
The working principle of the USB2.0 interface MPEG video card is: audio and video signals are A / D converted by the AK4550 audio processing chip and AA7113 video processing chip, and the analog signal is converted into an 8-bit PCM format digital signal, and the incoming SZ1510 audio The video compression acquisition chip performs processing, and converts the data in the coded and modulated PCM format into a mixed film and television file conforming to the format MPEG-1. Finally, the MPEG-1 data is sent to the PC via a USB interface chip for further processing, such as storage and display.
In the design, the USB interface chip we chose is the CY7C68013-100AC chip of the EZ-USB FX2 series. The chip is aimed at USB2.0 and is compatible with USB1.1. It supports two transfer rates: full speed (Full_speed) 12Mbps and high speed (High_speed) 480Mbps, it does not support Low speed (Low_speed) 1.5Mbps. The internal structure of the chip is shown in Figure 2.
CY7C68013-128AC integrates an enhanced 8051 core, which is compatible with the standard 8051 and has many improvements: the maximum operating frequency is 48MHZ, and only 4 clock cycles are required for one instruction cycle, which is an average increase of 2.5 times compared with the standard 8051 ; 2 UARTS ports; 3 timers / counters; extended interrupt system and more I / O ports. The USB2.0 SIE integrated inside CY7C68013-100AC can complete most of the USB2.0 protocol processing work, reducing the user's handling of complicated USB protocol. In addition, when developing, users can use GPIF and FIFO to realize the logical connection with high-speed peripheral devices and perform high-speed data transmission. In this improved solution, we chose the GPIF method to achieve communication with the Z1510.
Figure 2 USE interface chip internal structure diagram
2. Software design
USB software design includes three aspects of work: firmware (Fireware) design, driver design and host-side application design.
(1) Firmware design
In the design, we considered that the MPEG video card requires fast and continuous transmission of a large amount of data, and the integrity of the data is not too high. We use the ISO transmission method. In addition, we let CY7C68013-100AC work in FIFO Read mode in GPIF mode, which can transmit up to 4G byte (WORDWIDE = 0) or word (WORDWIDE = 1). Since the peripheral data does not need to be processed by 8051, we adopt the method of automatic packing (AUTOIN = 1), directly from FIFO to SIE, which is conducive to improving the transmission rate.
(2) Driver design
Under the WINDOWS platform, the USB driver consists of three parts: USB device driver, USB bus driver and USB host controller driver. They must follow the WIN32 driver model (WDM). Among them, WINDOWS operating system has provided the USB bus driver and USB host controller driver at the bottom of the driver stack. The USB device driver is written by the device developer. It sends IRP (I / O Request Packet) including URB (USB Request Block) to the USB bus driver to realize the exchange of information between USB peripherals. When the host application wants to perform I / O operations on the USB device, it calls Windows API functions to make Win32 calls to the Win32 subsystem. The I / O manager constructs the request into a suitable IRP and passes it to the USB Device driver. After receiving this IRP, the USB device driver constructs the response URB according to the specific operation code contained in the IRP and puts it in a new IRP, and then passes this IRP to the USB bus driver. The URB included in it executes the response operation and returns the operation result to the USB device driver through the IRP. After receiving this IRP, the USB device driver returns the operation result to the I / O manager through the IRP. Finally, the I / O manager returns the operation result in this IRP to the application program, so that the application program completes one I / O operation on the USB device.
To develop USB device drivers, Numega ’s Driver Works and Microsoft ’s 2000DDK can be used, and VC ++ 6.0 can be used as an auxiliary development environment. Driver Wizard provided by Driver Works can automatically generate a code framework according to the needs of users. Reduced the difficulty of development and shortened the development cycle.
In the EZ-USB FX2 development kit of CYPRESS, there is a universal driver program, which can be used directly after being compiled by the DDK without modification. In this design, due to time, we use this generic driver (GPD).
(3) Application design
The USB host application is a program that performs specific functions in the computer. The key is to read or send a specific amount of data from a USB peripheral, a USB standard device request, and specific commands. In addition, the data can be further processed, such as: storage, display, fast Fourier transform, etc. Under WINDOWS 2000, the application development tool we use is VC ++ 6.0.
The card is an improvement on the traditional PCI interface MPEG video card, it supports hot swap and plug and play. Because of adopting USB2.0 interface, its transmission rate is also higher than the latter, which meets the requirements of high-speed data transmission and solves the transmission bottleneck existing in USB1.1. I believe that with the support of USB2.0 by major computer motherboard manufacturers, USB2.0 will be widely used in various fields of PC applications.Etichetta: CY7C68013-100AC