Detection circuit and detection method for confirming MCU working power supply voltage

By designing a detection circuit for the MCU, the voltage regulator tube and voltage divider circuit are used to determine whether the supply voltage is normal, which solves the problem that the MCU cannot determine the power supply voltage after starting up, and achieves high response speed and accurate power supply detection, and is cheap.

CN111090054BActive Publication Date: 2025-05-13JIANGSU KAILONG ELECTRONICS
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010064185.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-20
Publication Date
2025-05-13
Estimated Expiration
2040-01-20

AI Technical Summary

Technical Problem

After starting up, the MCU cannot determine whether the operating power supply voltage of its own and its peripheral circuits is normal, especially in application scenarios where the front-end voltage fluctuates unstablely, the existing technology is difficult to effectively solve this problem, and it increases the reduction of the system response speed.

Method used

A detection circuit is designed, including a voltage regulator tube and a voltage divider circuit. By detecting the voltage at the output end of the circuit, it is used to determine whether the supply voltage of the MCU is normal. The specific steps include determining whether the voltage regulator circuit has a voltage input, whether the MCU is operating, and determining whether the supply voltage is within the normal range based on the voltage at the output end of the detection circuit.

Benefits of technology

It realizes accurate judgment of the working power supply voltage of the MCU and its peripheral circuits at low cost, greatly improving the system's response speed and response accuracy, and avoiding erroneous operations caused by unstable power supply voltage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111090054B_ABST
    Figure CN111090054B_ABST
Patent Text Reader

Abstract

The present invention relates to a detection circuit and a detection method for confirming the working power supply voltage of an MCU. The first front-end input voltage of the MCU is input to the input end of a voltage stabilizing circuit; the output end of the voltage stabilizing circuit outputs the power supply voltage of the MCU and the peripheral circuit of the MCU; the detection circuit includes a voltage stabilizing tube and a voltage divider circuit; the cathode of the voltage stabilizing tube is connected to the input end of a second voltage stabilizing power supply; the anode of the voltage stabilizing tube is connected to the first end of the voltage divider circuit; the second end of the voltage divider circuit is grounded; the voltage divider circuit includes a first resistor and a second resistor connected in series with each other; the common end of the first resistor and the second resistor is the output end of the detection circuit; the output end of the detection circuit is connected to the ADC end of the MCU. The present invention solves the problem that it is impossible to judge whether the working power supply voltage of the MCU itself and its peripheral circuits is normal after the MCU is started at an extremely low cost. The response speed and response accuracy of the system are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic circuits, and in particular to a detection circuit and a detection method for confirming the working power supply voltage of an MCU. Background Art

[0002] In the prior art, MCU (Microcontroller Unit) has a relatively wide operating voltage range. For example, in the STM32F0 series, the normal voltage operating range of digital IO and core is 2.0~3.6V, but some peripherals inside the MCU have different voltage requirements, such as the power supply requirement of ADC (Analog to Digital Converter) is 2.4~3.6V. At the same time, the peripheral circuits of the circuit board also have requirements for the power supply voltage. For example, the operational amplifier needs a 3.3V voltage to work normally, and the ADC center line voltage 1.65V built by the operational amplifier can be stably established. After the ADC center line voltage is established, the data collection using this center line as a reference can be accurate, and the MCU can make corresponding correct actions based on this calculation result. However, during the period of time when the circuit board is powered on, the power supply voltage will have a rising process from 0~3.3V (here it is assumed that the chip and peripheral circuit working voltage is 3.3V). When the voltage rises to 2.0V, the software inside the MCU has started to run, but the software cannot know whether the current power supply voltage is already 3.3V. On the one hand, since the circuit board is equipped with large and small capacitors, it takes time to charge these capacitors, which causes the voltage rise process to vary depending on the size of the capacitors configured on the circuit board, which may vary from a few microseconds to a few seconds; on the other hand, in some applications, the front-end input voltage is not a stable voltage, it may fluctuate, which causes the working voltage to be unstable and will continue to change back and forth between 0 and 3.3V.

