A design idea of ​​UPS circuit based on farad capacitor

Have you ever encountered a program in use that was lost for no reason? The product debugging is very stable. After the installation to the site, frequent system crashes and data loss, or a batch of storage device damage occurs after one year of product application? This article will delve into the causes of these problems and provide a reference solution.

Nand-Flash/eMMC (Nand-Flash with Flash Controller) as a non-linear macrocell mode memory provides a cost-effective solution for solid-state mass storage implementation. Nand-Flash memory has the advantages of large capacity and fast rewriting speed, and is suitable for storage of large amounts of data. Therefore, it is more and more widely used in various fields such as embedded products, smart phones, and cloud storage databases.

Figure 1 Nand-Flash and eMMC chip

First, the storage device life

The motherboard that uses Nand-Flash has a data loss program, which is an accident that has made countless engineers creepy. Seeing that the program disappeared with the use of the program, can only be anxious and unable to start. An experienced engineer takes a knife and falls into a new material, and the code is continued for half a project cycle. Going back and nowhere to vent is also a big change for manufacturers and brands. It is also affordable to change a few pieces of Nand-Flash, but after all, this is a bottomless pit. It is better to go deeper into the cause of the problem, otherwise it will not be able to make up for the deficit.

In the device data sheet, the block erasing life of Nand-Flash is usually 100,000 times, and the block erase of EMMC is up to 10,000 times. Similarly, EEPROM, SD card, CF card, U disk, Flash hard disk, etc. There is a problem with the write life of the media. When the file system writes data to the underlying memory block of the write data, the data in the block is read out first, and after the erase block is cleaned, the data to be written is written back to the memory together with the previously read block data. Inside, if the file system write balance is not handled well, especially if it is required to record data such as frequent write block operations within 1 minute, it is possible to write the Nand-Flash or EMMC blocks badly.

Second, the storage device loses power and loses data

When the file system writes data to the memory, it is conventional to first read out the data in the block. After the erase block is clean, the data to be written is written back to the memory together with the previously read block data. If the device unexpectedly loses power or even voltage instability during the erase block process or during the write back data, data loss or damage will result. If the missing data is a file system's FAT table, it will cause the file system to crash. This is why the system program is unable to initiate catastrophic consequences.

Third, the system data protection program

In many cases, the product is burned and tested repeatedly before leaving the factory. No matter how toss, there will be no loss of the program. The possible factor is that the test equipment guarantees a stable running power output, so the normal Flash protection mechanism in the system is reliable.

Want to avoid Flash damage compared to the actual use of the user. Strictly follow the product instructions, especially to avoid artificial power loss during flash erase or write. This is a big tab for the use of memory devices. Even for a good device, such non-standard use will greatly shorten its life. Moreover, the power supply system in different environments has various kinds of programs. When the power supply does not meet the power requirement, the program has a low detection threshold for the low power of the power supply. At this time, forcibly starting the system or performing the write operation will further increase the system power consumption fluctuation, and the huge ripple is also Will cause the CPU to misuse the storage.

To solve this problem for the software side:

When debugging the system or in the field, it is recommended to use software reset to avoid the manual reset operation by power failure; if there is power failure, add the printing information such as "system loading completed", "data saving completed" and other instructions. ;

The software adopts the Flash equalization saving algorithm to efficiently adjust the size of the Flash area erased when the data is changed;

The data can be written into the memory or the ferroelectric memory first, and then the data can be moved to the large memory periodically, thereby reducing the number of Nand-Flash and EMMC erasing;

In the program to add or improve the threshold of power supply detection, the program ensures that all chips under the power system can work normally at this threshold.

During the reading and writing process, the bad block table is carefully maintained and updated to avoid the program writing bad blocks. Check the ECC when reading data to ensure that the data is correct.

Consider from a hardware perspective:

Usage avoids sudden power loss during flash erase or write process;

Design and manage the power supply system of the control core to prevent the ripple of the power supply system due to transient changes during startup and operation;

With the power-down detection circuit, when the external power supply is detected, the file system is quickly shut down and the operation of writing data to the file system is stopped.

Add the file system power domain UPS power supply, and even the whole machine power-down battery life;

For users who use small-capacity storage such as EEPROM, it is conceivable to replace it with a ferroelectric non-volatile memory FRAM made of a highly reliable ferroelectric material. FRAM can be read and written as fast as RAM. The data can be stored for 10 years after power down, and its read/write life is up to 10 billion times. It is more reliable than EEPROM and other non-volatile memory systems, with simpler structure and lower power consumption.

Figure 2 Ferroelectric material non-volatile memory

The following is a brief introduction to the design of a UPS circuit based on a Farad capacitor. The main points are as follows:

Due to the individual differences in capacitance, the rate at which the capacitor stores charge is different. There is a problem that the voltage exceeds the withstand voltage due to overcharge. When there are multiple farad capacitors in the circuit, it needs to be equalized;

In order to ensure that the capacitor can be fully charged, the source terminal needs to be charged by a constant current source;

In order to maintain the capacitor voltage stability and reduce the power consumption of the charging circuit, an overvoltage detection circuit needs to be added;

If the power supply system with a voltage higher than the upper limit of the voltage of the farad capacitor is powered off, the Vcc_backup terminal must be implemented after the BOOST boost circuit, and the EN pin is turned off when the system is normal (during charging).

Figure 3 UPS core circuit based on farad capacitor

When the system power is normal, the charging circuit charges the UPS. When the system power is lost, the UPS discharge provides backup power to the system. It is recommended that the UPS can continue to supply the file system with a power supply of no less than 10 seconds after the power is turned off. During the 10 second battery life, the system can report the abnormal power status and keep it in time. Temporary important data, close the file system, ensure system stability, avoid damage to the file system in the event of power loss, affecting the normal startup of the application.

Figure 4 suggests UPS charge and discharge timing

In addition, the power-down condition of the system needs to be realized by the power-down detection circuit. Use a comparator device, pay attention to the power supply using the Output_VCC terminal to ensure that the comparator can still work when the external power is lost. The comparator negative terminal is connected to a reference voltage, and the reference voltage is supplied by a Zener diode. During normal power supply, the comparator output voltage is determined by the feedback terminal's voltage divider; when the power is off, the comparator outputs a low level. At this time, the processor is still not powered down, and the status information can be processed in time. Another power-down detection is available for other functions.

Figure 5 system power failure detection circuit

Fourth, industrial quality is stable and reliable

In the ARM core board, development board, industrial computer and other fields, M6708 core board, M/A335x core board, M/A28x core board, EPC series industrial control board, IoT series wireless motherboard/gateway, DCP series classic industrial computer and other products The core board products have perfect bad block management for Nand-Flash, and add power-down protection for industrial control boards. For example, in the Linux system, the Flash driver is hardened, and the operating system is double-backed; the software and hardware signal tests are performed on the Flash for 100,000 power-down tests.

At the same time, Zhiyuan Electronics is equipped with professional EMC laboratories, safety laboratories, environmental laboratories, etc. to simulate the harsh application conditions. Combined with quality suppliers to ensure that each product discrete device meets EMC industry level 3 standard, has good static resistance, lightning surge resistance, electric transient group pulse resistance, and extremely low EMI conduction disturbance; Industrial grade environmental adaptability from 40 ° C to +85 ° C. Provides effective protection for the reliability, security and stability of Flash from the entire target system.

Figure 6 DCP-1000L product analysis icon

SMD Warehouse Automatic Shelf

Twinkle System Technology Co Ltd , https://www.pickingbylight.com