Design of multi-parameter real-time acquisition and processing system controlled by single chip microcomputer

Publisher:bobojrtLatest update time:2011-11-29 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
In modern industrial control systems, multi-parameter real-time acquisition plays a very important role in the normal operation of monitoring equipment. Multi-parameter signal acquisition is to convert the physical quantity, chemical quantity or biological quantity of the monitoring site into an analog voltage signal that is easy to collect and process through the corresponding sensor and conditioning circuit. After processing by the single-chip microcomputer, it is fed back to the control component to control and adjust the monitored object on the one hand, and sent to the display unit on the other hand to display the collected signal data in real time. In the control fields of aviation, automobiles, communications, gardening, etc., multi-parameter real-time acquisition and processing is the core of the automatic control system. However, the price of dedicated data acquisition equipment is tens of thousands of yuan, and the price of high-speed data acquisition cards is also more than one thousand yuan. Moreover, most of these devices have fixed interfaces and cannot adapt to the needs of the various objects being measured, and are not universal. From the application perspective, this paper designs a real-time data acquisition system with a resolution of 8 bits. With the support of the STC_ISP_V394 software environment, the collected parameters are displayed in real time on a PC. The lower computer uses AT89C52 single-chip microcomputer as the control unit, and the 8-channel A/D conversion chip ADC0809 collects two voltage signals: channel 0 is sampled once every 1s, for a total of 10 times; channel 1 is sampled once every 5s, for a total of 20 times. The collected data is sent to the upper computer via serial communication for real-time display. This system uses different sensors to replace the collection of two voltage signals, which is suitable for various control circuits and has strong versatility.

1 System hardware design
The data acquisition and processing system is divided into five units: single-chip main control module, A/D conversion module, digital tube display module, keyboard control module and serial communication module. The system composition block diagram is shown in Figure 1.


1.1 A/D conversion module
The analog-to-digital conversion uses the commonly used chip ADC0809, which has an 8-channel multiplexer inside. Since there is only one converter inside, the 8-channel analog signals can only be converted in time-sharing. According to the signal decoded by the latch address line, only one of the 8 analog input signals is selected at a time, and the analog-to-digital conversion is performed based on the principle of successive approximation. The conversion time is 100μs and the conversion accuracy is 8 bits.

[page]


The internal structure of ADC0809 is shown in Figure 2. To start ADC0809 for A/D conversion, first input a 3-bit address signal and make ALE high, store the address in the address latch, and select one of the 8 analog inputs to the comparator after decoding by the decoder; the rising edge of START will gradually approach the register reset, and the falling edge starts the A/D conversion. The EOC output signal becomes low, indicating that the conversion is in progress. Until EOC becomes high, it means that the A/D conversion is over, and the conversion result is stored in the latch. When the OE input is high, the output tri-state gate opens, and the digital quantity of the conversion result is output to the data bus.
1.2 Keyboard and display module
The human-computer interaction of the parameter acquisition and processing system adopts a 2×8 matrix keyboard and a static digital tube display, as shown in Figure 3. In order to save the I/O port line of the single-chip microcomputer, the human-computer interaction adopts two-line control, and the analog switch CD4052 is used to switch and control the data signals of the keyboard and digital tube.

1.3 Serial communication module
Since the microcontroller and PC use different logic levels, when designing the serial interface circuit, it is necessary to consider the level matching, drive capability matching, component selection and other electrical characteristics. PCs usually have two standard RS232 serial ports. In order to improve the anti-interference ability, this interface uses EIA level logic, as shown in Table 1.


In order to achieve level compatibility between the microcontroller and the PC, the microcontroller must go through level conversion when communicating with the PC. Usually, MCl488 and MCl489 chips are used to achieve level conversion, but the circuit structure of these two conversion chips is complex, the power supply requires ±12V power supply, the operation is unstable, and the chip is easy to burn out. This design uses the MAX232 integrated circuit chip, which is only powered by +5V. It has two sets of voltage conversion circuits inside, and the peripheral circuit is equipped with 4 boost capacitors to achieve mutual conversion between EIA level and TTL level. It has the characteristics of simple circuit structure, small number of components, single power supply, low power consumption, etc. The serial interface circuit composed of the MAX232 chip is shown in Figure 4.


The AT89C52 microcontroller has a programmable, full-duplex serial port. During communication, the serial data received and sent can be exchanged through the serial data buffer SUBF of the special function register SFR, so it can be used for multi-machine communication, especially suitable for communication between the terminal and the system host.
1.4 Microcontroller and A/D interface module
The microcontroller uses the AT89C52 microcontroller produced by ATMEL. It is manufactured using advanced technology, has a high-performance MCS51 core design, and has a non-volatile Flash program memory. It is a high-performance, low-power 8-bit CMOS microprocessor chip with a wide range of market applications. It has great advantages in realizing signal acquisition, data processing, serial transmission, real-time control, etc.
This design uses the query method to collect data and reasonably allocates the resources of the microcontroller. Most of the time, the microcontroller is used to run the control program, and only when the acquisition time comes, the microcontroller is used to execute the acquisition program. Figure 5 shows the interface circuit between ADC0809 and the microcontroller. When data needs to be collected, the microcontroller first outputs the address signal to specify the channel for collection, then makes ALE and START high to start A/D conversion, and then the microcontroller handles other matters, and later checks whether EOC is high. If it is high, the conversion is completed. When the conversion result needs to be read, a read command is sent to make OE high to read the conversion result and store it in the specified unit for display on the digital tube and upload to the PC.

[page]

2 System software design
The system software mainly includes: system initialization, key judgment program, AD conversion program, digital tube display program and serial communication program. Figure 6 is the program structure block diagram.


The single chip uses 11.0592MHz crystal oscillator, the timer selects working mode 2, the serial port works in mode 1, and the baud rate is set to 9600. The host PC uses the "Serial Debug Assistant" function in the STC_ISP_V394 development environment to receive serial data and display the acquisition results. Figure 7 is the STC_ISP_V394 data acquisition interface, which shows the real-time acquisition results of the two voltage signals.


MCU serial communication initialization settings:
MOV TMOD, #20H: T1 working mode 2
MOV THl, #0FDH: baud rate 9600
MOV SCON, #40H: serial port working mode 1
SETB TR1: open timer 1
MCU sends data:
MOV SBUF, A: send the received data to the PC
JNBTI, S
CLR TI

3 Conclusion
This paper introduces a method for implementing data acquisition and serial communication interface based on A/D conversion chip ADC0809 and AT89C52 microcontroller. This design is debugged on a self-made development machine. The self-made development machine uses STC89C54 microcontroller with ISP online programming function. Program download and data communication are completed in the STC_ISP_V394 development environment. It has been verified in practice that it has a good effect in short-distance transmission, and no data loss or error occurs during transmission. Data acquisition and serial data transmission are very important in industrial control. This design has general versatility. Readers can improve it according to their actual needs to meet the needs of engineering design.

Reference address:Design of multi-parameter real-time acquisition and processing system controlled by single chip microcomputer

Previous article:Design of dimming controller based on 51 single chip microcomputer
Next article:Design of intelligent management system for nickel-cadmium rechargeable batteries based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号