[0003] Usually, there are two ways to solve the problem of uncertain power supply voltage. One is to install a power management chip. The MCU can communicate with the power management chip or read the IO pin status to determine the status of the power supply voltage in real time. The power management chip itself can also output a stable power supply voltage only when the conditions are met to avoid power supply voltage fluctuations. However, this method is relatively expensive. Another method is to add a delay in the MCU program, and continue the following operations related to the power supply voltage after a power-on delay for a period of time. This method can only solve the power-on voltage problem when there is a stable external power supply. It cannot solve the power-on voltage problem well in application scenarios where the front-end voltage fluctuates uncertainly. In addition, the delay is added, which reduces the response speed of the system, so this is not a good solution. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention discloses a detection circuit and a detection method for confirming the working power supply voltage of an MCU.

[0005] The technical solution adopted by the present invention is as follows:

[0006] A detection circuit for confirming the working power supply voltage of an MCU, wherein a first front-end input voltage of the MCU is input to an input end of a voltage stabilizing circuit; an output end of the voltage stabilizing circuit outputs a power supply voltage of the MCU and a peripheral circuit of the MCU; the detection circuit comprises a voltage stabilizing tube and a voltage divider circuit; a cathode of the voltage stabilizing tube is connected to an input end of a second voltage stabilizing power supply; an anode of the voltage stabilizing tube is connected to a first end of the voltage divider circuit; a second end of the voltage divider circuit is grounded; the voltage divider circuit comprises a first resistor and a second resistor connected in series with each other; a common end of the first resistor and the second resistor is an output end of the detection circuit; and the output end of the detection circuit is connected to an ADC end of the MCU.

[0007] Its further technical solution is: the voltage stabilizing circuit includes a second voltage stabilizing power supply; the first front-end input voltage of the MCU is input to the input end of the second voltage stabilizing power supply; the output end of the second voltage stabilizing power supply outputs the power supply voltage of the MCU and the peripheral circuits of the MCU.

[0008] Its further technical solution is: the voltage stabilizing circuit also includes a first voltage stabilizing power supply; the second front-end input voltage is input to the input end of the first voltage stabilizing power supply; the output end of the first voltage stabilizing power supply is connected to the input end of the second voltage stabilizing power supply.

[0009] A method for detecting a detection circuit for confirming an MCU working power supply voltage according to claim 1, comprising:

[0010] S1. Determine whether the voltage stabilizing circuit has a voltage input, if so, proceed to step S2;

[0011] S2. Determine whether the MCU is working. If the MCU is not working, proceed to step S3; if the MCU starts working, proceed to step S4;

[0012] S3. If the supply voltage is less than the working threshold, the first front-end input voltage is less than the opening threshold;

[0013] S4. If the supply voltage is greater than the working threshold, the supply voltage is determined to be normal based on the voltage at the output of the detection circuit read by the ADC of the MCU:

[0014] If the voltage at the output end of the detection circuit = 0, the voltage regulator tube is not turned on, the first front-end input voltage is less than the turn-on threshold, and it is determined that the power supply voltage is abnormal;

[0015] If the highest threshold value>the voltage at the output end of the detection circuit>the lowest threshold value, the voltage regulator is turned on, and the rated highest input voltage>the first front-end input voltage>the turn-on threshold value, it is determined that the power supply voltage is within the normal range and is stable;

[0016] If the voltage at the output end of the detection circuit is greater than the maximum threshold, the voltage regulator is turned on, and the first front-end input voltage is greater than the rated maximum input voltage, it is determined that the power supply voltage is abnormal;

[0017] The working threshold is the minimum voltage value that can make the MCU start working; the start threshold is the minimum input voltage value that can make the output end of the second voltage-stabilized power supply output a stable voltage and turn on the voltage-stabilizing tube; the rated maximum input voltage is the maximum rated value of the input voltage of the second voltage-stabilized power supply; the maximum threshold is the maximum value of the output voltage of the detection circuit when the power supply voltage is stable; the minimum threshold is the minimum value of the output voltage of the detection circuit when the power supply voltage is stable.

[0018] A further technical solution is: the relationship between the output voltage of the detection circuit and the first front-end input voltage is:

[0019] V1=(VCC-VZ1)*R2 / (R1+R2) (1)

