When the MCU is operating normally, it may suddenly lose power due to various reasons, causing the data stored in the RAM to be lost. In applications such as measurement and control, the microcontroller often collects and processes critical data during operation. After a power failure, this data must be recovered when the system restarts. Therefore, in single-chip systems without a backup power supply, it's essential to store important data in the EEPROM before the system completely loses power. To achieve this, it's common to implement a power-down detection circuit and a data-saving mechanism.
A pull-up capacitor can be used to detect power loss and save data during a power-down event. The circuit is shown below. Here, a 6V power supply (such as a 7806) is used instead of 5V for a specific reason. Diodes in the circuit serve two main purposes: first, they clamp the voltage to around 0.6V, ensuring that most 51-series MCUs operate within their nominal range of 4.5V to 5.5V. Second, they allow one-way charging of the 0.47F capacitor, preventing reverse current flow.
Two 47-ohm resistors are also included in the design. First, they limit the current supplied to the MCU, protecting it from potential damage caused by high currents from the 7805 regulator. This resistor prevents burning out the MCU or the regulator, even in case of a short or polarity reversal. However, the resistor should not be too large—its upper limit is generally 220 ohms, as a higher value could prevent proper programming. Second, these resistors work with capacitors (47µF and 0.01µF) to improve power filtering. Third, they help manage the inrush current from the large 0.47F capacitor, reducing the peak current during power-up.
To fully charge the 0.47F capacitor to 5.5V using a constant current of 5.5A would take about 0.47 seconds. This slow charging rate can cause issues, such as:
1. The 7805 regulator entering self-protection mode due to overcurrent.
2. A 51 MCU with an RC-based reset circuit failing to start up because the power ramp is too slow.
3. ISP programming being unable to communicate properly, as the response time exceeds the typical 500ms window, resulting in "communication failed" errors.
To address this, a power-up acceleration circuit is necessary. A Schottky diode (1N5819), with a low forward voltage of around 0.2V, is used to discharge the capacitor quickly and minimize voltage loss during power-down. This allows more time for the MCU to save data before full power loss.
The 9014 transistor and a diode divider resistor (470 ohms) form a simple comparator that detects power loss and triggers a high-priority interrupt. This circuit acts like a half-comparator (similar to LM393), but with lower power consumption (less than 0.15mA when off).
The 47kΩ resistor and a 1N4148 diode create a clamping circuit that keeps the base voltage at approximately 0.65V. When external power is lost, the transistor turns on, triggering a high-level signal on the MCU’s P3.2 pin, which is weakly pulled up. This activates the power-down interrupt, allowing the MCU to save data before shutdown.
Under normal operation, the emitter voltage remains around 0.6V, keeping the transistor off and the P3.2 pin high. This ensures the power-down interrupt is not triggered unnecessarily.
98inch Multimedia All-in-One PC
Interactive touch panel,Interactive whiteboard for meeting room,Interactive intelligent panel
Jiangsu Qilong Electronic Technology Co., Ltd. , https://www.qilongtouch.com