This paper uses USB1.1 and USB2.0. USB 1.1 is the basic specification. Based on the CH372 controller, the end-to-end connection between the computer application layer and the local microcontroller is provided. The system uses the request plus response method to communicate.
Thus the communication conversion between serial port and USB interface is realized. Experiments show that the application of this technology promotes the development of traditional instruments towards miniaturization and miniaturization, and effectively improves the ability of hardware and software coordination.
In order to realize the communication conversion between serial port and USB interface, it is necessary to understand the USB protocol. So you know what a host is: USB is a master-slave mode of communication, communication is initiated by the host. From the point of view of protocol, host is the party that can implement host protocol. From the hardware point of view, USB chips are divided into two kinds: main control chips and device chips. Communication is built between the main control chip and the device chip. If there is a main control chip on the computer motherboard and a device chip on the instrument. In the communication between computer and instrument through USB, the host computer is obviously the computer. The instrument is a slave equipment. So, what is the USB interface? The meaning of USB interface is universal serial bus, the full name of which is Universal Serial Bus in English. It is a new interface standard. The advantages of USB interface devices are plug and play, support for hot plug and play, fast transmission speed, and the ability to connect up to 127 USB devices through expansion. There is no need to worry about the conflict between USB encryption locks and printers and other peripherals. USB has two specifications, namely, USB 1.1 and USB 2.0. USB 1.1 is a popular USB specification at present. The transmission rate of high-speed mode is 12 Mbps, and that of low-speed mode is 1.5 Mbps. Note: here B means Bit, 1MB/s (megabytes/seconds) = 8MBPS (megabits/seconds), 12Mbps = 1.5MB/s. At present, the main type of home low-end scanner is USB interface. The USB 2.0 specification evolved from the USB 1.1 specification.
Its transmission rate reaches 480 Mbps, converted to 60 MB/s, which is enough to meet the speed requirements of most peripherals. The Enhanced Host Controller Interface (EHCI) in USB 2.0 defines a compatible architecture with USB 1.1. It can drive USB 1.1 device with USB 2.0 driver. That is to say, all devices supporting USB 1.1 can be directly used on the interface of USB 2.0 without worrying about compatibility issues, and accessories such as USB cables, plugs and so on can also be directly used. Now the most widely used is the USB interface. There are many types of USB interface, which is widely used in various mobile digital products. It not only transmits fast, but also supports hot-swap. It is very convenient to use. The USB interface was invented by Apple. Now it seems that the development trend of USB is very good. Although there are 1394 interfaces now, the penetration rate of USB is far less than that of USB. USB has developed from 1.1 to 2.0. The stability of speed core has been growing rapidly, and it is widely used. It is estimated that it will be developed well in the future. With the popularity of a large number of personal computers supporting USB, it is a general trend that USB gradually becomes the standard interface of PC. The latest PC almost 100% supports USB. On the other hand, devices using USB interface are also developing at an alarming speed.
At present, we use the USB 1.1 standard interface, its transmission speed is 12 Mbps.
USB bus interface controller is an important device for communication between USB device and host computer. At present, there are many kinds of USB controllers on the market, which can be roughly divided into two kinds: one is the MCU with USB interface, such as cypress CY series; the other is the pure USB controller which only deals with USB communication, and must have an external microcontroller for protocol processing. According to the classification of USB controllers, there are two ways to realize the communication between USB devices and hosts: (1) USB controllers with microprocessors (2) independent USB controllers plus microprocessors. According to the function of data acquisition card, this system uses SPCE061A single chip computer with 7 channels and 10 bits precision A/D converter and USB control chip CH372 to compose external data acquisition device to realize communication with host computer. A practical USB data acquisition system includes A/D converter, DIO, microcontroller, USB control chip and PC application program. The external measured signal is transformed into analog voltage signal by sensor and converted into digital signal by A/D conversion module through shielded cable. On the host side, when peripheral USB devices are connected to the system, after bus enumeration is checked and configuration is available, the application program on the host side can control the data acquisition system to collect data. The microcontroller collects data according to the required sampling rate, stores the collected data in the data memory, and then transfers the data packaged according to the USB bus transmission protocol to the host through the USB interface control chip. The host application program displays and analyses the data. The main features of CH372 controller are: (1) It supports full-speed device interface, compatible with USB2.0 specification, plug and play, and only needs crystals and capacitors for peripheral components. (2) Provide a pair of main endpoints and a pair of auxiliary endpoints to support control transmission, batch transmission and interrupt transmission. (3) With 8-bit data bus, read, write, chip selection control line and interrupt output, it can be easily connected to the system bus of MCU/DSP/MPU controller.
(4) The underlying protocol of USB communication is built-in, which has a convenient built-in firmware mode and a flexible external firmware mode. In the built-in firmware mode, CH372 automatically handles all the transactions of default endpoint 0, and automatically completes the standard USB enumeration configuration process. As long as the local MCU is responsible for data exchange, the MCU program is very simple. Universal Serial Bus (USB) is a technical standard for connecting external serial devices. Computer systems connect input/output interface standards of peripheral devices (such as keyboard, mouse, printer, etc.). USB is a specification of device socket. In USB mode, all peripherals are connected outside the chassis, connecting peripherals do not need to open the chassis anymore, allowing peripherals to be hot-plugged without shutting down the mainframe power supply. USB adopts the “cascade” mode, that is, each USB device is connected to a peripheral USB socket with a USB plug, and it itself provides a USB socket for the next USB peripheral connection to enter the measurement instrument market with USB instruments for seven years, the early progress is slow.
Since the introduction of USB 2.0 high-speed interface, USB instruments have advanced faster in variety, performance, application and other aspects. It is not only limited to USB instruments with common indicators, but also has emerged more advanced USB instruments with characteristics, thermostatic element such as timing and synchronization expansion, GHz time domain reflectometer, etc. If the miniaturization and miniaturization of USB instruments are successful, there will surely be more miniature measuring instruments. The market of wireless USB instrument will improve the mobility of measuring instrument. USB instruments have become the mainstream of measuring instruments, and at the same time, it promotes the development of traditional instruments towards miniaturization and miniaturization.