Power control method for microcontroller unit and system using the same

By introducing a power controller and clock counter into the microcontroller unit, the LDO output voltage is automatically controlled, which solves the problem of MCU power mode setting errors, realizes automatic power control, and improves system stability and battery life.

CN119987472APending Publication Date: 2025-05-13NUVOTON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311810578.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-11-10
Filing Date
2023-12-26
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, the power mode setting of the MCU requires artificial software setting, which can easily lead to errors, resulting in the system being unable to operate normally or unnecessary power consumption.

Method used

By introducing a power controller and a clock counter into the microcontroller unit, the LDO output voltage is automatically controlled and switched according to the CPU frequency to achieve appropriate voltage adjustment.

Benefits of technology

There is no need for software to manually set the power mode, avoid setting errors, realize automated power control, and improve system stability and battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987472A_ABST
    Figure CN119987472A_ABST
Patent Text Reader

Abstract

The invention provides a power control method for a microcontroller unit and a system using the same. The power control method comprises the following steps: after a trigger event of switching the frequency of a central processing unit occurs, controlling a low dropout linear regulator to output default voltage through a power controller, and triggering a clock controller to switch the frequency of a first central processing unit; after the clock controller switches the frequency of the first central processing unit, counting the frequency of occurrence of a clock of the central processing unit in a period through a clock counter so as to obtain the frequency of a second central processing unit; and determining a voltage corresponding to the frequency of the second central processing unit through the power controller, and controlling the low dropout regulator to output the corresponding voltage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a power control technology, and more particularly to a power control method for a microcontroller unit and a power control system using the same. Background Art

[0002] Battery-powered portable devices (such as smart phones, tablet computers, etc.) can use microcontroller units (MCUs) for power management. In order to extend the battery life, it is necessary to save power as much as possible. The internal circuits of the MCU can be powered by a low dropout regulator (LDO). In order to flexibly save energy, the supply voltage (or power level) of the LDO is adjustable. For MCUs that support multiple power modes, each power mode corresponds to a specific central processing unit (CPU) maximum operating frequency (or maximum operating rate) and a specific LDO voltage. Although lowering the LDO voltage can achieve power saving, the lower LDO voltage supports a lower maximum CPU operating frequency.

[0003] The current power mode is manually set through software, and the power mode correspondence of each MCU may be different (for example, the same LDO voltage corresponds to different CPU maximum operating frequencies), so the setting may not be correct or optimal. When set to low power mode, the LDO voltage is low. If the CPU operating frequency is high, the system will not operate normally; when set to high power mode, the LDO voltage is high. If the CPU operating frequency is low, it will cause unnecessary power consumption.

[0004] Therefore, how to effectively control the operating power of the MCU is a problem that needs to be solved. Summary of the invention

[0005] In order to solve the above technical problems, the present application proposes a power control method for a microcontroller unit (MCU) and a power control system using the method to (1) avoid manual power setting by software and (2) avoid power setting errors.

[0006] An embodiment of the present application provides a power control method for a microcontroller unit, comprising: after a trigger event of switching a central processing unit (CPU) frequency occurs, controlling a low dropout regulator (LDO) to output a default voltage through a power controller, and triggering a clock controller to switch a first central processing unit frequency; after the clock controller switches the first central processing unit frequency, counting the number of times the central processing unit clock occurs during a period through a clock counter to obtain a second central processing unit frequency; and determining a corresponding voltage of the second central processing unit frequency through the power controller, and controlling the low dropout linear regulator to output the corresponding voltage.

[0007] Optionally, the power controller substitutes the second central processing unit frequency into a non-decreasing function to obtain the corresponding voltage, wherein the non-decreasing function comprises at least one of a step function and an increasing continuous function.

[0008] Optionally, according to a high internal RC oscillator (HIRC) clock, the clock counter counts the number of times the CPU clock occurs within the period, wherein the length of the period is associated with the frequency of the internal high-speed oscillator clock.

[0009] Optionally, the default voltage is the highest voltage supported by the microcontroller unit.

