DC Power Supply Monitoring System Based on C8051F021

Publisher:NatureLoverLatest update time:2010-12-26 Source: 仪表技术Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction to 1c8051f021 MCU

1.1cip-51 kernel

C8051F021 uses Cygnal's patented CIP-51 core and is fully compatible with the MCS-51 instruction system. It uses a pipeline structure to greatly improve the speed of instruction execution, with a maximum speed of 25 MIPS. In addition, it also provides 22 interrupt sources, an independently working clock generator on the chip, a power monitor, a watchdog and other devices to increase the functions of the SoC chip.

1.2 Memory

The C8051F021 has 64K bytes of in-system programmable flash program memory, with addresses from 0x0000 to 0xffff. It has 256 bytes of internal data RAM, of which the upper 128 bytes are divided into two address spaces, one for the RAM area and the other for the special function register area. The two areas are distinguished by different addressing modes (RAM uses indirect addressing, and the special function register area uses direct addressing). The lower 128 bytes of data RAM can be addressed both directly and indirectly. The C8051F021 also has a 4K byte RAM block located in the external data memory address space. It also provides a 64K byte external data memory interface for accessing off-chip memory and memory-mapped I/O devices.

1.3 Analog Channel

The C8051F021 integrates a powerful ADC subsystem, which includes a 9-channel analog multiplexer, a programmable gain amplifier and a 100ksps 12-bit resolution successive approximation A/D converter, with a built-in 1.2V, 15ppm/℃ voltage reference. The subsystem also integrates a track-and-hold circuit and a programmable window detector. The gain of the programmable gain amplifier is divided into 6 levels, with a maximum gain of 16, which can be implemented by software programming. In the analog channel, the first 8 channels are used to measure the external analog signal, and the ninth channel is connected to the internal temperature sensor to measure the chip temperature. Through software programming, the external input can be set to single-ended input mode or differential input mode. The programmable window detector can automatically and continuously compare the A/D conversion result with the limit value set by the user programming, and immediately notify the controller if the limit is exceeded.

The C8051F021 has two 12-bit voltage output DACs, and the output of each DAC is 0V~Vref1LSB.

1.4 Digital Channel

The C8051F021 has four 8-bit I/O ports, and the pins of each port can be configured by the program as push-pull or open-drain output. In addition, a digital crossbar switch, that is, a digital switch network, is introduced. Through this network, internal digital system resources can be allocated to the I/O pins of ports P0, P1, and P2. Users can control the switch network through software programming, and can configure the on-chip counter/timer, serial bus, hardware interrupt, A/D input terminal, etc. to appear on the required port, thus enabling users to choose a combination of general ports and required digital resources according to their needs. The C8051F021 has an on-chip JTAG interface and logic.

1.5 Serial communication devices

The C8051F021 has two full-duplex asynchronous serial ports, UART0 and UART1. In addition to the functions of standard serial ports, they also have frame error detection and address recognition hardware. There is also a serial interface SMBus that fully complies with the system management bus standard and a serial peripheral interface SPI. These serial buses are fully implemented in hardware and can generate interrupts. They do not share timers, interrupts, or I/O ports, so all serial ports can be used at the same time.

2 DC high frequency switching power supply system

2.1 Functions and Features

(1) Intelligent management of batteries, strictly operating according to the battery charging curve, and automatically completing the equalization and floating charging and switching of batteries. (2) Monitor the operating status of the entire system by measuring system parameters such as voltage, current, and temperature in real time. (3) A large-screen LCD display is used to display system parameters, fault status and other information; system parameters can also be set and modified through the keyboard, and system operations can be performed. (4) The system adopts a dual microcomputer monitoring module structure, with the main monitoring module in operation mode and the auxiliary monitoring module in hot standby operation mode to improve the safety performance of the system. (5) The microcomputer monitoring module has an RS485 serial communication interface, which is convenient for communication with RTU or integrated automation system to realize functions such as "telemetry" and "telecommunication". (6) The response speed to the output current is extremely high, which enhances the load adaptability of the system.

2.2 System Structure

