System and method for realizing automatic low power consumption of MCU (Microprogrammed Control Unit)

By designing a system including core, clock selection control module, clock selection switch module and low-power control logic module, the problem of complicated operation process and complex emergency handling of MCU entering a low-power state is solved, and rapid and efficient The effect of entering a low power state and safe exit.

CN119472970APending Publication Date: 2025-02-18CHENGDU HUANYUXIN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411459864.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The operation process of the MCU entering a low-power state in the prior art is complicated and time-consuming. When an emergency occurs, judgment and processing are complicated and difficult to respond quickly.

Method used

A system including a core, a clock selection control module, a clock selection switch module and a low-power control logic module is designed. The low-power control logic module receives kernel instructions, notifies the clock selection control module to switch the working clock, and gradually close other things. Clock source to quickly enter a low-power state. At the same time, an event monitoring module is introduced to monitor emergencies in real time and exit the low-power consumption process in a timely manner.

Benefits of technology

It reduces the operation process, improves the speed and efficiency of the MCU entering a low-power state, can quickly respond to emergencies, safely exit the low-power process, reduces software intervention, and achieves the efficient and low-risk effect of low-power control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119472970A_ABST
    Figure CN119472970A_ABST
Patent Text Reader

Abstract

The invention provides a system for realizing automatic low power consumption of an MCU (Microprogrammed Control Unit), which relates to the technical field of digital integrated circuits and is mainly structurally characterized in that a low power consumption control logic module is used for receiving an instruction for entering a low power consumption state issued by a kernel and informing a clock selection control module of the instruction; the switching module is also used for gradually closing the multiple clock sources according to a preset sequence and receiving closing state signals returned by the corresponding clock sources after the chip working clock is switched to one preset clock source; the clock selection control module is used for notifying the clock selection switch module to switch a chip working clock to one predetermined clock source under the instruction of the low-power-consumption control logic module; and the clock selection switch module is used for executing an instruction of the clock selection control module to select a corresponding clock source as a chip working clock. The invention also provides a method for realizing automatic low power consumption of the MCU. According to the invention, the operation process can be reduced, so that the MCU quickly and efficiently enters a low-power-consumption state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital integrated circuits, and in particular to a system and method for realizing an MCU to automatically enter low power consumption. Background Art

[0002] For MCU type chips, there are generally multiple clock sources. In different working scenarios, different clocks can be selected as the working clock of the chip. At the same time, the core can send low-power instructions to turn off the clocks of all units to achieve lower power consumption. In this way, dynamic power consumption can be minimized to achieve the best chip working efficiency and working energy consumption.

[0003] Figure 1 The following is a flow chart of a prior art MCU automatically entering low power consumption, taking an MCU chip driven by four clock sources as an example. Figure 1 The components of each block diagram unit are: 4 clock sources CLK1, CLK2, CLK3, and CLK4 represent a certain type of clock, such as RC oscillator, external crystal oscillator, etc.; the core is a certain type of processor, such as ARM M3, RISCV, etc.; the clock enable logic module and the clock selection control module are both clock state control units implemented by digital code.

[0004] Before entering low power consumption, it is necessary to configure the switching clock so that the MCU enters the normal working state. The operations performed include: issuing clock switching instructions through the software control core; after the clock selection control module receives the instruction, it selects one of the four clock sources as the working clock of the chip.

[0005] When the MCU chip needs lower power output and enters a low power state, the following operations need to be completed:

[0006] The kernel issues a low-power sleep instruction;

[0007] After receiving the low power consumption instruction, the clock enable logic module and the clock selection control module will shut down all clock sources respectively;

[0008] In the process of shutting down the clock source, you need to first determine the current MCU's working clock from CLK1 / CLK2 / CLK3 / CLK4; after confirmation, shut down the other three non-working clock sources; after determining that the other three clock sources are shut down, finally shut down the clock source that serves as the working clock.

[0009] During the process of entering low power consumption, if an unexpected event such as an exception, interruption, or early wake-up occurs, you need to exit the entry process immediately.

