1 Problem Statement
In intelligent instruments and process control systems with single-chip microcomputers as the core, it is often necessary to save real-time parameters for a long time. Usually, E2PROM, FLASH MEMORY and non-volatile chips with built-in batteries based on random access memory can be used to achieve this. E2PROM and FLASH MEMORY are ROM devices that can be modified online. They solve the problem of saving real-time parameters in the application system when power is off. However, these chips have a slow writing speed (ms level) and a limited number of erase and write times (million times). Although some devices have erase and write times of millions, for some application systems, their write times are still limited. Therefore, these chips can only be used in systems with a small amount of data to be protected and infrequent writing. For systems that require large-capacity, high-speed, and repeated access to real-time parameters, they can only be implemented with random access memory RAM plus a power-off protection circuit. There are many power-off protection methods to achieve the above principle. Some manufacturers have even developed self-power-off protection chips based on RAM with built-in batteries. Single-chip microcomputer systems composed of such independent power-off protection chips or circuits sometimes experience unstable working in actual applications. After analysis, it is found that if the change of system power causes RAM to be in protection state first, and the system has not been reset, and the microcontroller is still working normally, then the phenomenon of being unable to write and read will occur, causing system failure. For the problem that the reset level of the microcontroller is inconsistent with the power-off protection level, which affects the reliability of the system, this paper proposes a solution to link the reset of the microcontroller with the power-off protection by using a microprocessor monitoring circuit. The RAM is in protection state when the microcontroller is reset, and can be accessed normally during operation, thus effectively solving the above-mentioned problem.
The process of a single-chip microcomputer automatically completing the task assigned to it is also the process of the single-chip microcomputer executing the program, that is, the process of executing instructions one by one. The so-called instructions are written down in the form of commands for various operations required to be performed by the single-chip microcomputer. This is determined by the instruction system assigned to it by the designer. One instruction corresponds to a basic operation; all the instructions that can be executed by the single-chip microcomputer are the instruction system of the single-chip microcomputer. Different types of single-chip microcomputers have different instruction systems. In order for the single-chip microcomputer to automatically complete a specific task, the problem to be solved must be compiled into a series of instructions (these instructions must be instructions that the selected single-chip microcomputer can recognize and execute). This series of instructions is called a program, and the program needs to be stored in advance in a component with storage function-the memory. The memory is composed of many storage units (the smallest storage unit), just like a big building is composed of many rooms. Instructions are stored in these units, and the instructions in the units are taken out and executed. Just like each room in a big building is assigned a unique room number, each storage unit must also be assigned a unique address number, which is called the address of the storage unit. In this way, as long as the address of the storage unit is known, the storage unit can be found, and the instructions stored in it can be taken out and then executed.
2 MAX791[1]Chip Introduction
MAX791 is a high-performance microprocessor power monitoring circuit produced by MAXIM. It has the same performance as AMD791 of AMDA and can be interchanged. Functions include microprocessor reset, backup battery switching, watchdog circuit, CMOS-RAM write protection and power failure alarm, etc. The logic block diagram is shown in Figure 2-1 [1]. In the figure, VCC and VOUT are power input and output respectively, VBATT is battery input, low power output, and are RAM chip enable input and output, reset output, manual reset input, and low will force RESET to be effective. SWT, WDI, , are watchdog timing setting, trigger input, timeout output and timeout pulse respectively. PFI and are power failure input and output respectively. When PFI is lower than 1.25 V, becomes low. The reset timing of MAX791 is shown in Figure 2-2 [1].
[page]
3 Power-off protection circuit design
3.1 Hardware Design
Figure 3-1 shows a schematic diagram of an MCS-51 [2], [3] single-chip microcomputer application system with power-off protection. 76C88 is a CMOS RAM chip with a capacity of 8K×8. It has two chip select terminals and CS2. The chip is selected only when is low and CS2 is high. Therefore, CS2 is connected to the output terminal of MAX791, and at the same time, the write enable signal is indirectly introduced from the of MCS-51 through the enable control input terminal and output terminal of MAX791 , ensuring that it cannot be read or written during the system reset, effectively protecting the data in 76C88. Combined with Figure 2-2 MAX791 reset timing, the working principle of the circuit in Figure 3-1 is analyzed as follows.
Power-on process: When VCC rises from 0V to the reset threshold of 1.65V, the output will still maintain the valid level for 200ms to ensure the effective reset of the system after the power supply voltage is normal.
During the effective period, CS2 of 76C88 is at a low level, that is, the chip select signal is invalid, ensuring that the data in the chip is not rewritten during the power-on process. When VCC is greater than VBATT, VOUT automatically switches to VCC, and 76C88 is powered by VCC.
RAM (Random Access Memory) RAM - random access memory. The contents of a storage unit can be taken out or stored at will as needed, and the access speed is independent of the location of the storage unit. This type of memory will lose its storage content when the power is off, so it is mainly used to store programs that are used for a short time. According to the different storage information, random access memory is divided into static random access memory (Static RAM, SRAM) and dynamic random access memory (Dynamic RAM, DRAM).
Normal operation: In this state, CS2 is high level, and the microcontroller can read and write to 76C88 through the enable circuit copy of MAX791 . In order to prevent the program from running away and improve the reliability of the system, a watchdog trigger instruction is inserted in the program. When the program runs away for more than 1.6 s and cannot trigger the watchdog, it outputs a low level and resets the system through MR.
Power-off process: When VCC drops from the normal voltage to the reset threshold of 4.65V, it is immediately effective, CS2 becomes low, and 76C88 enters the protection state to ensure that the data in the chip is not rewritten during the power-off process. When VCC is less than VBATT, VOUT automatically switches to VBATT, and 76C88 is powered by the backup battery. For most application systems, the program can meet the requirements by starting from the beginning after power-on reset. The power alarm function of MAX791 can easily achieve this goal: Analyze Figure 2-2, when VCC drops to 4.65V+150mV, a negative jump occurs, and an interrupt request is sent to the microcontroller. Due to the energy storage effect, VCC drops from 4.8V to 4.65V for several milliseconds, which is enough for the microcontroller to execute hundreds or even thousands of instructions. Use this time to protect the breakpoints and real-time parameters in the interrupt service program. After the power is restored, the program will enter the breakpoint and continue to execute.
3.2 Software Design
The software of the single-chip microcomputer system shown in Figure 3-1 can be divided into two parts: the main program and the power alarm interrupt service program. Instructions must be inserted in the main program to frequently trigger WDI, and the interval time cannot exceed 1.6s. The alarm interrupt must be set as a non-maskable interrupt . If there is no interrupt, it can be set as the only high-level interrupt to replace it . The program flow chart is shown in Figure 3-2.
4 Conclusion
Linking reset with power-off protection can effectively solve the system instability caused by the incoordination between power-off protection and reset, and improve the reliability of power-off protection circuit and single-chip microcomputer application system. The single-chip microcomputer power-off protection system composed of MAX791 microprocessor monitoring circuit has very ideal application effect in industrial fields such as power and petrochemical.
Previous article:Design of intelligent charger for lead-acid batteries based on single chip microcomputer
Next article:Smart Home Telephone Remote Control System Based on HT46RU232 MCU
- Popular Resources
- Popular amplifiers
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
- Main and auxiliary power switching circuit
- Please explain the circuit structure of the electric piano keyboard and the possible types of diodes used.
- MOS Specifications
- MSP430 high version software download low version program
- Milliohm meter-expansion board design based on [EVAL-ADICUP360]
- Xunwei-i.MX6ULL Development Board-Network Test Method (Part 2)
- esp8266 uses oled to play online videos
- Security monitoring multi-channel long-distance transmission problem
- Why does LDMOS conduct without adding gate voltage?
- EEWORLD University Hall----Live Replay: NXP's facial recognition technology solution based on i.MX RT106F