Method for realizing autonomous dynamic linkage power consumption reduction of peripheral equipment by MCU (microprogrammed control Unit)

文档序号:1337223 发布日期:2020-07-17 浏览:16次 中文

阅读说明:本技术 一种mcu实现外设自主动态联动降功耗的方法 (Method for realizing autonomous dynamic linkage power consumption reduction of peripheral equipment by MCU (microprogrammed control Unit) ) 是由 熊海峰 周建政 姜伟巍 于 2020-06-10 设计创作,主要内容包括:本发明公开了一种MCU实现外设自主动态联动降功耗的方法,包括CPU模块、事件中心模块和多个外设单元,还包括以下步骤:事件中心模块在低功耗模式下对外设单元发出的外设信号进行响应,并与睡眠前预登记的事件信号相匹配;若不匹配则不予理会;若匹配则根据预登记的事件用户信息或者自主触发其他外设单元工作,或者唤醒CPU模块;事件中心模块接管CPU模块的大部分工作,CPU模块长时间处于低功耗休眠状态;事件中心模块接收外设单元的信号,再触发控制其他外设单元工作,实现外设单元间自主联动,不要CPU的参与即可正常工作;仅仅遇到小部分特殊事件时,事件中心模块才唤醒CPU模块进行处理,使得唤醒CPU模块工作的次数大大降低,达到真正意义上的低功耗。(The invention discloses a method for realizing the autonomous dynamic linkage power consumption reduction of peripheral equipment by an MCU (microprogrammed control Unit), which comprises a CPU (Central processing Unit) module, an event center module and a plurality of peripheral equipment units, and further comprises the following steps: the event center module responds to an external signal sent by an external unit in a low power consumption mode and is matched with a pre-registered event signal before sleep; if not, then not taking care; if the event information is matched with the event information, other peripheral units are triggered to work autonomously or the CPU module is awakened according to the pre-registered event user information; the event center module takes over most of the work of the CPU module, and the CPU module is in a low-power-consumption dormant state for a long time; the event center module receives signals of the peripheral units and triggers and controls other peripheral units to work, so that the peripheral units are automatically linked and can normally work without the participation of a CPU; when only a small part of special events are encountered, the event center module wakes up the CPU module for processing, so that the work frequency of waking up the CPU module is greatly reduced, and low power consumption is achieved in the true sense.)

1. A method for realizing peripheral automatic dynamic linkage power consumption reduction by an MCU (microprogrammed control Unit), which is characterized by comprising a CPU (Central processing Unit) module, an event center module and a plurality of peripheral units, wherein the event center module is connected with the peripheral units through an APB (advanced peripheral bus) protocol, and the event center module is connected with the peripheral units through the APB protocol, and further comprising the following steps:

the event center module responds to an external signal sent by an external unit in a low power consumption mode and is matched with a pre-registered event signal before sleep;

if not, then not taking care;

and if the event information is matched with the pre-registered event user information, triggering other peripheral units to be automatically interconnected or awakening the CPU module.

2. The method for realizing the autonomous dynamic linkage power consumption reduction of the MCU according to claim 1, wherein the event center module comprises an event registration unit, and the event registration unit registers the peripheral unit before the event center module responds to the peripheral signal sent by the peripheral unit, wherein the peripheral unit comprises an event occurrence source and an event receiving user, the event occurrence source is used for sending the peripheral signal, and the event receiving user receives the trigger signal of the event center module to work.

3. The method for realizing the autonomous dynamic linkage power consumption reduction of the peripheral equipment by the MCU according to claim 2, wherein the event center module further comprises an event logout unit, and before the event center module responds to the peripheral equipment signal sent by the peripheral equipment unit, the event logout unit logs out the peripheral equipment unit which is registered and registered.

4. The MCU of claim 2, wherein the event center module comprises an event filtering unit, and after the event filtering unit is matched with the registered event signal, if the peripheral signal at this time is not matched with the registered event signal, the peripheral signal is filtered.

5. The MCU of claim 2, wherein the event center module comprises an event trigger unit, and after the event trigger unit is matched with the registered event signal, if the peripheral signal of this time is matched with the registered event signal, the peripheral unit corresponding to the event trigger unit is triggered to be linked.

6. The MCU of claim 2, wherein after determining that the current peripheral signal matches the registered event signal, the event center module further determines the authority of the registered event, triggers the peripheral unit to operate if it is determined that the peripheral unit has authority to process, and wakes up the CPU module to process if it is determined that the peripheral unit has no authority to process.

7. The MCU of claim 6, wherein the event center module performs authority judgment according to the complexity and importance of events and divides the events into primary events needing to be processed by the CPU module and secondary events not needing to be processed by the CPU module.