The principle block diagram of the intelligent DC high-frequency switching power supply system is shown in Figure 1. The three-phase AC power supply is input to the switching power supply rectifier module, and the rectifier module outputs a 220V DC voltage; this voltage is connected in parallel with the battery pack to provide the closing bus voltage; the closing bus voltage is adjusted by the voltage regulator module and then outputs the control bus voltage. The switching power supply rectifier module uses high-frequency switching power supply technology to achieve AC-DC conversion, and its output voltage can be controlled externally, that is, it is a rectifier module whose output voltage can be adjusted at any time, which makes it easy to use a microcomputer to control the size of its output voltage. The purpose of the intelligent system is to make the DC bus voltage in the DC system meet the requirements of the system at all times, and to automatically detect and issue an alarm signal for the system fault to ensure the reliability of the system. The control core of the system is the microcomputer monitoring module, which monitors the analog signals such as the AC input voltage, each DC bus voltage, the charger current, the battery current and the battery temperature in real time, and judges the system status according to the set value of the system parameters, and performs necessary operations and adjustments. Such as switching and control between equalization and floating charge of the battery, adjustment of the output voltage of the rectifier module, display of system data, display of fault status and alarm, etc. After the battery monitoring module completes the measurement of the terminal voltage of all single batteries in the battery pack, it transmits the measurement data to the microcomputer monitoring module through the RS485 serial interface.

DC Power Supply Monitoring System Based on C8051F021

DC Power Supply Monitoring System Based on C8051F021

3. Microcomputer monitoring module

3.1 Microcomputer monitoring module function

(1) System monitoring. (2) System control and protection. (3) Intelligent battery management. (4) System communication.

3.2 Working principle of monitoring module

Figure 2 is the principle block diagram of the microcomputer monitoring module. The input analog signal and the output voltage-regulated analog signal are measured by C8051F021. The input signals are distinguished and processed separately according to whether the measured signal needs to be isolated. The AC voltage signal is taken from the AC voltage transformer, the DC current is taken from the Hall current transformer, and the integrated temperature sensor AD590 is used for temperature measurement. The above signals do not need to be isolated when measured. They can enter the A/D channel of C8051F021 after appropriate amplification. The DC bus voltage is measured by resistor sampling. Since the measured signal is electrically connected to the DC system, the measured signal must be isolated to ensure the accuracy and safety of the measurement system. In this module, these channels are isolated by high-precision linear optocouplers, and the isolated signals are then amplified and enter the A/D channel. The output voltage-regulated signal is realized by the D/A converter in C8051F021. The D/A output signal drives the voltage-regulating module after power amplification to adjust the DC bus voltage. In addition to the measurement and control functions of the above analog signals, the single-chip microcomputer also accepts switch signal inputs such as module faults and fan status, and these signals are responded to through interrupts. The single-chip microcomputer makes judgments based on the various signals measured and the set values ​​of system parameters, and gives corresponding control signal outputs, including outputting voltage regulation signals through d/a and controlling the relay to output corresponding switch signals after driving. In addition, the single-chip microcomputer is also responsible for managing the large-screen LCD display, which displays Chinese in a drop-down menu, and displays submenus such as the main menu, measurement data, system settings, and system alarms; it is responsible for managing the keyboard, responding to system operations and setting and modifying system parameters. This monitoring module uses the two asynchronous serial ports of c8051f021 to complete the communication with the host computer and the communication with the lower computer that monitors the battery.

3.3 Switching between primary and secondary monitoring

The functions of the microcomputer auxiliary monitoring module are basically the same as those of the main monitoring module. In terms of hardware configuration, except that the display uses LED digital tube instead of large-screen LCD, it is basically the same as the main monitoring module.

The settings of all system parameters of the sub-monitor are the same as those of the main monitor. During normal operation, the sub-monitor is in a non-working state, and its display screen shows the standby state. However, it monitors all analog signals of the system in real time and determines the working status of the system. The difference from the main monitor is that it does not display any measurement results and status, and does not participate in the control of the system. At this time, the main monitor is responsible for controlling the system, while the switching of system control rights is controlled by the sub-monitor. When the DC bus voltage exceeds the limit and the limit time exceeds the specified range and still cannot return to normal, the sub-monitor will take over the control of the system and implement the control of the system, and at the same time send out the main monitor abnormal signal. After the main monitor returns to normal, the human control will switch the monitoring rights to the main monitor. 3.4 Software design of monitoring module

The software design of the monitoring module adopts assembly language. When designing, a concise main program is first implemented, and then all the functions to be completed are compiled into corresponding task modules on this basis. According to the characteristics of each module, it is either uniformly scheduled by the system or executed after responding to an interrupt.

The main software modules are:

(1) System self-tuning module: Its function is to complete the automatic tuning of the system, including self-testing, self-diagnosis of the whole hardware equipment, setting of relay status, etc.

(2) Data acquisition and processing module: The main function is to complete the sampling of analog signals such as AC and DC current, voltage signals, and temperature and calculate their corresponding values.

(3) Calculation and adjustment module: Based on the collected analog signal and the input switch quantity, determine whether voltage regulation is required, the adjustment direction and its step value through calculation and analysis. Output control adjustment signal to control the voltage regulation module to adjust the output voltage. According to the analysis results, output the corresponding switch quantity.

