Multi-channel data acquisition range control system based on 51 single chip microcomputer

Publisher:MindfulYogiLatest update time:2011-10-26 Keywords:C8051F000 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction
In practical applications, controlling the physical parameters (temperature, humidity, displacement, current, voltage, etc.) of the controlled object within a certain range is one of the typical applications of single-chip microcomputers. In many occasions where precise control is required at the macro level, the micro-control process can still be attributed to the control of the range of changes of certain parameters. For example, the changes in current, voltage and temperature of a traditional three-phase asynchronous motor from startup to normal operation; the changes in the water level of a pumping tower; the changes in the stroke of a machine tool tool and the automatic range conversion of a digital meter. The most notable feature of these control processes is that the controlled physical quantity is a range of changes, rather than a precise "point". There are many ways to effectively control the range of changes in physical quantities. This article focuses on the hardware composition and software design method of using the 8-channel high-performance 12-bit ADC data acquisition system and programmable window detector in the C8051F000 single-chip microcomputer to achieve the control of the range of changes in multiple parameters.
2 Introduction to C8051Fxxx series single-chip microcomputers
Cygnal Corporation of the United States is an emerging semiconductor company specializing in the design and manufacture of mixed-signal system-on-chip microcomputers. The C8051Fxxx series is a mixed signal system on chip (System on Chip) based on the CIP-51 core, which is owned by the company and fully compatible with the MCS-51 core and instruction set. The chip integrates commonly used analog components in data acquisition and control systems, and can easily direct internal digital system resources to external I/O ports through digital cross switches. Its features are: up to 25 MIPS execution speed, powerful analog signal processing and resource control functions; 8-channel high-performance 12-bit ADC (maximum conversion rate of 100 kSPS) data acquisition system, two 12-bit precision DACs, two analog comparators and ADC programmable window detectors; 8K~128K bytes of flash/electrically erasable program memory, 256~8 448 bits of RAM; covers typical serial communication interfaces, 22 interrupt sources, 7 reset sources; advanced JTAG non-intrusive online debugging and reliable safety mechanisms such as watchdog and power monitoring. This product brings together many advanced technologies in the field of single-chip microcomputers, making it one of the most powerful 8-bit single-chip microcomputers at present.