8. The MCU of claim 7, wherein the event center module comprises a counting unit for counting the primary events, and waking up the CPU module when the number of the primary events exceeds a predetermined value; the counting unit counts the secondary events, the CPU module is awakened when the number of the secondary events exceeds a set value, and the preset value is smaller than the set value.

9. The method for realizing the peripheral autonomous dynamic linkage power consumption of the MCU of claim 1, wherein the event center module is a digital circuit with a low power consumption voltage domain, and the clock frequency of the digital circuit is 1 KHz.

10. The MCU of claim 1, further comprising an NMI unit for generating non-maskable abnormal signals, wherein the CPU module comprises a WIC unit, a CPU core unit and a power management unit, the WIC unit receives the signals of the NMI unit, the wake-up signal generated by the event center module and the interrupt signal generated by the peripheral unit, and the WIC unit controls the CPU core unit and the power management unit to work.

Technical Field

The invention belongs to the field of MCU processors, and particularly relates to a method for realizing autonomous dynamic linkage power consumption reduction of an MCU (microprogrammed control Unit).

Background

In recent years, with the increase of the performance of the MCU, the power consumption of the MCU is increasing, so that the MCU with low power consumption needs to be set.

The existing MCU can set several different voltage domains inside, then set several different low power consumption modes respectively, software can make the CPU enter different low power consumption modes according to different requirements through configuration, and the different low power consumption modes correspond to the switch control logics of different voltage domains inside the chip. In addition, the traditional MCU design can dynamically adjust the working state of the MCU by adjusting the main frequency of the CPU, thereby reducing the overall power consumption of the MCU in the working process. As shown in fig. 1, in the low power consumption mode, the ADC external device collects data every 5 seconds, compares the data with a register threshold set by software, continues to sleep if the data is lower than the threshold, and wakes up the CPU to control a wireless communication module to upload the data collected by the ADC to the cloud platform of the user through the serial port if the data is higher than the threshold.

In the whole process, the ADC starts conversion, and the threshold comparison after the conversion is finished needs the participation of the CPU, and the CPU is awakened to process a task once every 5 seconds. Although power consumption is saved compared with the mode of long-term operation of the CPU, the wake-up frequency is too high for the CPU, so that the average dynamic power consumption of the whole process is large. Even if the power consumption of the CPU is reduced by reducing the working frequency of the CPU, the reduction space is limited, the power consumption is increased due to too many awakening times of the CPU, and the problem that the power consumption of the MCU is high is difficult to solve from the root cause.

Disclosure of Invention

The invention aims to provide a method for realizing the autonomous dynamic linkage power consumption reduction of a peripheral by an MCU (microprogrammed control Unit).

In order to achieve the purpose of the invention, the technical scheme adopted by the invention is as follows: a method for realizing the automatic and dynamic linkage power consumption reduction of peripheral equipment by an MCU comprises a CPU module, an event center module and a plurality of peripheral equipment units, wherein the event center module is connected with the plurality of peripheral equipment units through an APB bus protocol, and the method further comprises the following steps:

the event center module responds to an external signal sent by an external unit in a low power consumption mode and is matched with a pre-registered event signal before sleep;

if not, then not taking care;

and if the event information is matched with the pre-registered event user information, triggering other peripheral units to be automatically interconnected or awakening the CPU module.

Preferably, the event center module includes an event registration unit, and before the event center module responds to the peripheral signal sent by the peripheral unit, the event registration unit registers the peripheral unit, the peripheral unit includes an event occurrence source and an event receiving user, the event occurrence source is used for sending the peripheral signal, and the event receiving user receives the trigger signal of the event center module to operate.

Preferably, the event center module further includes an event logout unit, and before the event center module responds to the peripheral signal sent by the peripheral unit, the event logout unit logs out the registered peripheral unit.

Preferably, the event center module includes an event filtering unit, and after the event signal is matched with the registered event signal, if the peripheral signal of this time is not matched with the registered event signal, the peripheral signal is filtered.

Preferably, the event center module includes an event trigger unit, and after the event trigger unit matches with the registered event signal, if the peripheral signal of this time matches with the registered event signal, the event center module triggers the corresponding peripheral unit to be linked.

Preferably, after the peripheral signal of this time is judged to be matched with the registered event signal, the event center module is further included to judge the authority of the registered event, if the peripheral signal is judged to have authority processing, the peripheral unit is triggered to work, and if the peripheral signal is judged to have no authority processing, the CPU module is awakened to process.

Preferably, the event center module performs authority judgment according to the complexity and the importance of the event, and divides the event into a primary event needing to be processed by the CPU module and a secondary event not needing to be processed by the CPU.

