SD card power-off protection circuit
By designing the SD card power-off protection circuit, using a microcontroller, a power-off detection circuit and a capacitor power supply circuit, the SD card data is protected when the system is powered off, solving the problem of data loss caused by power off during the writing and erasing process of SD card, and realizing the safe storage of data.
Patent Information
- Application Number
- CN202421377515.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2034-06-17
AI Technical Summary
When the SD card is powered off during writing and erasing, it cannot effectively protect data, resulting in data loss.
A SD card power-off protection circuit is designed, and the connection between the microcontroller and the SD card control chip is used to use the power-off detection circuit and the capacitor power supply circuit to notify the SD card to stop writing and erase when the system is powered off, and data storage is started, and powered by a supercapacitor to the microcontroller, the SD card control chip and the SD card holder.
When the system is powered off, it can ensure that the SD card stops writing and erasing, starts data storage, avoids data loss, and ensures the smooth progress of the data storage process through capacitors.
Smart Images

Figure CN222636644U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to a SD card power-off protection circuit in the field of power electronics. Background Art
[0002] SD card is an independent storage medium, usually in the form of a card, so it is collectively called "memory card", also known as "digital memory card", "digital memory card", "storage card", etc. When in use, a single-chip microcomputer sends instructions to the SD card control chip, so that the SD card can read, write, erase and save data through the SD card control chip. However, the SD card only guarantees that the data can be protected in the event of accidental power failure and removal during the data reading process. There is no guarantee of data protection for power failure during the writing and erasing process, that is, the firmware and user data inside the SD card may be lost. Therefore, when the storage system is powered off, the SD card is still being written and erased, resulting in data loss on the SD card. Utility Model Content
[0003] The utility model aims to provide an SD card power-off protection circuit, which can notify the SD card to stop data writing and erasing and start data preservation when the system is powered off, so as to avoid data loss.
[0004] To achieve the above-mentioned purpose, the utility model provides an SD card power-off protection circuit, comprising a single-chip microcomputer U1, the single-chip microcomputer U1 is connected to an SD card control chip U3, the SD card control chip U3 is connected to an SD card holder U5, the single-chip microcomputer U1 is also connected to a power-off detection circuit, the power-off detection circuit is connected to a capacitor power supply circuit, the capacitor power supply circuit is connected to the SD card control chip U3, the single-chip microcomputer U1 and the SD card holder U5.
[0005] Compared with the prior art, the utility model has the beneficial effect that, in the case of sudden power failure, the power failure detection circuit enables the single-chip microcomputer to instantly receive a power failure signal, thereby issuing an instruction to the SD card control chip, and saving data on the SD card through the SD card control chip. In this process, the capacitor power supply circuit supplies power to the single-chip microcomputer, the SD card control chip and the SD card holder to ensure smooth data saving. When the system is powered off, the SD card can be notified to stop data writing and erasing and start data saving to avoid data loss.
[0006] As a further improvement of the utility model, the capacitor power supply circuit includes a voltage regulating chip U2, pin 3 of the voltage regulating chip U2 is connected to the 5V step-down circuit via capacitors C1 and C2 connected in parallel, one pin of the capacitor C2 is connected to pin 3 of the voltage regulating chip U2, the other pin of the capacitor C2 is connected to pin 1 of the voltage regulating chip U2 and is grounded, pin 1 of the voltage regulating chip U2 is connected to the negative electrode of the capacitor C3, the positive electrode of the capacitor C3 is respectively connected to pin 2 of the voltage regulating chip U2 and the anode of the voltage regulating diode D1, pin 2 of the voltage regulating chip U2 is connected to pin 0, the cathode of the voltage regulating diode D1 is connected to the positive electrode of the supercapacitor C4, the negative electrode of the supercapacitor C4 is grounded, and the positive electrode of the supercapacitor C4 is respectively connected to the single-chip microcomputer U1, the SD card management chip U3 and the SD card U5.
[0007] In this way, during normal operation, the 5V step-down circuit converts the external power supply of the entire system into a 5V voltage, and converts the 5V voltage into a 3.3V voltage through the voltage regulating chip U2, and then charges the supercapacitor C4 through D3 isolation. At the same time, it also supplies power to the microcontroller, power-off detection circuit, SD card control chip and SD card holder. When the external power supply of the system is cut off, the supercapacitor C4 can continue to supply power to the microcontroller, power-off detection circuit, SD card control chip and SD card holder, thereby ensuring that the SD card data saving operation can proceed smoothly.
[0008] As a further improvement of the utility model, the power-off detection circuit includes a power monitor U23, a diode D12 is connected between pin 1 and pin 8 of the power monitor U23, pin 2 of the power monitor U23 is respectively connected to the positive electrodes of capacitor C62 and supercapacitor C4, capacitor C62 is grounded, pin 3 of the power monitor U23 is grounded, pin 4 of the power monitor U23 is respectively connected to one end of resistor R162 and one end of resistor R164, the other end of resistor R162 is connected to an external power supply, the other end of resistor R164 is grounded, and pins 5, 6 and 7 of the power monitor U23 are connected to the microcontroller U1.
[0009] In this way, the external power supply of the system is detected by the power monitor. Once the external power supply is cut off, the power monitor will send a power-off signal to the microcontroller, so that the microcontroller receives the power-off signal and then issues an instruction to save data.
[0010] As a further improvement of the present invention, pins 128, 114 and 116 of the single-chip microcomputer U1 are connected to pins 7, 6 and 5 of the power monitor U23 respectively, pin 128 of the single-chip microcomputer U1 is connected to the positive electrode of the supercapacitor C4 via resistor R236, pin 42 of the single-chip microcomputer U1 is connected to the positive electrode of the supercapacitor C4 via resistor R135, pins 5, 36, 41, 71, 77, 107, 111, 141, 16, 17, 94, 131, Pin 59, pin 25, pin 127 and pin 137 are connected to the positive electrode of supercapacitor C4, pin 26 of microcontroller U1 is connected to the positive electrode of supercapacitor C4 via resistor R149, pin 28 of microcontroller U1 is connected to the positive electrode of supercapacitor C4 via resistor R154, pin 29 of microcontroller U1 is connected to the positive electrode of supercapacitor C4 via resistor R150, pin 30 of microcontroller U1 is connected to the positive electrode of supercapacitor C4 via resistor R151, and pin 31 of microcontroller U1 is connected to the positive electrode of supercapacitor C4 via resistor R152.
[0011] In this way, when the microcontroller receives a power-off signal, it sends an instruction to the SD card control chip to stop writing and erasing operations and start data saving, thereby avoiding SD card data loss.
[0012] As a further improvement of the present invention, pin 19 of the SD card control chip U3 is connected to pin 3 of the crystal oscillator Y1 via resistor R2, pin 4 of the crystal oscillator Y1 is connected to the positive electrode of the super capacitor C4, pins 7, 21, 26, 39, 56, 122, 101, 92, 83, 72 and 70 of the SD card control chip U3 are connected to the positive electrode of the super capacitor C4, and pins 118, 119, 120, 121 and 123 of the SD card control chip U3 are connected to the positive electrode of the super capacitor C4. Pin 1, pin 124, pin 125, and pin 126 are connected to pin 50, pin 51, pin 52, pin 53, pin 55, pin 56, pin 60, and pin 61 of the single-chip computer U1; pin 1 and pin 2 of the SD card holder U5 are respectively connected to pin 59 and pin 61 of the SD card control chip U3, pin 5 and pin 7 of the SD card holder U5 are respectively connected to pin 60 and pin 62 of the SD card control chip U3, and pin 11 and pin 10 of the SD card holder U5 are respectively connected to pin 50 and pin 49 of the SD card control chip U3.
[0013] In this way, the SD card control chip is provided with an operating voltage by the capacitor power supply circuit, so that the SD card control chip can still perform operations such as data storage on the SD card when the power is off.
[0014] As a further improvement of the present utility model, the positive electrode of the supercapacitor is connected to the positive electrode of capacitor C8, the negative electrode of capacitor C8 is grounded, capacitor C8 is connected in parallel with capacitor C9, pin 4 of the SD card holder U5 is connected to the positive electrode of capacitor C8, pin 8 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R6, and pin 9 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R5.
[0015] In this way, capacitors C8 and C9 act as filter capacitors to ensure the stability of the SD card power supply voltage. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is the power-off detection circuit diagram of the utility model.
[0017] Figure 2 This is the capacitor power supply circuit diagram of the utility model.
[0018] Figure 3 This is the circuit diagram of the microcontroller.
[0019] Figure 4 This is the circuit diagram of the SD card control chip.
[0020] Figure 5 This is the circuit diagram of the SD card holder. DETAILED DESCRIPTION
[0021] The utility model is further described below in conjunction with the accompanying drawings:
[0022] like Figure 1-5 An SD card power-off protection circuit shown includes a single-chip microcomputer U1, the single-chip microcomputer U1 is connected to an SD card control chip U3, the SD card control chip U3 is connected to an SD card holder U5, the single-chip microcomputer U1 is also connected to a power-off detection circuit, the power-off detection circuit is connected to a capacitor power supply circuit, and the capacitor power supply circuit is connected to the SD card control chip U3, the single-chip microcomputer U1 and the SD card holder U5.
[0023] The capacitor power supply circuit includes a voltage regulating chip U2, and pin 3 of the voltage regulating chip U2 is connected to the 5V step-down circuit via capacitors C1 and C2 connected in parallel. One pin of the capacitor C2 is connected to pin 3 of the voltage regulating chip U2, and the other pin of the capacitor C2 is connected to pin 1 of the voltage regulating chip U2 and grounded. Pin 1 of the voltage regulating chip U2 is connected to the negative electrode of the capacitor C3, and the positive electrode of the capacitor C3 is respectively connected to pin 2 of the voltage regulating chip U2 and the anode of the voltage regulating diode D1, and pin 2 of the voltage regulating chip U2 is connected to pin 0. The cathode of the voltage regulating diode D1 is connected to the positive electrode of the supercapacitor C4, and the negative electrode of the supercapacitor C4 is grounded. The positive electrode of the supercapacitor C4 is respectively connected to the single-chip microcomputer U1, the SD card management chip U3, and the SD card U5.
[0024] The power-off detection circuit includes a power monitor U23, a diode D12 is connected between pin 1 and pin 8 of the power monitor U23, pin 2 of the power monitor U23 is respectively connected to the positive electrodes of capacitor C62 and supercapacitor C4, capacitor C62 is grounded, pin 3 of the power monitor U23 is grounded, pin 4 of the power monitor U23 is respectively connected to one end of resistor R162 and one end of resistor R164, the other end of resistor R162 is connected to an external power supply, the other end of resistor R164 is grounded, and pins 5, 6 and 7 of the power monitor U23 are connected to the microcontroller U1.
[0025] Pin 128, 114 and 116 of the single-chip computer U1 are connected to pin 7, pin 6 and pin 5 of the power monitor U23 respectively. Pin 128 of the single-chip computer U1 is connected to the positive electrode of the super capacitor C4 via resistor R236. Pin 42 of the single-chip computer U1 is connected to the positive electrode of the super capacitor C4 via resistor R135. Pin 5, 36, 41, 71, 77, 107, 111, 141, 16, 17, 94, 131, 59 and 25 of the single-chip computer U1 are connected to the positive electrode of the super capacitor C4 via resistor R135. , 127 and 137 are connected to the positive electrode of the supercapacitor C4, the 26th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R149, the 28th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R154, the 29th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R150, the 30th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R151, and the 31st pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R152.
[0026] Pin 19 of the SD card control chip U3 is connected to pin 3 of the crystal oscillator Y1 via resistor R2, pin 4 of the crystal oscillator Y1 is connected to the positive electrode of the supercapacitor C4, pin 7, pin 21, pin 26, pin 39, pin 56, pin 122, pin 101, pin 92, pin 83, pin 72 and pin 70 of the SD card control chip U3 are connected to the positive electrode of the supercapacitor C4, pin 118, pin 119, pin 120, pin 121, pin 123, pin 124, Pins 125 and 126 are connected to pins 50, 51, 52, 53, 55, 56, 60, and 61 of the microcontroller U1; pins 1 and 2 of the SD card holder U5 are connected to pins 59 and 61 of the SD card control chip U3 respectively, pins 5 and 7 of the SD card holder U5 are connected to pins 60 and 62 of the SD card control chip U3 respectively, and pins 11 and 10 of the SD card holder U5 are connected to pins 50 and 49 of the SD card control chip U3 respectively.
[0027] The positive electrode of the supercapacitor is connected to the positive electrode of capacitor C8, the negative electrode of capacitor C8 is grounded, capacitor C8 is connected in parallel with capacitor C9, pin 4 of the SD card holder U5 is connected to the positive electrode of capacitor C8, pin 8 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R6, and pin 9 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R5.
[0028] In the utility model, the PWR connected to the 4th pin of the power monitor U23 in the power-off detection circuit is the voltage of the external power supply of the entire SD card system. The 4th pin of the power monitor U23, namely the PFI pin, has a detection threshold voltage of 1.25V. The normal input voltage of the external power supply is 19V. The voltage of the PFI pin is divided by resistors R162 and R164 to about 2.48V. Since 2.48V is greater than 1.25V, the PFO pin (5th pin) of the power monitor U23 maintains a high level 3.3V output. When power is off, the voltage of the PFI pin is 0V, which is lower than 1.25V. The PFO pin outputs 0V. The PFO pin is connected to the 114th pin of the microcontroller, so that the microcontroller can get a power-off signal.
[0029] In the capacitor power supply circuit, the voltage regulator chip U2 is connected to the 5V step-down circuit, which is connected to the external power supply that powers the entire system. The 5V step-down circuit converts the voltage of the external power supply to 5V, and then converts the 5V to 3.3V through the voltage regulator chip U2. The stable 3V voltage is output through the voltage regulator diode D1. In addition to charging the super capacitor C4, it also powers the power failure detection circuit, the single-chip microcomputer, the SD card control chip, and the SD card holder. When the external power supply is cut off, the super capacitor C4 can power the power failure detection circuit, the single-chip microcomputer, the SD card control chip, and the SD card holder.
[0030] If the external power supply is suddenly cut off, the voltage of the PFI pin of the power monitor U23 is 0V, which is lower than 1.25V, and the PFO pin outputs 0V. The PFO pin is connected to the 114 pin of the microcontroller, so that the microcontroller can get the power-off signal and send instructions to the SD card control chip to stop writing and erasing operations and start data saving, so that the SD card in the SD card holder stops writing and erasing operations and starts data saving. In this process, the super capacitor C4 supplies power to each part to ensure the smooth progress of the whole process.
[0031] The utility model can notify the SD card to stop writing and erasing data and start saving data when the system is powered off, thereby avoiding data loss.
[0032] The utility model is not limited to the above-mentioned embodiments. On the basis of the technical solution disclosed in the present invention, technicians in this field can make some substitutions and deformations to some technical features therein according to the disclosed technical content without creative labor, and these substitutions and deformations are all within the protection scope of the utility model.
Claims
1. An SD card power-off protection circuit, comprising a single-chip microcomputer U1, the single-chip microcomputer U1 is connected to an SD card control chip U3, the SD card control chip U3 is connected to an SD card holder U5, characterized in that: The single-chip microcomputer U1 is also connected to a power-off detection circuit, which is connected to a capacitor power supply circuit, which is connected to an SD card control chip U3, the single-chip microcomputer U1 and an SD card holder U5.
2. The SD card power-off protection circuit according to claim 1, characterized in that: The capacitor power supply circuit includes a voltage regulating chip U2, and pin 3 of the voltage regulating chip U2 is connected to the 5V step-down circuit via capacitors C1 and C2 connected in parallel. One pin of the capacitor C2 is connected to pin 3 of the voltage regulating chip U2, and the other pin of the capacitor C2 is connected to pin 1 of the voltage regulating chip U2 and grounded. Pin 1 of the voltage regulating chip U2 is connected to the negative electrode of the capacitor C3, and the positive electrode of the capacitor C3 is respectively connected to pin 2 of the voltage regulating chip U2 and the anode of the voltage regulating diode D1, and pin 2 of the voltage regulating chip U2 is connected to pin 0. The cathode of the voltage regulating diode D1 is connected to the positive electrode of the supercapacitor C4, and the negative electrode of the supercapacitor C4 is grounded. The positive electrode of the supercapacitor C4 is respectively connected to the single-chip microcomputer U1, the SD card management chip U3, and the SD card U5.
3. The SD card power-off protection circuit according to claim 2, characterized in that: The power-off detection circuit includes a power monitor U23, a diode D12 is connected between pin 1 and pin 8 of the power monitor U23, pin 2 of the power monitor U23 is respectively connected to the positive electrodes of capacitor C62 and supercapacitor C4, capacitor C62 is grounded, pin 3 of the power monitor U23 is grounded, pin 4 of the power monitor U23 is respectively connected to one end of resistor R162 and one end of resistor R164, the other end of resistor R162 is connected to an external power supply, the other end of resistor R164 is grounded, and pins 5, 6 and 7 of the power monitor U23 are connected to the microcontroller U1.
4. The SD card power-off protection circuit according to claim 3, characterized in that: Pin 128, 114 and 116 of the single-chip computer U1 are connected to pin 7, pin 6 and pin 5 of the power monitor U23 respectively. Pin 128 of the single-chip computer U1 is connected to the positive electrode of the super capacitor C4 via resistor R236. Pin 42 of the single-chip computer U1 is connected to the positive electrode of the super capacitor C4 via resistor R135. Pin 5, 36, 41, 71, 77, 107, 111, 141, 16, 17, 94, 131, 59 and 25 of the single-chip computer U1 are connected to the positive electrode of the super capacitor C4 via resistor R135. , 127 and 137 are connected to the positive electrode of the supercapacitor C4, the 26th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R149, the 28th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R154, the 29th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R150, the 30th pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R151, and the 31st pin of the single-chip computer U1 is connected to the positive electrode of the supercapacitor C4 via the resistor R152.
5. The SD card power-off protection circuit according to claim 4, characterized in that: Pin 19 of the SD card control chip U3 is connected to pin 3 of the crystal oscillator Y1 via resistor R2, pin 4 of the crystal oscillator Y1 is connected to the positive electrode of the super capacitor C4, pin 7, pin 21, pin 26, pin 39, pin 56, pin 122, pin 101, pin 92, pin 83, pin 72 and pin 70 of the SD card control chip U3 are connected to the positive electrode of the super capacitor C4, pin 118, pin 119, pin 120, pin 121, pin 123, pin 124, pin 125 and pin 126 of the SD card control chip U3 are connected to pin 50, pin 51, pin 52, pin 53, pin 55, pin 56, pin 60 and pin 61 of the single-chip computer U1; Pin 1 and pin 2 of the SD card holder U5 are connected to pin 59 and pin 61 of the SD card control chip U3 respectively, pin 5 and pin 7 of the SD card holder U5 are connected to pin 60 and pin 62 of the SD card control chip U3 respectively, and pin 11 and pin 10 of the SD card holder U5 are connected to pin 50 and pin 49 of the SD card control chip U3 respectively.
6. The SD card power-off protection circuit according to claim 5, characterized in that: The positive electrode of the supercapacitor is connected to the positive electrode of capacitor C8, the negative electrode of capacitor C8 is grounded, capacitor C8 is connected in parallel with capacitor C9, pin 4 of the SD card holder U5 is connected to the positive electrode of capacitor C8, pin 8 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R6, and pin 9 of the SD card holder U5 is connected to the positive electrode of capacitor C8 via resistor R5.