[0020] VZ1 is the turn-on voltage of the voltage regulator tube.

[0021] Its further technical solution is: the start threshold is the minimum input voltage value that can make the output end of the second voltage-stabilized power supply output a stable voltage, can meet the normal operation of the MCU and all its peripheral circuits and can turn on the voltage-stabilizing tube at the same time.

[0022] The beneficial effects of the present invention are as follows:

[0023] The present invention solves the problem that the MCU cannot determine whether the working power supply voltage of the MCU and its peripheral circuits is normal after startup at an extremely low cost. The response speed and response accuracy of the system are greatly improved. In practice, the cost of the present invention may be less than two cents, but the problem solved is very important and has extremely high practicality. In the prior art, the same function is achieved by using a power management chip, and the cost is only a few yuan. In contrast, the superiority of the present invention is very obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a schematic diagram of a voltage stabilizing circuit of the present invention.

[0025] Figure 2 Schematic diagram of the detection circuit of the present invention.

[0026] Figure 3A flowchart for detecting whether the power supply voltage of the MCU is normal.

[0027] Figure 4 Schematic diagram of the circuit of MCU in a specific embodiment.

[0028] Figure 5 It is a flow chart for detecting whether the power supply voltage of the MCU is normal according to a specific embodiment. DETAILED DESCRIPTION

[0029] The specific implementation of the present invention is described below in conjunction with the accompanying drawings.

[0030] The voltage stabilizing circuit is used to provide a power supply voltage VDD to the MCU U3 and the peripheral circuits of the MCU U3. The first front-end input voltage VCC of the MCU U3 is input to the input end of the voltage stabilizing circuit, and the output end of the voltage stabilizing circuit outputs the power supply voltage VDD of the MCU U3 and the peripheral circuits of the MCU U3.

[0031] Figure 1 FIG. 1 is a schematic diagram of a voltage stabilizing circuit of the present invention. Figure 1 As shown, the voltage stabilizing circuit includes a second voltage stabilizing power supply U2. The first front-end input voltage VCC of the MCU U3 is input to the input end of the second voltage stabilizing power supply U2. The output end of the second voltage stabilizing power supply U2 outputs the power supply voltage VDD of the MCU U3 and the peripheral circuits of the MCU U3.

[0032] Preferably, the voltage stabilizing circuit further comprises a first voltage stabilizing power supply U1. The second front-end input voltage VCC1 is input to the input end of the first voltage stabilizing power supply U1. The output end of the first voltage stabilizing power supply U1 outputs the first front-end input voltage VCC. The output end of the first voltage stabilizing power supply U1 is connected to the input end of the second voltage stabilizing power supply U2.

[0033] Figure 2 FIG. 1 is a schematic diagram of the detection circuit of the present invention. Figure 1 As shown, the detection circuit includes a voltage regulator tube Z1 and a voltage divider circuit. The cathode of the voltage regulator tube Z1 is connected to the input end of the second voltage regulator power supply U2. The anode of the voltage regulator tube Z1 is connected to the first end of the voltage divider circuit. The second end of the voltage divider circuit is grounded. The voltage divider circuit includes a first resistor R1 and a second resistor R2 connected in series. The common end of the first resistor R1 and the second resistor R2 is the output end of the detection circuit. The output end of the detection circuit is connected to the ADC end of the MCU U3.

[0034] Figure 3 This is a flow chart for detecting whether the power supply voltage of MCU U3 is normal. Figure 3 As shown, the method for detecting according to the above detection circuit for confirming the working power supply voltage of MCU U3 includes:

[0035] S1. Determine whether there is voltage input to the voltage stabilizing circuit. If yes, proceed to step S2;

[0036] S2. Determine whether MCU U3 is working. If MCU U3 is not working, proceed to step S3; if MCU U3 starts working, proceed to step S4;

[0037] S3. Since MCU U3 is not working, it means that the power supply voltage VDD is less than the working threshold, which means that the first front-end input voltage VCC is too small, and the first front-end input voltage VCC is less than the opening threshold;

