Design of Hydraulic Integrated Acquisition System Based on C8051F020

Publisher:美丽的1号Latest update time:2011-02-28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: In order to conduct online detection of parameters such as speed, pressure, flow, etc. in hydraulic equipment, we designed a comprehensive acquisition system for hydraulic engineering. This system uses the new single-chip microcomputer C8051F020 for multi-channel data acquisition and A/D conversion, and outputs it to a large-screen LCD color liquid crystal for data, curves, histograms, etc.; at the same time, the data is sent to the host computer through RS-485 communication, thereby realizing remote real-time monitoring of hydraulic equipment.
Keywords : C8051F020, multi-channel, LCD display, serial communication

1. Introduction

In industrial control, it is necessary to collect various parameters, that is, to use the signal acquisition system to collect various data into the computer for real-time processing. The sensor plays the role of an intermediate bridge, but the signal it outputs is often a very weak current signal, which needs to be amplified and converted into a voltage signal before it can be input into the A/D for data acquisition. In addition, with the continuous development of testing technology, in order to adapt to the requirements of digitalization and high efficiency, the application of single-chip microcomputers in industrial testing systems is becoming more and more extensive. It has the advantages of real-time and high reliability, and is increasingly showing great superiority. This system uses the C8051F020 single-chip microcomputer of Cygnal Company in the United States as the control core, forming a multi-channel data comprehensive acquisition system, which uses fewer peripheral devices to realize the control of hydraulic equipment.

2. Introduction to C8051F020 MCU

The C8051F020 device is a fully integrated mixed-signal system-level MCU chip (SOC). It uses Cygnal's patented CIP-51 microcontroller core, which is fully compatible with the MCS-51 instruction set. It uses a pipeline structure, which greatly improves the instruction execution speed compared to the standard 8051 structure. CIP-51 provides 22 interrupt sources, allowing a large number of analog and digital peripherals to interrupt the microcontroller, thus having higher execution efficiency. It has 64 I/O pins, and each port can be configured as a push-pull or open-drain output. The C8051F020 MCU has an SMBUS/I²C interface, two full-duplex UARTs with enhanced baud rate configuration, and an enhanced SPI interface. Each serial bus is fully implemented in hardware and can generate interrupts to the CIP-51. It has a 12-bit ADC0 inside, which includes a 9-channel programmable analog multiplexer (AMUX0), a programmable gain amplifier (PGA0) and a 100ksps, 12-bit resolution successive approximation register ADC, which integrates a tracking and holding circuit and a programmable window detector; an 8-bit ADC1, including an 8-channel configurable analog multiplexer (AMUX1), a programmable gain amplifier (PGA1) and a 500ksps, 8-bit resolution successive approximation register ADC. Two 12-bit DAC converters, each DAC has a flexible output update mechanism, allowing seamless full-scale changes and supporting jitter-free output updates. The C8051F020 also has 5 general-purpose 16-bit timers and a programmable counter/timer array of 5 capture/compare modules.

3. System hardware structure

The multi-channel integrated acquisition system is based on the C8051F020 single-chip microcomputer and is mainly composed of the following parts: data acquisition, LCD display and data communication. Its hardware block diagram is shown in Figure 1. The current signal output by the sensor is amplified and converted, and then sent to the A/D converter inside the C8051F020. The analog-to-digital conversion, data storage and data processing are completed inside the single-chip microcomputer, and finally sent to the LCD display. At the same time, it is sent to the computer through the RS-485 interface and monitored in real time by the host computer.

Figure 1

3.1 Data Collection

For the 8 parameters to be tested in the hydraulic equipment, the corresponding sensors are selected for detection. During the test, the strain sensor is selected as the tool for the test site. The output of these selected detection elements is a standard 4-20mA weak current signal, which is converted into a 0-5V voltage signal through the amplification conversion circuit composed of LM324 and input into the analog input terminal of C8051F020, as shown in Figure 2, and converted into the corresponding digital quantity through the internal integrated A/D converter. C8051F020 stores the 8-way sampling values ​​as the status of the hydraulic equipment site in the corresponding memory unit.

Figure 2

3.2 LCD Display