[0010] The above operation mode has many control processes, and the interaction between the clock source and the core is time-consuming and cumbersome. If an exception, interruption, or wake-up occurs during the entry process, the current low-power process needs to be terminated and the chip status restored. The recovery process is difficult to judge and complicated to handle. Summary of the invention

[0011] The purpose of the present invention is to solve the problems of complicated operation process and long time to enter the process in the prior art, and to propose a new technical solution that can reduce the operation process and enable the MCU to enter a low power consumption state quickly and efficiently.

[0012] The technical solution adopted by the present invention to achieve its invention purpose is a system for realizing MCU to automatically enter low power consumption, including a core, a clock selection control module, a clock selection switch module, and a low power consumption control logic module, wherein:

[0013] The low-power control logic module is used to receive the instruction of entering the low-power state issued by the core and notify the clock selection control module of the instruction, and is also used to gradually shut down multiple clock sources in a predetermined order after the chip working clock is switched to one of the predetermined clock sources and receive the shutdown state signal returned by the corresponding clock source;

[0014] The clock selection control module is used to notify the clock selection switch module to switch the chip working clock to one of the predetermined clock sources under the instruction of the low power control logic module;

[0015] The clock selection switch module is used to execute the instruction of the clock selection control module to select the corresponding clock source as the chip working clock.

[0016] Further, the system also includes an event monitoring module, which is used to monitor and record event inputs in real time and record the current clock state after monitoring the instruction to enter the low power consumption state issued by the kernel, and is also used to send a request to exit the low power consumption process to the low power consumption control logic module after monitoring the event input;

[0017] The low power control logic module is also used to restore all clock sources to their previous states after receiving a request to exit the low power process from the event monitoring module, and to notify the clock selection control module to restore the chip working clock to the state before entering low power consumption.

[0018] Furthermore, the event input includes abnormalities, interruptions and wake-up emergencies during the process of entering low power consumption.

[0019] The present invention also provides a method for realizing that the MCU automatically enters low power consumption, comprising the following steps:

[0020] S1, the core issues an instruction to enter a low power consumption state;

[0021] S2, the low power consumption control logic module receives the instruction to enter the low power consumption state and notifies the clock selection control module of the instruction;

[0022] S3, the clock selection control module notifies the clock selection switch module to switch the chip working clock to one of the predetermined clock sources;

[0023] S4, the clock selection switch module switches the chip working clock from the current clock source to one of the predetermined clock sources;

[0024] S5. After the chip working clock is switched, the low-power control logic module gradually shuts down other clock sources except the working clock after the switch.

[0025] S6. After other clock sources are completely turned off, the low-power control logic module is finally turned off and switched to serve as the clock source of the working clock, and the chip enters a low-power state.

[0026] Furthermore, the method also comprises the following steps:

[0027] S1', the event monitoring module monitors the instructions issued by the kernel to enter the low power state in real time;

[0028] S2', after monitoring that the instruction to enter the low power consumption state is issued, the event monitoring module starts to monitor and record event input in real time, and records the current clock state;

[0029] S3', after monitoring the event input, the event monitoring module sends a request to exit the low power consumption process to the low power consumption control logic module;

[0030] S4', after receiving the request to exit the low power consumption process, the low power consumption control logic module restores all clock sources to the previous state;

[0031] S5', the low power control logic module notifies the clock selection control module to restore the chip working clock to the state before entering low power consumption;

[0032] S6', the clock selection switch module executes the instruction of the clock selection control module to switch the chip working clock to the clock source used before entering low power consumption.

[0033] Furthermore, the event input includes abnormalities, interruptions and wake-up emergencies during the process of entering low power consumption.

[0034] The beneficial effects of the present invention are:

[0035] After the system recognizes the instruction issued by the kernel to enter the low-power state, it does not need to determine the clock source of the current chip working clock, thereby reducing the operation process. At the same time, the hardware automatically turns off all clocks, allowing the chip to quickly and efficiently enter the low-power state. At the same time, for abnormalities, interruptions, and wake-up emergencies during the low-power process, respond in advance and exit the low-power process safely to ensure that the kernel can correctly respond to the above emergencies. Through hardware automation, efficient and low-risk entry and exit of the low-power process is achieved, software intervention is reduced, and the efficient and low-risk effect of low-power control is truly achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the structure of a low-power consumption control system in the prior art;