[0038] S4. Since the MCU U3 starts to work, it means that the power supply voltage VDD> the working threshold. Then, according to the voltage V1 at the output end of the detection circuit read by the ADC end of the MCU U3, it is determined whether the power supply voltage VDD is normal. There are the following situations:

[0039] If the voltage V1 at the output end of the detection circuit is 0, it is determined that the voltage regulator Z1 in the detection circuit is not conducting, and no current flows in the voltage divider circuit. This also indicates that the first front-end input voltage VCC is too small, and the first front-end input voltage VCC is less than the turn-on threshold, and it is determined that the power supply voltage VDD is abnormal.

[0040] If the highest threshold value > the detection circuit output voltage V1 > the lowest threshold value, the voltage regulator Z1 is turned on. Since the detection circuit output voltage V1 and the first front-end input voltage VCC have a positive correlation, and

[0041] V1=(VCC-VZ1)*R2 / (R1+R2) (1)

[0042] In formula (1), VZ1 is the turn-on voltage of the Zener diode (Z1).

[0043] Therefore, it can be determined that: the rated maximum input voltage> the first front-end input voltage VCC> the turn-on threshold, and according to the characteristics of the second voltage-regulated power supply U2, it can be determined that the power supply voltage VDD is within the normal range and is stable;

[0044] If the voltage V1 at the output end of the detection circuit is greater than the maximum threshold, the voltage regulator Z1 is turned on, but the first front-end input voltage VCC is greater than the rated maximum input voltage. The first front-end input voltage VCC is too high and may easily damage the second voltage regulator U2. The power supply voltage VDD is judged to be abnormal.

[0045] In the above, the working threshold is the minimum voltage value that can make the MCU U3 start working; the start-up threshold is the minimum input voltage value that can make the output end of the second regulated power supply U2 output a stable voltage and turn on the zener tube Z1; the rated maximum input voltage is the highest rated value of the input voltage of the second regulated power supply U2. When the rated maximum input voltage is exceeded, the second regulated power supply U2 is easily damaged and will not output a stable voltage; the maximum threshold is the maximum value of the output voltage V1 of the detection circuit when the power supply voltage VDD is stable; the minimum threshold is the minimum value of the output voltage V1 of the detection circuit when the power supply voltage VDD is stable.

[0046] Preferably, the turn-on threshold is the minimum input voltage value that can make the output end of the second voltage-stabilized power supply U2 output a stable voltage, can satisfy the normal operation of the MCU and all its peripheral circuits, and can turn on the voltage regulator Z1. The minimum voltage for the normal operation of all circuits can be determined according to the power demand of the MCU U3 and the peripheral circuit design. After the working circuit design is completed, this value can be measured and obtained by an oscilloscope. For a circuit with a small minimum normal operating voltage, the corresponding turn-on threshold is small, that is, the power supply voltage VDD can be quickly stabilized at the output value. For a circuit with a large minimum normal operating voltage, the corresponding turn-on threshold is large, so that the power supply voltage VDD can be quickly stabilized at the output value.

[0047] Figure 4 FIG. 1 is a circuit diagram of MCU U3 in a specific embodiment. Figure 4 As shown, the model of MCU U3 is 32F072. Figure 1 , Figure 2 , the second front-end input voltage VCC1 ranges from 0 to 26V, and the first front-end input voltage VCC ranges from 0 to 10V.

[0048] The first voltage-stabilized power supply U1 is a voltage-stabilized power supply integrated circuit of model 78M09. When the second front-end input voltage VCC1 is in the range of 11.5 to 26V, the output end of the first voltage-stabilized power supply U1 can output a stable voltage of 9V.

[0049] The second voltage-stabilized power supply U2 is a voltage-stabilized power supply integrated circuit of model 1117M3-3. When the first front-end input voltage VCC is in the range of 4.75 to 10V, the output end of the second voltage-stabilized power supply U2 can output a stable voltage of 3.3V as the power supply voltage VDD for MCU U3 and the peripheral circuits of MCU U3.

[0050] The turn-on voltage of the voltage regulator Z1 is 5V, the first resistor R1 is 10kΩ, and the second resistor R2 is 3kΩ.