Preferably, the event center module includes a counting unit, configured to count a primary event, and wake up the CPU module when the primary event exceeds a predetermined value, and the counting unit counts a secondary event, and wakes up the CPU module when the number of secondary events exceeds a set value, and the predetermined value is smaller than the set value.

Preferably, the event center module is a digital circuit having a low power consumption voltage domain, and the clock frequency of the digital circuit is 1 KHz.

Preferably, the system further comprises an NMI unit for generating an unshieldable exception signal, the CPU module comprises a WIC unit, a CPU core unit and a power management unit, the WIC unit receives a signal of the NMI unit, a wake-up signal generated by the event center module and an interrupt signal generated by the peripheral unit, and the WIC unit controls the CPU core unit and the power management unit to operate.

The invention has the following beneficial effects: the invention discloses a method for realizing peripheral automatic dynamic linkage power consumption reduction by an MCU (microprogrammed control unit), which comprises a CPU (Central processing Unit) module, an event center module and a plurality of peripheral units, wherein the event center module is connected with the plurality of peripheral units through an APB (advanced peripheral bus) protocol, and the method also comprises the following steps: the event center module responds to an external signal sent by an external unit in a low power consumption mode and is matched with a pre-registered event signal before sleep; if not, then not taking care; if the event information is matched with the event information, other peripheral units are triggered to work autonomously or the CPU module is awakened according to the pre-registered event user information.

By setting the event center module to take over most of the work of the CPU module, the CPU module can be in a low-power consumption dormant state for a long time; the event center module can receive signals of the peripheral units and then trigger and control other corresponding peripheral units to work, so that the peripheral units are automatically linked and can normally work without the participation of a CPU (central processing unit); only when a small part of special events occur, the event center module wakes up the CPU module to process the special events, so that the work frequency of waking up the CPU module is greatly reduced, and the low power consumption in the true sense is achieved.

Drawings

FIG. 1 is a logic block diagram of the prior art;

FIG. 2 is a schematic logic block diagram of the present invention;

FIG. 3 is a detailed logic block diagram of the present invention;

FIG. 4 is a schematic diagram of the operation of the present invention;

FIG. 5 is a schematic diagram of the operation of the present invention;

fig. 6 is a schematic diagram of the operation of the embodiment of the present invention.

Detailed Description

At present, the development direction of the MCU chip is mainly to realize low power consumption, low cost and high integration. The MCU chip is mainly applied to low-energy-consumption machine control, portable medical electronics, high-precision sensor control, wireless data transmission, battery power management and the like. The MCU chip not only needs ultra-low static power consumption, but also needs to have finely controlled dynamic power consumption, to finely manage the operating energy consumption of the MCU, and to realize low power consumption of the overall scheme, and how to finely control dynamic energy consumption will be described in detail below with specific embodiments.

As shown in fig. 2 and 4, a method for implementing peripheral autonomous dynamic linkage power consumption reduction by an MCU includes a CPU module, an event center module, and a plurality of peripheral units, and further includes the following steps: the event center module responds to an external signal sent by an external unit in a low power consumption mode and is matched with a pre-registered event signal before sleep; if not, then not taking care; if the event information is matched with the event information, other peripheral units are triggered to work autonomously or the CPU module is awakened according to the pre-registered event user information. By setting the event center module to take over most of the work of the CPU module, the CPU module can be in a low-power consumption dormant state for a long time; the event center module can receive signals of the peripheral units and then trigger and control other corresponding peripheral units to work, so that the peripheral units are automatically linked and can normally work without the participation of a CPU (central processing unit); only when a small part of special events occur, the event center module wakes up the CPU module to process the special events, so that the work frequency of waking up the CPU module is greatly reduced, and the low power consumption in the true sense is achieved.

Referring to fig. 4 and 5, the event center module of this embodiment includes an event registration unit, and before the event center module responds to the peripheral signal sent by the peripheral unit, the event registration unit registers the peripheral unit, where the peripheral unit includes an event occurrence source and an event receiving user, the event occurrence source is used to send the peripheral signal, and the event receiving user receives the trigger signal of the event center module to operate. The event source is not only a party that generates a signal, but may also be an event recipient user among other events. The same event receiving user is not only a party of signal reception, but may also play a role of an event occurrence source in other events. The event center module manages the event source and the event receiving users, the event in the authority of the event center module can inform the corresponding event receiving users to process, and the CPU module is awakened to work if the authority is exceeded.

