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.
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.
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
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- 【GD32L233C-START Review】17. Completed work: Indoor environment monitoring equipment
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] Part 3: Lightble Control OLED Display
- Car sunlight sensor, urgent help
- Communication Principles_matlab.pdf
- Fundamentals of Spectrum Analysis
- Linux/UNIX System Programming Manual (Volumes 1 and 2)
- [ESK32-360 Review] + Serial communication and applications
- EEWORLD University Hall----Live Replay: TI's new generation of low-power Bluetooth microcontrollers helps you reduce application costs
- [Hua Diao Experience] 05 Building a development environment for Xingkong board: SSH connection and Jupyter programming
- What birthday gift should I give to my mother?