In order to make the data acquisition system compact and beautiful, and at the same time obtain a high cost performance, the DMF-50174 blue screen LCD produced by Depic is selected. The display is a 320×240 dot matrix LCD, which can display both graphics and text. The display driver control chip adopts a high-performance LCD controller SED1335 from EPSON. The hardware circuit adopts an indirect connection method, as shown in Figure 3. The P5.0~P5.7 port of the microcontroller is used as the input channel of the DB0~DB7 data bus of SED1335. P4.5 is used as the chip select signal of SED1335, and with the address signal A0, SED1335 receives instructions and data from the microcontroller through the data bus. When A0=0, P4.6 (WR)=0, P4.7 (RD)=1, the writing of instructions and the reading of data from SED1335 are realized. When A 0 = 1, P4.6 (WR) = 0, P4.7 (RD) = 1, it is the writing of display data. This function is realized by software.

Figure 3

3.3 Data Communication

TX0, RX0 and P0.2 of the single-chip microcomputer C8051F020 are connected to the host computer through MAX485 for serial communication, as shown in Figure 3. P0.2 controls the state or transmission of MAX485 and is controlled by software. RX0 is the serial input terminal of the single-chip microcomputer, which receives the data sent by the host computer to the single-chip microcomputer through MAX485. TX0 is the serial output terminal of the single-chip microcomputer, which is sent to the host computer through MAX485.

4 System Software Design

4.1 The software design generally consists of two parts: one is the microcontroller C8051F020

The main program design, part of which is the LCD display program design.

It can reduce the complexity of the program and improve the readability and modifiability of the program.

The software is programmed with C51 and compiled with the Keil µVision2 compiler.

The main program flow chart is shown in Figure 4.

4.11 Main Program

void main (void) {

long voltage; //voltage in mV

int i; //loop counter

WDTCN=0xde; //Disable watchdog timer

WDTCN=0xad;

SYSCLK_Init(); //Initialize the oscillator

PORT_Init(); //Initialize the data crossbar switch

UART0_Init(); //Initialize UART0

Timer3_Init(SYSCLK/SAMPLERATE0); //Initialize timer 3 overflow as sampling rate

ADC0_Init(); //Initialize ADC

AD0EN=1; //Enable ADC

EA=1; //Enable all interrupts

while(1){

for(i=0;i<8;i++)

{EA=0;

voltage=result[i]; //Get ADC value from global variable

EA=1;

voltage = voltage*VREF0; //Calculate voltage (mV)

voltage = voltage>>16;

LCD_Disp(); //Adjust the display program to display the voltage value

printf("Channl'%d' voltage is %ldmVn",i,voltage);//Serial port output

}}

5 Conclusion

In the test experiment, the sampling frequency of C8051F020 is defined as 50000Hz, ADC0 is set to the continuous conversion mode of timer 3 overflow, and the differential input method is used to form 8 conversion channels. After the microcontroller is running, data collection is performed by timer interrupt.

C8051F020 transmits the collected data to the host computer through the RS-485 interface. During the transmission, the baud rate must be consistent with the baud rate set by the PC, otherwise it cannot be received correctly. During the measurement process, the entire system works stably and the data can be displayed in "quasi" real time.

The innovation of the author of this article is that it can display the power P in the hydraulic system parameters in real time. In the past, hydraulic display devices could only display the pressure p and flow q of the liquid separately, and then use the formula P=pq to calculate the hydraulic power, which is rather troublesome. Moreover, the C8051F020 chip integrates a large number of peripherals and IO port resources. When designing the system, only a small number of peripheral chips are needed to complete the required functions, which simplifies the hardware circuit design, saves circuit board space, and reduces the size of the product. Therefore, this system has a broad application prospect.

References:

1. C8051F020/1/2/3 Mixed Signal ISP FLASH Microcontroller Data Sheet

2. Bao Kejin, Principle and Application of C8051F Single Chip Microcomputer, Beijing, China Electric Power Press, 2006.1

3. Tong Changfei, C8051F Series MCU Development and C Language Programming, Beijing, Beijing University of Aeronautics and Astronautics Press, 2005.1

4. Song Wei, Realization of Intelligent Temperature Measurement System Based on SMBus of C8051F, Microcomputer Information, Issue 12-2, 2005, Pages: P44-46

5. Yuan Tianyou, Multi-channel Signal Asynchronous Acquisition Technology Based on Single Chip Microcomputer, Microcomputer Information, Issue 4-2, 2006, Pages: P44-45

Keywords: C8051F020 multi-channel LCD display serial communication
Reference address:Design of Hydraulic Integrated Acquisition System Based on C8051F020

Previous article:Design of SD card main controller based on C8051F020
Next article:Zero-point correction technology of infrared axle temperature detector based on C8051F 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号