[0051] In this specific embodiment, the working threshold is the minimum voltage value that can make the MCU U3 start working. For the MCU U3 of model 32F072, the working threshold is 2V. The opening threshold is the minimum input voltage value that can make the output end of the second regulated power supply U2 output a stable voltage and turn on the voltage regulator Z1. Therefore, the opening threshold is 5V. Figure 3 In order to ensure the normal operation of the MCU U3 and all its peripheral circuits, the MCU U3 with the model number of 32F072 is measured by an oscilloscope in a specific experiment. It is known that the more preferred technical solution is to set the start threshold to 6V, which is the minimum voltage that can meet the normal operation of the MCU and all its peripheral circuits. The rated maximum input voltage is the highest rated value of the input voltage of the second regulated power supply U2. When the rated maximum input voltage is exceeded, the second regulated power supply U2 is easily damaged and will not output a stable voltage, so the rated maximum input voltage is 10V.

[0052] The highest threshold is the maximum value of the voltage V1 at the output of the detection circuit when the power supply voltage VDD is stable. Substituting the specific numbers in the embodiment into formula (1) shows that the highest threshold is 1.15 V. The lowest threshold is the minimum value of the voltage V1 at the output of the detection circuit when the power supply voltage VDD is stable. Substituting the specific numbers in the embodiment into formula (1) shows that the lowest threshold is 0.23 V.

[0053] Figure 5 FIG. 1 is a flow chart for detecting whether the power supply voltage of MCU U3 is normal according to a specific embodiment. Figure 5 As shown, in a specific embodiment, detecting whether the power supply voltage of MCU U3 is normal includes:

[0054] S1. Determine whether there is voltage input to the voltage stabilizing circuit. If yes, proceed to step S2;

[0055] S2. Determine whether MCU U3 is working. If MCU U3 is not working, proceed to step S3; if MCU U3 starts working, proceed to step S4;

[0056] S3. Since MCU U3 does not work, it means that the power supply voltage VDD is less than 2V, which means that the first front-end input voltage VCC is too small, and the first front-end input voltage VCC is less than 5V;

[0057] S4. Since MCU U3 starts to work, it means that the power supply voltage VDD>2V. Then, the power supply voltage VDD is judged whether it is normal according to the output voltage V1 of the detection circuit read by the ADC end of MCU U3:

[0058] If the voltage V1 at the output end of the detection circuit is 0, the voltage regulator Z1 in the detection circuit is not conducting, and no current flows in the voltage divider circuit, which also indicates that the first front-end input voltage VCC is too small. If the first front-end input voltage VCC is less than 5V, it is determined that the power supply voltage VDD is abnormal.

[0059] If 1.15V>detection circuit output voltage V1>0.23V, the voltage regulator Z1 is turned on. Since the detection circuit output voltage V1 and the first front-end input voltage VCC are positively correlated, and according to formula (1), the value of the first front-end input voltage VCC can be determined from the value of the detection circuit output voltage V1, it can be determined that 10V>first front-end input voltage VCC>6V. According to the characteristics of the second voltage-regulated power supply U2, it can be determined that the power supply voltage VDD is within the normal range and is stable.

[0060] If the voltage V1 at the output end of the detection circuit is greater than 1.15V, the voltage regulator Z1 is turned on, but the first front-end input voltage VCC is greater than 10V. The value of the first front-end input voltage VCC is too high, which may easily damage the second voltage regulator U2. It is determined that the power supply voltage VDD is abnormal.

[0061] The above description is an explanation of the present invention, not a limitation of the present invention. The scope of the present invention is defined in the claims. The present invention may be modified in any form without violating the basic structure of the present invention.

Claims

