Introduction To detect a variety of measuring instruments often need to transfer data to a PC, data processing and archiving, to take advantage of PC-rich hardware and software resources, access to more complete and powerful data processing, analysis and the storage capacity. Traditional PC platform, PC-data acquisition card by slot number, address, interrupts and other hardware and software resource constraints, scalability, poor installation and removal difficult and costly. Made since November 1994 Universal Serial Bus (USB) has, USB transfer rates with its high, hot-swappable, easy to extend the outstanding advantages, the development at an alarming rate, quickly swept the electronics world. Strong demand in the market driven, since 1998, USB interface, to enter the field of measuring instruments, and gradually accepted by many well-known instrument companies. Expansion in measurement USB interface has become a trend. For different measuring instruments, to find a universal USB interface solution for the development of the design of measuring instruments is very important. Selection Development of USB devices are generally three ways: one is to use the USB interface with a dedicated microcontroller (MCU), such MCU has its own system structure and instructions, from the ground up specifically for USB control, such as Cypress's CY7C63xxx and the CY7C64013, this type of MCU development needs with a special tool, and the performance is limited; The second method is to use the USB interface with common MCU, this type of MCU is only based on the general Chip Increased kernel USB interfaces, such as Intel's 8x931, 8x930, and so on Cypress's EZUSB such MCU development languages and development tools and general MCU similar, thus easier to start, but the drawback is high cost; third ways is to use pure USB interface chip, its control by external MCU. Such as the Philips company PDIUSBD12, ISP1581 and the National Company of USBN9602, Nanjing, Hsin-heng's CH372, CH375 and so on. USB interface chip such low prices, convenient interface, high flexibility for different hardware environments can be used with a variety of MCU, such as MCU, DSP, FPGA can be. Taking all factors into account, the design uses a third method that uses proprietary USB interface chip device for measuring the expansion of USB. Hardware design USB controller USB controller chip by controlling the USB interface, protocol processing and data exchange. Used in the design of DSP chips TMS320VC33 as a microcontroller, which is mainly based on two considerations: First, the computational speed, instruction cycle only 13nS, can maximize the potential of USB interface chip; second is the cost-effective DSP chip, and has a floating point capabilities, extending up to 40-bit floating point precision. USB interface chip USB interface chip to complete the USB communication link-level exchange of the underlying data, and local micro-controller to provide a parallel interface. PHILIPS this paper we use the company's PDIUSBD12 as USB interface chip. The chip micro-controller with any high-speed parallel interface (2Mb / s), allows the use of the existing architecture and to minimize the firmware investment. This flexibility reduces development time, risk and cost, the development of a cost-effective USB peripheral devices of a quick way. PDIUSBD12 a total of three endpoints: endpoint 0 transmission complete control; endpoint can be configured to interrupt transmission 1; endpoint two have 128B buffer, is the main end-point data transmission. Interface circuit DSP connection with PDIUSBD12 shown in Figure 1. With separate address / data bus configuration, which uses a DSP-controlled address lines A0 PDIUSBD12 the pins, select the command data. A0 = 1, said transmission command, A0 = 0, said transmission of data. Chip select (CS) and suspended (SUSPEND) signal by the DSP's I / O port control. Read and write strobe WR, RD can be DSP-R / W pin and, after taking control of anti-. But this requires an increase in the inverter circuit, in order to save the device to reduce the circuit size, you can choose another one I / O port control PDIUSBD12 read strobe RD. The design selected PAGE1, through access to distinguish between different address on PDIUSBD12 reading and writing. This only takes PDIUSBD12 microcontroller resources of the three addresses, one used to PDIUSBD12 write command, and the second is used to write data to the PDIUSBD12, another to read data from PDIUSBD12. In terms of the DSP, PDIUSBD12 is equivalent to an 8-bit data bus and address of the memory device 3. Device using self-powered mode, you need to EOT through a 10k? The resistor connected to the USB cable to VCC (+5 V) terminal, and Add 1M? pull-down resistor, to detect USB devices are connected to the USB port. Software design USB software design including firmware (firmware) program, PC-side drivers and applications. Which asked writers firmware USB communication protocol on the complex have a deep understanding of programming more difficult, detailed in this thesis. Firmware programming MCU firmware is written to the program, so MCU can be fully in accordance with the USB protocol, identifying the received packet type, the contents of the package, meaning analysis, and complete the appropriate action as required. Through these different types of package delivery, complete the MCU and the interface chip command and data exchange, so as to realize the communication between the host and device. Firmware designed to interrupt-driven mode, using modular design, its overall structure shown in Figure 2. Main loop Major to complete the main loop and port DSP register initialization, set the mode to send commands to the PDIUSBD12, connected SoftConnect. Determine whether the receiver to establish package (setuppackage), received the call, if the standard procedures for processing the request, if the host received the request signal, the call to send data send data. Interrupt handler Interrupt handler is the focus of the firmware programming. Falling edge of the DSP is set to trigger when PDIUSBD12 receiving packets sent to the host when the DSP into the interrupt trigger. First of all, by reading the interrupt register PDIUSBD12 determine the type of disruption that occurred, and then the specific type of access to the corresponding interrupt handling routines. Interrupt handler flow chart shown in Figure 3. USB protocol provides 11 USB devices must support all standard requests, such requests are made through the endpoint 0 We are high quality suppliers, our products such as green laser diode module , China multimode laser diode for oversee buyer. To know more, please visits laser counting systems.
Related Articles -
green laser diode module, China multimode laser diode,
|