(4) Keyboard processing module and display module: The keyboard processing module completes the key recognition function and calls the corresponding key function function for processing after confirming the valid key. The display module is responsible for managing the display of the main menu and various submenus, and displays the contents in the display buffer as required.

(5) Communication module: Complete the asynchronous serial port interface management function. Serial port 1 is responsible for receiving control commands from the host computer and sending data and status to the host computer. Serial port 2 is responsible for managing and receiving measurement data from the lower computer that measures the battery.

4 Conclusion

The microcomputer monitoring module in the intelligent DC high-frequency switching power supply system introduced in this paper adopts the single-chip microcomputer C8051F021, which makes full use of the powerful analog and digital resources of the system on chip, simplifies the hardware circuit, improves the reliability of the system, and also improves the performance-price ratio of the monitoring module. The system adopts the redundant design of the main and auxiliary monitoring modules to ensure the reliability of the system. The system has been proven to be reasonably designed, strong in anti-interference ability, and reliable in operation through actual use.

Keywords:MCU Reference address:DC Power Supply Monitoring System Based on C8051F021

Previous article:Design of OLED control circuit based on C8051F
Next article:Support for Dual Data Pointers and Code Generation in Keil C51

Recommended ReadingLatest update time:2024-11-16 16:37

Temperature Recording System Based on Single Chip Microcomputer
At present, thermocouples or thermistors are generally used as sensors for temperature detection. A dedicated temperature compensation wire is usually used between this sensor and the instrument. The price of the temperature compensation wire is very high, and the line is too long, which will affect the measurement acc
[Microcontroller]
Temperature Recording System Based on Single Chip Microcomputer
51 MCU drives ADC0809 on-chip RAM to store conversion results assembly program
;Input: analog quantity of channel 1,  ;Export: A data area is opened in the on-chip RAM to store the A/D conversion results. Results from IN0 to IN7 ; Stored in 8 units from 30H to 37H AD0809: MOV R1,#01H ACALL AD0809_1 RET AD0809_1:MOV DPTR,#; channel address MOV A,R1 ; send channel number MOVX @DPTR,A;
[Microcontroller]
Engineers' Practice: How to Create a Bare Metal Program Framework for MCUs
Preface Not long ago, a friend of mine who was a tester switched to a development job. He encountered a question in the interview, and he didn't understand it, so he called me to ask. The question was roughly: When developing a bare-metal microcontroller, the microcontroller has to handle multiple tasks. What is your
[Microcontroller]
Engineers' Practice: How to Create a Bare Metal Program Framework for MCUs
51 Single Chip Microcomputer--Memorize the knowledge related to stepper motor
 The LCD1602 programming I talked about last time was quite complicated. This time I will talk about a simpler one: the stepper motor. Here we will not talk about the "subdivision" experiment of stepper motors, but only talk about the basic concepts of stepper motors and the three working modes of stepper motors - s
[Microcontroller]
51 Single Chip Microcomputer--Memorize the knowledge related to stepper motor
[MCU framework][drivers layer][g_sensor][adxl34x] Use of acceleration sensor
The ADXL345 is a low power, 3-axis MEMS accelerometer module with I2C and SPI interfaces. The Adafruit Breakout board for these modules has onboard 3.3v voltage regulation and level shifting, making it easy to interface with 5v microcontrollers such as the Arduino. The ADXL345 has 4 sensitivity ranges, from +/- 2G
[Microcontroller]
[MCU framework][drivers layer][g_sensor][adxl34x] Use of acceleration sensor
How to design a self-tuning PID controller using an AVR microcontroller
This paper introduces the design of self-tuning PID controller based on AVR microcontroller. The controller takes FESTO water level as the control object, and the control core is ATmega128 microcontroller. It adopts relay self-tuning PID algorithm, and uses LED digital tube to display the control situation in real tim
[Microcontroller]
How to design a self-tuning PID controller using an AVR microcontroller
Design of mobile power supply based on MC32P21 microcontroller
  A mobile power bank is a portable charger that integrates power supply and charging functions. It can charge or power standby for digital devices such as mobile phones anytime and anywhere. It usually uses lithium batteries or dry batteries as power storage units. Different from the battery configured inside the pro
[Microcontroller]
Design of mobile power supply based on MC32P21 microcontroller
The minimum circuit that makes the microcontroller work
Take 80C51 as an example First of all, when we use protel and proteus software to draw circuit diagrams, you will find that the original 40-pin chip has become 38 pins. That's because it hides the 40th and 20th pins VCC and GND, so if the microcontroller starts working, it needs at least one VCC (power supply) and G
[Microcontroller]
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号