1. A method for detecting a voltage of an MCU operating power supply according to a detection circuit, characterized in that: In the detection circuit, a first front-end input voltage (VCC) of the MCU (U3) is input to an input end of a voltage stabilizing circuit; an output end of the voltage stabilizing circuit outputs a power supply voltage (VDD) of the MCU (U3) and a peripheral circuit of the MCU (U3); the detection circuit comprises a voltage stabilizing tube (Z1) and a voltage divider circuit; a cathode of the voltage stabilizing tube (Z1) is connected to an input end of a second voltage stabilizing power source (U2); an anode of the voltage stabilizing tube (Z1) is connected to a first end of the voltage divider circuit; a second end of the voltage divider circuit is grounded; the voltage divider circuit comprises a first resistor (R1) and a second resistor (R2) connected in series; a common end of the first resistor (R1) and the second resistor (R2) is an output end of the detection circuit; and the output end of the detection circuit is connected to an ADC end of the MCU (U3); The detection method comprises: S1. Determine whether the voltage stabilizing circuit has a voltage input, if so, proceed to step S2; S2. Determine whether the MCU (U3) is working. If the MCU (U3) is not working, proceed to step S3; if the MCU (U3) starts working, proceed to step S4; S3. The supply voltage (VDD) is less than the working threshold, then the first front-end input voltage (VCC) is less than the opening threshold; S4. If the power supply voltage (VDD) is greater than the working threshold, the power supply voltage (VDD) is judged to be normal according to the voltage (V1) at the output end of the detection circuit read by the ADC end of the MCU (U3): If the voltage (V1) at the output end of the detection circuit is 0, the voltage regulator (Z1) is not turned on, the first front-end input voltage (VCC) is less than the turn-on threshold, and it is determined that the power supply voltage (VDD) is abnormal; If the highest threshold value> the detection circuit output voltage (V1)> the lowest threshold value, the voltage regulator (Z1) is turned on, and the rated highest input voltage> the first front-end input voltage (VCC)> the turn-on threshold value, it is judged that the power supply voltage (VDD) is within the normal range and is stable; If the voltage (V1) at the output end of the detection circuit is greater than the maximum threshold, the voltage regulator (Z1) is turned on, and if the first front-end input voltage (VCC) is greater than the rated maximum input voltage, it is determined that the power supply voltage (VDD) is abnormal; The working threshold is the minimum voltage value that can make the MCU (U3) start working; the opening threshold is the minimum input voltage value that can make the output end of the second voltage-stabilized power supply (U2) output a stable voltage and can turn on the voltage-stabilizing tube (Z1); the rated maximum input voltage is the maximum rated value of the input voltage of the second voltage-stabilized power supply (U2); the maximum threshold is the maximum value of the output end voltage (V1) of the detection circuit when the power supply voltage (VDD) is stable; and the minimum threshold is the minimum value of the output end voltage (V1) of the detection circuit when the power supply voltage (VDD) is stable.

2. The method for detecting according to claim 1, characterized in that: The relationship between the output voltage (V1) of the detection circuit and the first front-end input voltage (VCC) is: V1=(VCC-VZ1)*R2 / (R1+R2) (1) VZ1 is the turn-on voltage of the voltage regulator tube (Z1).

3. The method for detecting according to claim 1, characterized in that: The activation threshold is a minimum input voltage value that can enable the output end of the second voltage-stabilized power supply (U2) to output a stable voltage, can satisfy the normal operation of the MCU (U3) and the peripheral circuits of the MCU (U3), and can activate the voltage-stabilizing tube (Z1).

4. The method for performing detection according to claim 1, characterized in that: The voltage stabilizing circuit comprises a second voltage stabilizing power supply (U2); a first front-end input voltage (VCC) of the MCU (U3) is input to an input end of the second voltage stabilizing power supply (U2); and an output end of the second voltage stabilizing power supply (U2) outputs a power supply voltage (VDD) of the MCU (U3) and a peripheral circuit of the MCU (U3).

5. The method for detecting according to claim 4, characterized in that: The voltage stabilizing circuit also includes a first voltage stabilizing power supply (U1); a second front-end input voltage (VCC1) is input to an input end of the first voltage stabilizing power supply (U1); and an output end of the first voltage stabilizing power supply (U1) is connected to an input end of the second voltage stabilizing power supply (U2).

Citation Information

Patent Citations

  • Power and voltage detection circuit in automobile DC brushless electric fuel pump controller

    CN202159085U

  • Last electrical detection circuitry of MCU

    CN207516459U

  • Alternating voltage isolation detection device

    CN207623396U

  • And detection circuit is used for confirming voltage of MCU working power supply

    CN212111725U