[0010] Optionally, the triggering event for switching the CPU frequency includes: at least one of an instruction for switching a CPU clock source and an instruction for frequency division is received.

[0011] An embodiment of the present application further provides a power control system for a microcontroller unit, comprising: a clock counter, electrically connected to a clock controller, and used to: after the clock controller switches the frequency of a first central processing unit (CPU), count the number of times the central processing unit clock occurs during a period to obtain a second central processing unit frequency; and a power controller, electrically connected to the clock counter, the clock controller and a low dropout regulator (LDO), and used to: after a triggering event of switching the central processing unit frequency occurs, control the low dropout regulator to output a default voltage, and trigger the clock controller to switch the first central processing unit frequency; and determine the corresponding voltage of the second central processing unit frequency, and control the low dropout regulator to output the corresponding voltage.

[0012] Based on the above, the power control method for a microcontroller unit of the present application and the power control system using the same first obtain the CPU operating frequency, and then adjust the appropriate LDO voltage for LDO output accordingly. In short, the LDO voltage (or power level) can be automatically controlled by hardware. Therefore, in addition to not having to manually set it through software, it can also avoid the situation where the setting error causes the system to be abnormal or unnecessary power consumption. In addition, more and more precise LDO voltage adjustments can be provided for the CPU operating frequency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings are provided to enable those with ordinary knowledge in the technical field to which the present invention belongs to further understand the present invention, and are incorporated into and constitute a part of the specification of the present invention. The accompanying drawings illustrate exemplary embodiments of the present invention, and together with the description of the present invention, are used to explain the principles of the present invention.

[0014] Figure 1 A block diagram of a power control system for a microcontroller unit according to an embodiment of the present application;

[0015] FIG. 2A to FIG. 2D A functional schematic diagram of a power control method for a microcontroller unit according to an embodiment of the present application; and

[0016] Figure 3 FIG. 4 is a flow chart of a power control method for a microcontroller unit according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] The present application proposes a power control method for a microcontroller unit and a power control system using the same to solve the problems mentioned in the background technology. In order to make the features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. The following description contains specific information related to the exemplary embodiments in the present application. The drawings and the accompanying detailed descriptions in the present application are only exemplary embodiments. However, the present application is not limited to these exemplary embodiments. Those skilled in the art will think of other variations and embodiments of the present application. Unless otherwise specified, the same or corresponding components in the drawings may be indicated by the same or corresponding figure numbers. In addition, the drawings and illustrations in the present application are generally not drawn to scale and are not intended to correspond to actual relative sizes.

[0018] Figure 1 FIG. 1 is a block diagram of a power control system for a microcontroller unit (MCU) according to an embodiment of the present application. Figure 1As shown, a power control system 110 for MCU 100 includes a clock counter 112 and a power controller 114. The clock counter 112 is electrically connected to the clock controller 120. The power controller 114 is electrically connected to the clock counter 112, the clock controller 120, and a low dropout regulator (LDO) 130. The clock controller 120 can be electrically connected to a bus (e.g., AHB BUS) 150. The bus 150 can be electrically connected to a central processing unit (CPU) 140. It is worth noting that although the regulator is exemplified by LDO, the present application is not limited thereto.

[0019] After a triggering event for switching the CPU frequency occurs, the power controller 114 controls the LDO 130 to output a default voltage and triggers the clock controller 120 to switch the first CPU frequency (e.g., the current operating frequency). After the clock controller 120 switches the first CPU frequency, the clock counter 112 counts the number of times the CPU clock occurs during the period to obtain a second CPU frequency (e.g., the target operating frequency or a frequency close thereto). The power controller 114 determines the corresponding voltage of the second CPU frequency and controls the LDO 130 to output the corresponding voltage. In other words, information related to the CPU operating frequency is first obtained, and then the appropriate LDO voltage is adjusted accordingly for LDO output. In other words, the LDO voltage (or power level) is automatically controlled / adjusted by hardware. It is worth noting that the first CPU frequency and the second CPU frequency may refer to the operating frequency of the CPU 150 and may be used interchangeably with the system frequency, but the present application is not limited thereto.