3 Hardware circuit composition and principle
The hardware composition of the circuit is shown in Figure 1, which is divided into three parts: data acquisition, key control and display output. The 8-channel analog acquisition channel of the C8051Fxxx series can complete the data acquisition of multiple parameters of the target system under test by selecting sensors or power conversion devices with different functions (such as current, voltage transformers, integrated temperature sensors, etc.). When working, the system continuously compares the data collected from each channel with the upper and lower limit values ​​set by the user in advance. The system actuator determines whether it exceeds the limit and makes corresponding operations based on the comparison results. The system is a 5-bit LED display. The lower 4 bits are used to display the analog signal size or upper and lower limit setting data of the channel selected by the user. The highest bit LED4 is the channel digital (0~7) display bit. P0.0~P0.7 are the over-limit processing outputs of each channel, which control the corresponding actuators respectively.
3.1 Key control function
This is the most complex part of the entire system, but it also best reflects the design concept. In order to conveniently select channels and display setting data, complete as many functions as possible with as few buttons as possible, and realize the organic combination of better human-machine interface and software and hardware resources, the "switch" key S1 for selecting channels, the "set" key S5 for setting the upper and lower limits of the ADC window detector, and the "+" and "-" keys S3 and S4 for changing the LED display data are set here, and it is required that each time it is pressed, the display value will increase (minus) 1. If the key is pressed continuously for more than a certain time (such as 2s), the display value will increase or decrease rapidly. After the user completes the setting, press the "save" key S2 to save the set data in the non-volatile data storage FLASH to avoid the need to reset the data due to power failure. The self-backup and protection of data is completed through software design, and there is no need to install a backup battery, which simplifies the hardware structure.
3.2 ADC working mode and window detector
The C8051F000 chip ADC subsystem integrates a multi-channel analog input selector (AMUX), a programmable gain amplifier (PGA) and a 100 kSPS, 12-bit resolution successive approximation ADC, as well as a track-and-hold circuit and a programmable window detector, which are completely controlled by CIP-51 through special function registers. ADC0CN register
: controls the conversion start mode and the result data storage mode, sets the ADC conversion end and window detector interrupt flags, etc. A/D conversion allows software events, hardware signals to trigger conversion or continuous conversion. After each conversion is completed, an interrupt is generated, or software query is used to determine whether the conversion is completed. After completion, the data word is locked in the specified register.
AMXOSL, AMXOCF register: ADC channel selection. When AMXOCF = 00H, AMXOSL from 00H to 07H respectively indicates the selection of eight analog input channels AIN0 to AIN7.
ADC0GTH, ADC0GTL registers: These two storage units are 12-bit data registers for the upper limit of the ADC programmable window detector set by the user. ADC0GTH is the high 4 bits, and ADC0GTL is the low 8 bits.
ADC0LTH, ADC0LTL registers: 12-bit data registers for the lower limit of the ADC programmable window detector set by the user.
4 Software Design
In order to facilitate future upgrades and maintenance, the software design adopts building block modular processing, and each functional module is both interconnected and self-contained. Its basic design idea is: using the overflow of the timer/counter T3 to start the ADC conversion and window comparator interrupt regularly. Through interrupt processing, the 12-bit conversion data of the corresponding channel is compared with the upper and lower limit extremes set by the user as the limit crossing condition, and a new interrupt output is generated to drive the system actuator to make corresponding adjustments, so as to achieve the purpose of controlling the data within a certain range.
The main program consists of software function modules such as initialization, display, timing comparison, and key processing. Figure 2 is a flowchart of the main program. Figure 3 is an interrupt processing subroutine. Only the main program list is given here, and all called subroutines are omitted.








LOOP0: ACALLWORK0; call the channel "switch" key processing subroutine. Allow users to select channels and display their upper and lower limit values
​​ACALL WORK1; call the "storage" key processing subroutine to save the user's setting value
in the FLASH of the unit after 8000H
ACALL WORK2; call the "+" key processing subroutine to realize the display data increment, with continuous addition function, convenient and fast adjustment
ACALL WORK3; call the "-" key processing subroutine to adjust the display data decrementally, with continuous subtraction function, convenient and fast adjustment
ACALLWORK4; call the "set" key processing subroutine. The user enters the extreme value setting state to realize the conversion of the upper and lower limit extreme value display ACALLDISP; call the display subroutine SJMPLOOP0
5 Conclusion
Since the C8051Fxxx series of microcontrollers were launched in 2000, their powerful internal functions and rich on-chip resources have enabled them to realize the detection of multi-channel data ranges with the simplest hardware structure. The control system designed in this paper can be conveniently used in various power substations to perform range control on three-phase current, voltage, etc. as long as it is equipped with appropriate power sensors to ensure the safe operation of the power grid, and has good promotion and application value.

References

1 Li Gang, Lin Ling. High-performance, high-speed single-chip microcomputer compatible with 8051 - C8051Fxxx. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002 2 Xiao Dingbai. Application of LHB type AC transformer in household appliances. Electronic Technology, 1996 (12): 42
3 Gong Chenglong. Design of intelligent asynchronous motor integrated protector. Single-chip microcomputer and embedded system application, 2002 (2): 63-65
4 He Limin. Selection of single-chip microcomputer application technology. Beijing: Beijing University of Aeronautics and Astronautics Press, 1997
5 Pan Zhuojin, Shi Guojun. Principle and application of C8051Fxxx high-speed SOC single-chip microcomputer. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002
6 Li Hua, et al. Practical interface technology of MCS-51 series single-chip microcomputer. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002

Keywords:C8051F000 Reference address:Multi-channel data acquisition range control system based on 51 single chip microcomputer

Previous article:Design of Micro Electronic Piano Using Single Chip Microcomputer
Next article:8253 interrupt service program flow chart

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号