1 Introduction
Aiming at the shortcomings of the complex temperature measurement circuit composed of traditional temperature measuring elements (thermocouples, thermal resistors) and cumbersome software debugging, a temperature acquisition control system based on MSC-51 single-chip microcomputer and ADC0809 is designed. The system uses the spare I/O interface in the single-chip microcomputer to realize real-time temperature acquisition and control in an interrupt manner, making full use of the CPU resource space, simplifying the complex process of measuring circuits and program debugging, and facilitating the development and application of technicians in practice.
2 Hardware Circuit Design
2.1 System Composition
Figure 1 is a block diagram of the system hardware composition. The external sensor transmits the electrical signal corresponding to the temperature to the A/D converter for analog-to-digital conversion. After completion, the data is transmitted to the single-chip microcomputer. After the single-chip microcomputer processes the data, it sends the data to the decoder and finally displays it on the digital tube. When there is a keyboard input to control the temperature, the single-chip microcomputer compares the A/D conversion data obtained at this time with the control set temperature. If it is lower than the set temperature, the external device is heated and the LED monochrome light is on; otherwise, it is not heated and the LED monochrome light is off.
2.2 System module design
(1) The main control module uses the minimum system of the single-chip microcomputer MSC-51 as the main control device, and uses the minimum main control module of the MSC-51 single-chip microcomputer. Since the program control is simple, the internal space of the device is sufficient to store the program, and no external memory is required. P0 and P1 ports are selected as output interfaces, and P2 port is used as input interface.
(2) Temperature acquisition module The temperature acquisition module consists of an external sensor, an electric heater and an ADC0809 device. The measurement range of the sensor is 0℃~50℃. Under ideal conditions, the following relationship is established between the output value D of the A/D converter and the input voltage signal V
In the formula, Vmax is the "high reference voltage value" connected to the device Vref+ pin; Vmin is the "low reference voltage value" connected to the device Vref- pin. DMAx is the conversion value output by the interface when the input voltage is Vmax. Dmin is the conversion value output by the interface when the input voltage is Vmin.
(3) Temperature display module The temperature display module consists of 8279 device and digital tube. OUTA0~OUTA3, OUTB0~OUTB3 inside 8279 are connected to decoder 74LS138 to control the display of seven-segment digital tube.
(4) Temperature control module The temperature control module consists of keyboard, MSC-51 device, electric heater, A/D converter, etc. The input of keyboard value is also controlled by 8279 device through row and column scanning, and then through the internal value comparison of MSC-51, the electric heater controls the temperature, thereby achieving the purpose of heat preservation.
2.3 System Hardware Connection
The system uses MSC-51 microcontroller as the main control device for data processing and transmission. In the design, the pin P0.4 of 74LS273 is connected to the switch of the external electric heater to control the heating. At the same time, the LED monochrome light is connected to the pin P0.4 of 74LS273 to display the status of the external electric heater. The pin CS of the A/D converter ADC0809 is connected to the output end of the decoder numbered "8300H", the EOC signal is connected to the pin P1.7 of MSC-51, and IN1 is connected to the temperature sensor. The pin CS of the digital display control device 8279 is connected to the output end of the decoder numbered "8700H". Figure 2 shows the keyboard and digital tube display circuit, and Figure 3 shows the A/D conversion circuit.
3 Software Design
The software is written in the MSC-51 microcontroller assembly language. The interrupt of the internal timer of the microcontroller is used to implement the call of the interrupt program and the function of refreshing data every 5 seconds, which greatly saves CPU resources and improves work efficiency.
3.1 Main program flow
Before the main program starts, set pseudo instructions to facilitate the search of each device address and initialization command when writing the program. The interrupt program of timer 1 is set in the main program, which generates an interrupt at a fixed time and enters the interrupt subroutine. The main program entry address is 0000H, and the interrupt entry address is 001BH. In order to avoid conflicts between the storage location of the program and the preset storage location of the microcontroller, only jump instructions are placed in each entry address. The storage address of the main program starts from 0500H.
The main program starts with "START". After setting the stack bottom and the initialization program of each interface device. Start timer 1 to start timing. When the counting time is 50 ms, timer 1 generates an interrupt and enters the interrupt subroutine. The main program flow is shown in Figure 4.
The main program code is as follows:
3.2 System interrupt subroutine flow
Figure 5 is the interrupt subroutine flow, and its program steps are as follows: The single-chip microcomputer responds to the interrupt of timer 1, enters the interrupt subroutine "FRESH", sets the timing time of 50 ms, and after 100 cycles, obtains the refresh time of 5 s. When the 5 s timing is reached, it immediately enters the A/D converter to read data. Compare the value obtained by the A/D converter with the preset temperature value. If the measured value is lower than the preset temperature, the electric heater is started, and L=ED is on; otherwise, continue to the next step. The digital tube is initialized, and the hexadecimal value after A/D conversion is converted to a decimal value and displayed and output.
4 Conclusion
This solution has the characteristics of saving interface resources, high CPU utilization, fast execution speed, simplicity and ease of implementation, and has the value of promotion. However, due to the shortcomings of errors in the system itself and device conversion, the design needs to further improve the control accuracy and reduce the error, so as to improve the overall performance of the system.
Previous article:Design of automatic line patrol wheel robot control system based on 51 single chip microcomputer
Next article:Optimization Design of Switching Power Supply Based on 89C51 Single Chip Microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How much current can a 0Ω resistor carry?
- Why does a computer become slow when not used for a long time?
- Tektronix 2260B-800-4 Programmable High Voltage Voltage Test Experience
- Qorvo Launches World's Smallest 20-Watt Single-Chip Programmable Motor Control and Drive Solution for Brushless DC Motors
- MSP430 and ATK-NEO-6M GPS module
- 21 "Wanli" Raspberry Pi car - motor control learning (4-wheel speed control)
- HGI HC32A460 series function comparison chart
- PCB drawing process shortcut keys
- How to start power supply design
- Has anyone tried the baud rate adaptation of LIN communication?