[0020] In some embodiments, the power controller 114 may substitute the second CPU frequency into a non-decreasing function to obtain a corresponding voltage. The non-decreasing function may include at least one of a step function and an increasing continuous function. The non-decreasing function may be obtained from simulation results during the MCU development phase. That is, the CPU operating frequency is used as an input value X of the function, and the LDO voltage is used as an output value Y of the function. FIG. 2A to FIG. 2D FIG. 1 is a functional schematic diagram of a power control method for a microcontroller unit according to an embodiment of the present application. Figure 2A As shown, the non-decreasing function can be a step function. Figure 2B As shown in , the non-decreasing function can be a combination of multiple segmented step functions. Figure 2C As shown, the non-decreasing function may be an increasing continuous function, for example, it may be expressed as Y=a*tanh(Xb)+c, and the parameters (a, b, c) may be fixed values ​​or adjustable values ​​(for example, via Config or ROMMAP). Figure 2DAs shown, the non-decreasing function can be a combination of multiple segmented increasing continuous functions. It is worth noting that the above function diagram is only an exemplary embodiment, but the present application is not limited thereto. For example, the non-decreasing function can be a combination of a step function and an increasing continuous function.

[0021] In some embodiments, the clock counter 112 can count the number of times the CPU clock occurs during a period based on a high internal RC oscillator (HIRC) clock. The length of the period is related to (e.g., inversely proportional to) the frequency of the HIRC clock. For example, when a HIRC with a frequency of 12 MHz is used for counting, the length of the period is 83.3 ns. It is worth noting that if the CPU clock cannot be counted (or the second CPU frequency cannot be obtained), it means that the frequency of the CPU clock is lower than the frequency of the HIRC clock. It is worth noting that although the oscillator is HIRC as an example, the present application is not limited to this.

[0022] In some embodiments, the default voltage may be the highest voltage supported by the MCU 100. That is, when the CPU target frequency may be unknown, the power controller 114 controls the LDO to output the highest voltage to be applicable to all CPU operating frequencies. It is worth noting that although setting the highest voltage consumes more power, it can be cut down after determining the corresponding voltage. Conversely, setting a lower highest voltage saves more power, but there may be a problem of not being able to cut up.

[0023] In some embodiments, the triggering event for switching the CPU frequency may include: at least one of an instruction to switch the CPU clock source and an instruction to divide the frequency is received (e.g., by the clock controller 120). For example, the software may first set the CPU target frequency (e.g., switch to the CPU clock). After the power controller 114 controls the LDO to output a default voltage, the hardware (including the clock controller, the power controller, etc.) may actually switch to the CPU target frequency.

[0024] In some embodiments, after controlling the LDO 130 to output a default voltage, the power controller 114 may trigger the clock controller to switch the first CPU frequency.

[0025] In some embodiments, after a trigger event for switching CPU frequency occurs, the power controller 114 may receive a first trigger signal from the clock controller 120 to trigger the power controller 114 to control the LDO 130 to output a default voltage and trigger the clock controller 120 to switch the first CPU frequency.

[0026] In some embodiments, after controlling the LDO 130 to output a default voltage, the power controller 114 may transmit a switching notification to the clock controller 120 to trigger the clock controller 120 to switch from the first CPU frequency to the CPU target frequency (eg, equal to the second CPU frequency).

[0027] In some embodiments, after the clock controller 120 switches the first CPU frequency, the clock counter 112 may receive a second trigger signal from the clock controller 120 to trigger the clock counter 112 to count the number of times the CPU clock occurs during the period.

[0028] According to the above embodiments, the following power control method can be obtained (eg, summarized). Figure 3 FIG. 1 is a flow chart of a power control method for a microcontroller unit according to an embodiment of the present application. Figure 3 As shown, the power control method includes the following steps:

[0029] In step S302, a triggering event for switching the CPU frequency occurs.