[0037] Figure 2 This is a schematic diagram of the system structure of Example 1 of the present invention;

[0038] Figure 3 This is a flow model diagram of the MCU entering low power consumption in Embodiment 2 of the present invention;

[0039] Figure 4 This is a model diagram of the monitoring emergency event processing process in Example 2 of the present invention;

[0040] Figure 5 The figure is a schematic diagram of the overall process of the MCU entering low power consumption according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] Example 1

[0043] Figure 2 A specific implementation method of the system for realizing the automatic entry of MCU into low power consumption in the present invention is shown, including a core, a clock selection control module, a clock selection switch module, a low power consumption control logic module, and an event monitoring module. In this embodiment, there are 4 clock sources CLK1, CLK2, CLK3, and CLK4 connected to the clock selection switch module, wherein:

[0044] The low-power control logic module is used to receive the instruction of entering the low-power state issued by the core and notify the clock selection control module of the instruction, and is also used to gradually shut down multiple clock sources in a predetermined order after the chip working clock is switched to the predetermined clock source CLK1 and receive the shutdown state signal returned by the corresponding clock source;

[0045] The low power control logic module is also used to restore all clock sources to their previous states after receiving a request to exit the low power process from the event monitoring module, and to notify the clock selection control module to restore the chip working clock to the state before entering the low power process;

[0046] The clock selection control module is used to notify the clock selection switch module to switch the chip working clock to the predetermined clock source CLK1 under the instruction of the low power control logic module;

[0047] The clock selection switch module is used to execute the instruction of the clock selection control module to select the clock source CLK1 as the chip working clock;

[0048] The event monitoring module is used to monitor and record event inputs in real time and record the current clock state after monitoring the instruction to enter the low power consumption state issued by the kernel, and is also used to send a request to exit the low power consumption process to the low power consumption control logic module after monitoring the event input;

[0049] The event input includes exceptions, interrupts and wake-up emergencies during entry into low power consumption.

[0050] Example 2

[0051] Figures 3 to 5 A specific implementation of the method for realizing the automatic entry of MCU into low power consumption according to the present invention is shown.

[0052] In this embodiment, a total of 4 clock sources CLK1, CLK2, CLK3, and CLK4 are used. Before entering low power consumption, the clock needs to be configured so that the MCU enters a normal working state. The operations performed include:

[0053] The kernel sends down the configuration and selects the working clock of the chip;

[0054] The clock selection control module processes the kernel-issued configuration and outputs the relevant control signals to the clock selection switch module;

[0055] The clock selection switch module switches the working clock of the chip according to the received instructions;

[0056] The clock signal output by the clock selection switch module is used as the chip working clock Clk_sys, which is driven to each module of the chip respectively, and the MCU enters the normal working state.

[0057] The key operations that need to be implemented when the MCU enters a low-power state are: first turn off the clock source in the idle state, and the clock source that serves as the chip's working clock needs to be processed last; after the idle clock source is normally turned off, the clock source that serves as the chip's working clock can be turned off, otherwise the entire low-power process cannot be completed. Based on reducing the judgment of the currently used clock source, the method for the MCU in this embodiment to enter a low-power state from a normal working state includes the following steps:

[0058] S1, the core issues an instruction to enter a low power consumption state;

[0059] S2, the low power consumption control logic module receives the instruction to enter the low power consumption state and notifies the clock selection control module of the instruction;

[0060] S3, the clock selection control module notifies the clock selection switch module to switch the chip working clock to the predetermined clock source CLK1;

[0061] S4, the clock selection switch module switches the chip working clock from the current clock source to the clock source CLK1;

[0062] S5. After the chip working clock is switched, the low-power control logic module gradually turns off the other three clock sources, namely CLK2, CLK3, and CLK4.

[0063] S6. After the clock sources CLK2, CLK3, and CLK4 are completely turned off, the low-power control logic module finally turns off the clock source CLK1, and the chip enters a low-power state.

[0064] In order to deal with abnormalities, interruptions and wake-up emergencies during the process of entering the low power consumption state, this embodiment also has the following steps:

[0065] S1', the event monitoring module monitors the instructions issued by the kernel to enter the low power state in real time;

[0066] S2', after monitoring that the instruction to enter the low power consumption state is issued, the event monitoring module starts to monitor and record event input in real time, and records the current clock state; the event input includes abnormalities, interruptions and wake-up emergencies during the process of entering the low power consumption state;

[0067] S3', after monitoring the event input, the event monitoring module sends a request to exit the low power consumption process to the low power consumption control logic module;

[0068] S4', after receiving the request to exit the low power consumption process, the low power consumption control logic module restores all clock sources to the previous state;

[0069] S5', the low power control logic module notifies the clock selection control module to restore the chip working clock to the state before entering low power consumption;

[0070] S6', the clock selection switch module executes the instruction of the clock selection control module to switch the chip working clock to the clock source used before entering low power consumption.

[0071] The above embodiments of the present invention are merely examples for illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes and modifications can be made based on the above description. It is impossible to list all the embodiments here. Any obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A system for realizing MCU to automatically enter low power consumption, characterized in that: It includes a core, a clock selection control module, a clock selection switch module, and a low-power control logic module, among which: The low-power control logic module is used to receive the instruction of entering the low-power state issued by the core and notify the clock selection control module of the instruction, and is also used to gradually shut down multiple clock sources in a predetermined order after the chip working clock is switched to one of the predetermined clock sources and receive the shutdown state signal returned by the corresponding clock source; The clock selection control module is used to notify the clock selection switch module to switch the chip working clock to one of the predetermined clock sources under the instruction of the low power control logic module; The clock selection switch module is used to execute the instruction of the clock selection control module to select the corresponding clock source as the chip working clock.

2. A system for realizing MCU automatically entering low power consumption according to claim 1, characterized in that: It also includes an event monitoring module, which is used to monitor and record event inputs in real time and record the current clock state after monitoring the instruction to enter the low power consumption state issued by the kernel, and is also used to send a request to exit the low power consumption process to the low power consumption control logic module after monitoring the event input; The low power control logic module is also used to restore all clock sources to their previous states after receiving a request to exit the low power process from the event monitoring module, and to notify the clock selection control module to restore the chip working clock to the state before entering low power consumption.

3. A system for realizing MCU automatically entering low power consumption according to claim 2, characterized in that: The event input includes exceptions, interrupts and wake-up emergencies during entry into a low power consumption process.

4. A method for realizing MCU automatically entering low power consumption, characterized in that: The steps include: S1, the core issues an instruction to enter a low power consumption state; S2, the low power consumption control logic module receives the instruction to enter the low power consumption state and notifies the clock selection control module of the instruction; S3, the clock selection control module notifies the clock selection switch module to switch the chip working clock to one of the predetermined clock sources; S4, the clock selection switch module switches the chip working clock from the current clock source to one of the predetermined clock sources; S5. After the chip working clock is switched, the low-power control logic module gradually shuts down other clock sources except the working clock after the switch. S6. After other clock sources are completely turned off, the low-power control logic module is finally turned off and switched to serve as the clock source of the working clock, and the chip enters a low-power state.

5. A method for realizing automatic entry of MCU into low power consumption according to claim 4, characterized in that: The following steps are also included: S1', the event monitoring module monitors the instructions issued by the kernel to enter the low power state in real time; S2', after monitoring that the instruction to enter the low power consumption state is issued, the event monitoring module starts to monitor and record event input in real time, and records the current clock state; S3', after monitoring the event input, the event monitoring module sends a request to exit the low power consumption process to the low power consumption control logic module; S4', after receiving the request to exit the low power consumption process, the low power consumption control logic module restores all clock sources to the previous state; S5', the low power control logic module notifies the clock selection control module to restore the chip working clock to the state before entering low power consumption; S6', the clock selection switch module executes the instruction of the clock selection control module to switch the chip working clock to the clock source used before entering low power consumption.

6. The method for realizing automatic low power consumption of MCU according to claim 5, characterized in that: The event input includes exceptions, interrupts and wake-up emergencies during entry into a low power consumption process.