----Ordinary external sampling systems are generally connected to PC through RS-232C. Due to the limitation of PC, the maximum data transmission rate of RS-232C does not exceed 115kbps (based on serial port chip 16550, if based on 8250, the maximum is only 9600bps), and the transmission distance will not exceed 15m. For medium high speed and high precision continuous sampling system, the minimum amount of data transmission per second is (100kHz sampling rate, 10 bit sampling accuracy): 100k 10 = 1000K. If RS-232C exchanges data with the sampling system at 115kbps, it requires a transmission time of about 1000K / 115K = 8.7s. The bottleneck of the interface speed between the sampling system and PC will lead to the loss of some data and the significance of continuous sampling. Therefore, improving the flow of data channel between PC and external sampling system is the key to realize external medium high-speed and high-precision continuous sampling system. With the continuous development of computer software and hardware technology, the excellent characteristics of the new generation universal serial bus interface provide us with an excellent solution.
----USB technology consists of three parts: PC system with USB interface, system software that can support USB and devices using USB interface. Now, most PCs above 586 have USB interface, and the Win98 operating system launched by Microsoft also fully supports USB devices. USB devices have attracted people's attention because USB not only changes the previous low-speed situation of serial bus, but also introduces many new features that serial bus technology does not have. The USB 1.1 specification supports low-speed 1.5mb/s and high-speed 24MB / s data transmission rates.
----USB bus control protocol requires three data packets describing data type, transmission direction and termination flag and USB device address during data transmission. Therefore, USB can connect multiple USB devices at the same time in the form of daisy chain. The USB device supports the functions of data debugging and error correction when sending data, which enhances the reliability of data transmission. USB also has some new features, such as sharing (a physical device can use many different pipes), real-time (it can realize effective real-time communication with a device), dynamic (it can realize dynamic switching between interfaces), joint (different interfaces with similar characteristics can be combined), and versatility (different power supply modes can be used for different interfaces), automation (the use of default pipe makes the establishment and configuration of the base system automatic and fast).
3 Hardware and software design of external sampling system:
----The 8x930ax series USB controller of Intel company is used as the control chip of the sampling system. The chip takes the widely popular 8xc251sx series microcontroller as the MCU core. Therefore, it uses the MCS251 instruction system compatible with MCS51. The chip operates at 12Mhz and has 11 interrupt sources, of which three are allocated to USB devices. The chip integrates USB interface Comply with USB 1.0 standard and support high speed (12mbps) and low speed (1.5mbps) In addition to adding USB interface, 8x930ax has also made many major improvements on the basis of 8xc251sx, such as 1K on-chip data RAM, supporting up to 256K external program / data storage space, and the on-chip ROM can reach 8K capacity, which provides many conveniences for the development of sampling system The developers of MCS-51 single chip microcomputer system can quickly master the program design of the chip. The hardware design block diagram of the system is shown in Figure 1.
----The sensor part can be designed according to the characteristics of the collected quantity. For the analog quantity requiring long-distance transmission, it is best to adopt the mode of current transmission, that is, convert various environmental quantities (such as temperature, humidity, pressure, etc.) at the sampling place into the form of current for long-distance transmission. At the same time, pay attention to the shielding of the transmission line to prevent external interference in the transmission process.
----The system selects the A / D conversion board composed of TI's tlv2548, which has the highest sampling rate of 200ksps, 12 bit sampling accuracy and 8 input channels.
----CPU1 and CPU2 are sampling control boards with 8x830ax of Intel as the core. 8x930ax only adds USB interface compared with ordinary MCS51 series single chip microcomputer. Therefore, the design of the control board can refer to the design of ordinary MCS51 single chip microcomputer. However, due to the limitations of single chip microcomputer, it can not realize the concurrency mechanism of multiple instructions. Therefore, when the single chip microcomputer system completes the sampling process, it coexists It is stored in the external data RAM with limited capacity. Once the external data RAM is full, the single chip microcomputer must stop the data acquisition process of sampling and forward the data, that is, turn to transmit the data with external data RAM to PC for storage and processing. Therefore, if only one single chip microcomputer system is difficult to realize continuous data sampling, this can be realized through the combination of two single chip microcomputer systems Cooperative processing to solve this contradiction, as shown in Figure 1. C1 and C2 are the cooperative work control line signals of two single-chip microcomputer systems. When CPU1 must turn to data forwarding, it can send a wake-up signal through C1 to inform CPU2 to enter the data sampling process. Using the data transmission of high-speed USB interface, we can calculate that the 10 bit sampling accuracy is better under the sampling rate of 100ksps Please, fill it with 64K 8 external RAM (such as tms28f512a-15) takes time (for easy storage, 10 bit sampling data occupies 2 bytes of storage space): --- 64K 8/100K two 8) = 0.32 seconds
----In addition, in order to ensure the reliability of data transmission, the transmission time is far less than 0.32 S. therefore, when CPU2 is loaded with external RAM and enters the data forwarding process (i.e. in the sampling stage) At the same time, CPU2 can wake up CPU1 through C2 to enter a new round of data sampling process and turn to the data forwarding process. In this way, CPU1 and CPU2 sample and forward data in turn, so as to realize continuous data sampling. CPU1 and CPU2 can coordinate their work in the high-speed sampling system The high-speed data transmission rate of sb interface is the key to the realization of the system. At the same time, in order to ensure the coordinated work of the whole system and prevent CPU1 and CPU2 from competing for data channels, it is necessary to ensure the reliable work of C1 and C2 as dual computer coordinated control.
----The software flow of MCU CPU1 of the system is shown in Figure 2:
----The software flow chart of CPU2 is similar to that of CPU1. It only needs to reorganize the functional modules in the order of responding to the wake-up signal, carrying out the sampling process, sending the wake-up CPU1 signal and carrying out the data forwarding process. PC (i.e. upper computer) The control module and data processing module can be organized according to the design requirements. The sending and receiving of data can exchange data with the sampling system by calling the USB interface driver module of PC.
----The external medium, high-speed and high-precision sampling system with USB interface has well completed our requirements. The sampling equipment has mobility and can be freely connected to the PC running on the Windows98 platform with USB interface. In addition, the PC communication software and DSP processing components developed by ourselves can replace the ordinary digital oscilloscope. In addition, the excellent performance of USB universal serial bus The performance is not limited to the high data transmission rate. The USB interface also supports the simultaneous connection of 127 independent USB devices. Therefore, the sampling system with multiple USB interfaces can be connected to a PC at the same time to form a sampling system network to complete the continuous and uninterrupted collection of analog quantities at multiple places. If the control device we need is configured on the sampling system network, a simple sampling system can be realized Single analog monitoring system.
Bao’an District Shenzhen City, China
+86 189 3806 5764