[0030] In step S304, the power controller controls the LDO to output a maximum voltage.

[0031] In step S306, the power controller triggers the clock controller to switch the first CPU frequency.

[0032] In step S308, the number of times the CPU clock occurs during the period is counted by a clock counter to obtain a second CPU frequency.

[0033] In step S310 , a power controller is used to determine a voltage corresponding to a second CPU frequency, and the LDO is controlled to output the corresponding voltage.

[0034] In summary, the power control method for a microcontroller unit and the power control system using the same of the present application first obtain the CPU operating frequency, and then adjust the appropriate LDO voltage for LDO output accordingly. In short, the LDO voltage (or power level) can be automatically controlled by hardware. Therefore, in addition to not having to manually set it through software, it can also avoid the situation where the setting error causes the system to be abnormal or unnecessary power consumption. In addition, more and finer LDO voltage adjustments can be provided for the CPU operating frequency.

[0035] Although the present application has been disclosed using the above-mentioned embodiments, they are not intended to limit the present application. Any person skilled in the art may make various changes and modifications to the above-mentioned embodiments without departing from the spirit and scope of the present application, and the changes and modifications still fall within the technical scope protected by the present application. Therefore, the scope of protection of the present application shall be based on the definition of the claims.

Claims

1. A power control method for a microcontroller unit, characterized in that: After a trigger event for switching the frequency of the central processing unit occurs, the power controller is used to control the low voltage drop linear regulator to output a default voltage, and the clock controller is triggered to switch the frequency of the first central processing unit; After the clock controller switches the first central processing unit frequency, the clock counter counts the number of times the central processing unit clock occurs during the period to obtain a second central processing unit frequency; as well as The power controller determines the voltage corresponding to the frequency of the second central processing unit, and controls the low voltage drop linear regulator to output the corresponding voltage.

2. The power control method according to claim 1, characterized in that: The second central processing unit frequency is substituted into a non-decreasing function by the power controller to obtain the corresponding voltage, wherein the non-decreasing function includes at least one of a step function and an increasing continuous function.

3. The power control method according to claim 1, characterized in that: According to the internal high-speed oscillator clock, the number of times the central processing unit clock occurs within the period is counted by the clock counter, wherein the time length of the period is related to the frequency of the internal high-speed oscillator clock.

4. The power control method according to claim 1, characterized in that: The default voltage is the highest voltage supported by the microcontroller unit.

5. The power control method according to claim 1, characterized in that: The triggering event for switching the CPU frequency includes: at least one of a command for switching a CPU clock source and a frequency division command is received.

6. A power control system for a microcontroller unit, characterized in that: A clock counter, electrically connected to the clock controller, is used to: After the clock controller switches the first central processing unit frequency, counting the number of times the central processing unit clock occurs during the period to obtain a second central processing unit frequency; as well as A power controller is electrically connected to the clock counter, the clock controller and the low voltage drop linear regulator, and is used for: After a trigger event for switching the frequency of the central processing unit occurs, controlling the low voltage drop linear regulator to output a default voltage, and triggering the clock controller to switch the frequency of the first central processing unit; as well as A voltage corresponding to the frequency of the second central processing unit is determined, and the low voltage drop linear regulator is controlled to output the corresponding voltage.

7. The power control system according to claim 6, characterized in that: The power controller substitutes the second central processing unit frequency into a non-decreasing function to obtain the corresponding voltage, wherein the non-decreasing function includes at least one of a step function and an increasing continuous function.

8. The power control system according to claim 6, characterized in that: The clock counter counts the number of times the CPU frequency occurs within the period according to the internal high speed oscillator clock, wherein the time length of the period is related to the frequency of the internal high speed oscillator clock.

9. The power control system according to claim 6, characterized in that: The default voltage is the highest voltage supported by the microcontroller unit.

10. The power control system according to claim 6, characterized in that: The triggering event for switching the CPU frequency includes: at least one of a command for switching the CPU clock source and a frequency division command is received.