Design and implementation of liquid level monitoring instrument based on multiple single chip microcomputers[Copy link]
It is a common practice to design a liquid level monitor using a single-chip microcomputer. If there are many channels (more than 16 channels) for the liquid level to be measured, each channel is required to be able to scroll and display the total input and output of each shift, day, and month within one year (3 shifts per day), the data will not be lost in normal or unexpected power outages, the human-computer interaction ability must be strong (an appropriate number of buttons and LCD display must be set), and each channel of liquid level must correspond to 2 control output signals (liquid tank liquid input control and output control), configure a micro printer port, and set a sound alarm. All of these undoubtedly require a lot of I/O ports to support, which cannot be achieved by a single-chip microcomputer alone, and an expanded I/O port is required. In this design, the author believes that the use of a dedicated I/O expansion chip has many disadvantages. After weighing the pros and cons, the method of using a single-chip microcomputer to replace the dedicated I/O interface chip was chosen. 1. Comparison between dedicated I/O chips and single-chip microcomputers used as I/O chips ① The number of I/O ports of dedicated I/O interface chips is not more than that of single-chip microcomputers (the single-chip microcomputer model used by the author is 89C52); ② Dedicated I/O interface chips are not flexible to use. Several usage methods have been set by chip designers and cannot be changed beyond this range. Single-chip microcomputers are less restricted and more flexible to use; ③ The independence and intelligence of the dedicated I/O interface chip are poor. Whether it is receiving input signals or outputting control signals, the I/O dedicated chip cannot make decisions on the input and output of signals. The decision must be made by the single-chip microcomputer. It only plays the role of relay or transition signals, has no monitoring ability, and cannot handle problems independently. However, the single-chip microcomputer is different and can handle problems flexibly in a variety of ways; ④ To use the I/O expansion dedicated chip, you must be familiar with it. Engineering and technical personnel are generally much more familiar with the single-chip microcomputer than with it. In comparison, using it is a waste of time. In addition, the price of the I/O expansion dedicated chip is higher than that of the single-chip microcomputer, which is not economical from the perspective of cost accounting; ⑤ The real-time performance of the dedicated I/O chip is poor. Since the I/O expansion dedicated chip only plays the role of sending and receiving signals, it has no ability to process and process signals. The transmission of signals back and forth through it is bound to cause delays, resulting in the problem of poor real-time performance; ⑥Using a single-chip microcomputer as an I/O interface facilitates modularization of software and hardware design, with clear division of labor, which greatly facilitates design, debugging, and maintenance; ⑦Using a single-chip microcomputer as an I/O interface strengthens the supervision of the interface and reduces the burden on the main single-chip microcomputer.