The event center module of this embodiment further includes an event logout unit, and before the event center module responds to the peripheral signal sent by the peripheral unit, the event logout unit logs out the peripheral unit that has already registered. The method can avoid interference of other unimportant information, and can cancel and delete the original registered event after the working environment is changed. The event center module of this embodiment includes an event filtering unit, and after matching with the registered event signal, if the peripheral signal of this time does not match with the registered event signal, the peripheral signal is filtered. The event center module of this embodiment includes an event trigger unit, and after matching with the registered event signal, if the current peripheral signal matches with the registered event signal, the corresponding peripheral unit is triggered to be linked. And the independent interconnection of peripheral units irrelevant to the CPU module is realized, and the power consumption of the CPU module is reduced.

Referring to fig. 2 and fig. 3, after determining that the peripheral signal of this time matches the registered event signal, the embodiment further includes that the event center module performs permission determination on the registered event, if it is determined that there is permission processing on itself, the peripheral unit is triggered to work, and if it is determined that there is no permission processing on itself, the CPU module is awakened, and the permission determination manner includes the number of events to be processed, the importance degree of the events to be processed, or a combination of the two, but is not limited thereto. After the CPU module is awakened to process the event, the CPU module continues to sleep again to keep the low power consumption mode.

Referring to fig. 3, the event center module of the present embodiment performs authority determination according to the complexity and importance of the event, and divides the event into a primary event that needs to be processed by the CPU module and a secondary event that does not need to be processed by the CPU. The event center module of this embodiment includes a counting unit, which is used to count the primary events, and wake up the CPU module when the primary events exceed a predetermined value. The counting unit can also count the secondary events, and when the number of the secondary events exceeds a set value, the CPU module can be awakened to process, and certainly, the set value needs to be greater than a predetermined value. Meanwhile, the judgment can be carried out in a combined manner according to the importance of the events and the number of corresponding events, for example, the CPU module can be awakened when the number of secondary events is too large or the number of important events is small.

The event center module of the present embodiment is a digital circuit having a low power consumption voltage domain, and the clock frequency of the digital circuit is 1 KHz. The event center module can be named as a tinword event center, and the digital circuit adopted by the event center module corresponds to a special voltage domain in the chip, and the voltage domain has ultralow static power consumption. In the working process, the tinword event center plays a role in event routing management, and in order to reduce power consumption, the clock frequency can be reduced as much as possible, but considering the requirement of event real-time processing, the clock frequency cannot be too low, so that a clock with the frequency of 1KHz is selected. The event center module is used as a special peripheral and is communicated with the CPU module of the MCU through an APB bus protocol. The event center module manages event topology routing logics of a plurality of peripheral units through a hardware logic acceleration unit realized by a digital circuit with extremely low power consumption, uses a clock frequency of 1KHz, ensures extremely low static low power consumption, and simultaneously can ensure timely response to event triggers of other peripheral units and complete transmission of specific logics. For this reason, the event center module, whether in static or dynamic power consumption, is more advantageous than designing a data processing chip or CPU to accomplish the same task. Generally speaking, the event center module is arranged to take over most of work of the CPU module, power consumption of the CPU is reduced, and meanwhile, the lower frequency and the power consumption of the event center module are far lower than those of the CPU module, and the effect of reducing the power consumption is achieved.

Referring to fig. 5, the present embodiment further includes an NMI unit for generating an unmasked exception signal; the CPU module comprises a WIC unit, a CPU core unit and a power management unit, wherein the WIC unit receives a signal of the NMI unit, a wake-up signal generated by the event center module and an IRQ interrupt signal generated by the peripheral unit, and then the WIC unit controls the CPU core unit and the power management unit to work. The IRQ is an interrupt request. NMI is the non-maskable signal and WIC is power management. Because some fault accidents or some abnormal events may exist, the CPU is required to carry out emergency processing, and the NMI unit can directly send out non-maskable abnormal signals to the WIC unit, so that the CPU module is awakened. The same conditions of peripheral failure and the like can also send signals to the WIC unit to directly wake up the CPU module.

Referring to fig. 6, the embodiment can be applied to a remote meter reading device, and the peripheral unit includes a low power consumption timer, an electricity meter and a static memory, and the static memory unit is also called a retentivity SRAM. When the preset time of the low-power-consumption timer is overtime, the preset time is transmitted to a Tinywork event center through an event channel 1, the Tinywork event center counts events and transmits the events to an ammeter meter, the ammeter meter starts to meter the usage, and the obtained data is transmitted to the Tinywork event center through an event channel 2. The Tinywork event center counts the events and transfers the events to the Retention SRAM, and then stores the events, namely DMA is started. DMA is a direct memory access. The Tinywork event center counts events generated by the low-power-consumption timer and the ammeter meter, real-time counting comparison is carried out, if the number exceeds a preset value, the Tinywork event center wakes up the CPU module, and the CPU module controls the wireless transmission module to upload data to the cloud.

The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种智能设备的控制方法和设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!