为了转发水质监测数据,采用新型的1T周期单片机STC10F04EX为控制核心,将双4选1模拟开关4052的2个公用端与单片机的RxD、TxD端连接,通过分时连通的方式,对单片机的UART进行扩展,构成一个多串口的数据转发系统。扩展的串口分别连接到3个不同的水质监测设备,以及一个与无线发射模块。单片机分时得到3个水质监测设备传来的数据,并将得到的数据通过无线模块进行转发,转发距离可达3 000 m。远离现场的计算机完成数据接收及分析。该方法用于对单片机串口扩展和远距离数据传送简洁可靠。所建的数据收发系统,可以同时连接多台串口监测设备,弥补了计算机串口较少的不足,并且功能有别于多串口卡。该系统已成功应用于多传感器水环境监测的数据转发。
In order to transmit the data of water quality, a multi-serial-port transceiver system is established, which adopts a new 1T cyclical MCU STC10F04EX as a core component, employs the two common pins of multiplexers 4052 to connect to UART (RxD and TxD), and extends the UART of the MCU through time-sharing mode so as to form 4 serial ports. One serial port is connected to a wireless transceiving module, the others communicates with three external equipments monitoring water quality. The MCU gets the monitoring data from those serial devices and transmits through the wireless module. The transmission distance is up to 3 000 m. A computer far away from the scene receives data and analyzes it. This method is simple and reliable for UART expansion and long-distance data transfer. The transceiver can simultaneously connect multiple serial equipments, and makes up for a shortage of computer serial port. The characteristics of this transceiver is different from that of multi-serial-port card. The transceiver has been demonstrated successfully in water monitoring system wi'th multi-sensors.