Introduction
All kinds of measuring instrument detected data often need to transfer to the PC for data processing and archiving to take full advantage of the rich PC hardware and software resources, get more sophisticated and powerful data processing, analysis, and storage capacity.
Traditional PC platform data acquisition card from PC slot number, address, interrupt, and other hardware and software resources, scalability is poor, the installation of the high cost of demolition of the difficulties.Since November 1994, proposed a universal serial bus (USB), USB to its transmission rate is high, supports hot-plug, easy-to-extension of the outstanding advantages, developed at an astonishing pace, quickly swept through the world of electronic products.
The market needs a strong drive, beginning in 1998, the USB interface into the measuring instruments, and progressively been accepted by many famous instrument company. In the measuring instruments in extended USB interface has become a trend. For the different measuring instruments, seeking a Universal USB interface solutions for the development and design of a measuring instrument is of great significance.Programme selection
Development of USB devices generally have three modes: one is using the USB interface of dedicated microcontroller (MCU), the MCU has its own system structure and instruction, from underlying dedicated to USB control, such as Cypress company CY7C63xxx and CY7C64013, MCU development needs to use special tools and limited performance; the second way is to use the USB interface of the MCU, such general purpose MCU chips based on the average only increases the USB interface to the kernel, such as Intel Corporation 8x931, 8x930 and Cypress EZUSB etc of the company, the MCU development languages and development tools and General MCU similar, therefore more vulnerable, but the drawback is the cost is relatively high; the third way is to use pure USB interface chip MCU through plus on its control.
If the Philips company PDIUSBD12, ISP1581 and National company's USBN9602, Nanjing qinhe constant company CH375 CH372, etc. Such USB interface chip prices lower, interface, convenient, flexible, tailored for different hardware environments can meet a variety of uses, such as single-chip MCU, DSP, FPGA. The various factors taken into account, this design choice of third way, i.e. using the dedicated USB interface chip for measuring instruments extended USB interface.Hardware design
USB controller
USB controller through control of the USB interface chip implementation protocol processing and data exchange.
In this design choice DSP TMS320VC33 as microcontroller, which is based on two considerations: first, the operation is faster, instruction cycle only to 13nS, you can maximize the potential of the USB interface chip; the second is the DSP chip price, with floating point arithmetic functions, extended floating-point precision of up to 40 bits.USB interface chip
USB interface chip to complete USB communication underlying data link level switching and local micro-controller provides a parallel interface.
This article use PHILIPS company PDIUSBD12 as USB interface chips.
The chip can be used with any microcontroller achieve high-speed parallel interface (2Mb/s), allowing the use of existing architecture and firmware to minimize investment. This flexibility reduces development time, risk and cost, is developing efficient low-cost USB peripherals for a quick way.A total of three groups of PDIUSBD12 endpoint: endpoint 0 complete control of transmission; endpoint 1 can be configured to interrupt transmission; endpoint 2 128B buffer is the primary data transport endpoint.
Interface circuit
DSP and PDIUSBD12 connections as shown in Figure 1.
Use separate address/data bus configuration, i.e., an address with DSP line control PDIUSBD12 a0 pin, select the command data. A0 = 1 indicates that the delivery order, A0 = 0 for transferring data. Chip selected (CS) and pending (SUSPEND) signal from DSP I/O port control. Read and write selected communication RD, WR, can use DSP R/W pin and negated control. But this needs to be increased in the circuit of the inverter, saving devices to reduce the volume of the circuit, you can also select an i/o port control PDIUSBD12 read gated RD. This design choice PAGE1, through access to different addresses to distinguish on PDIUSBD12 of read and write operations. This PDIUSBD12 occupies only three micro-controller address resources, a used to write command, the second PDIUSBD12 used to write data, PDIUSBD12 one used to read data from PDIUSBD12. For the purposes of the DSP, PDIUSBD12 is equivalent to an 8-bit data bus, and 3 address storage devices.Equipment use self-powered mode, you need to pass a 10k EOT? resistance connect to USB cable VCC (+ 5V) end with 1M? pull-low resistor for the detection of USB devices connected to the USB port.
Software design
USB software design including firmware (firmware) program, PC-side drivers, and applications.
Which firmware procedures require authors to complex USB communication protocol has a profound understanding of programming the high difficulty, in this paper will be covered in more detail.Firmware programming
Firmware is a program to write MCU in the MCU can finish
All follow the USB protocol, identification of the received packet type, the contents of the package, meaning, and in accordance with the requirements and complete the action. Through these different types of package delivery, complete MCU and interface chip command and data exchange, and thus for host and device communication.Firmware programs designed to interrupt-driven mode, modular design, the overall structure as shown in Figure 2.
[1] [2] [3]
No comments:
Post a Comment