Power saving methods for NUC1xx microcontrollers (MCUs)

Publisher:创新之星Latest update time:2011-08-27 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Nuvoton Technology's NUC1xx includes NUC101, NUC100, NUC120, NUC130 and NUC140, which are 32-bit microcontrollers (MCUs) based on the ARM Cortex-M0 core. Through different clock settings, the operating frequency can reach up to 50MHz. However, in general simple control or when the system load is low, the CPU does not need to run at the highest operating clock to cope with the required calculations. At this time, the system clock control can be used to reduce the clock to achieve the purpose of power saving.

Another situation is that when the CPU is waiting for the next task or only needs to work once in a long time, the CPU can be put into Idle or Power Down mode first, and will be awakened to process related events after a certain period of time or when a specific event occurs. At the same time, if the system module is not used in the system, it can also be turned off to save unnecessary power consumption. This article introduces the principles of various power saving methods and provides relevant examples.

Switching system module

In Nuvoton Technology's NUC1xx, in order to save power, when a system module is not in use, its input clock can be turned off to put it into shutdown mode, thereby achieving power saving. In NUC1xx, almost all system modules can be turned off individually, including: Watch Dog Timer, RTC, Timer0"3, I2C0"1, SPI0"3, UART0"2, PWM0"7, CAN, USB, ADC, ACMP, PS2, PDMA, Flash ISP. However, not every chip includes all module functions. For example, the CAN module only has this function in NUC130 and NUC140. For detailed instructions, please refer to the relevant documents of each chip.

The relevant power consumption of each module is shown in Table 1.

Relevant power consumption of each module www.elecfans.com

Nuvoton Technology NUC1xx turns off each module by turning off the clock of each module, so to turn off the module, you must set the relevant clock control register. NUC1xx provides AHBCLK Register and APBCLK Register to control the switches of the modules listed above.

System clock settings

The power consumption of Nuvoton NUC1xx is closely related to its operating clock. If the operating clock is high, the power consumption is high, and vice versa, it is more power-saving, but at the same time the CPU may not be able to handle a large amount of calculations. Therefore, if you want to take into account both large-scale calculations and power saving, you must be able to adjust the CPU's operating clock according to actual needs in order to achieve the best operating efficiency.

NUC1xx has built-in PLL, which can use an external 12MHz crystal or an internal 22MHz oscillator to generate the clock required by the system. The clock generated by the PLL can be used as the CPU operating frequency after appropriate frequency division. In addition, NUC1xx also provides a way to directly supply the CPU operating frequency via an external 32KHz crystal or an internal 10KHz oscillator. Therefore, NUC1xx provides great flexibility in setting the operating clock.

IDLE power saving mode

In addition to setting the most suitable working clock to achieve the purpose of power saving, Nuvoton Technology NUC1xx can also shut down the CPU and most of the hardware when the system does not need to work at all to achieve the maximum power saving effect. This mode of shutting down the CPU and most of the hardware is called power saving mode, which includes Idle power saving mode and Power Down power saving mode. The following is an explanation of Idle power saving mode.

There are two main modes that achieve maximum power saving efficiency by shutting down most hardware clocks, one is Idle power saving mode and the other is Power Down power saving mode. The biggest difference between these two modes is that when the system enters Idle power saving mode, any interrupt event can re-awaken the CPU so that the system can process new events. But if the system is in Power Down power saving mode, only a few specific interrupt events can wake up the system.

The so-called Idle mode actually turns off the CPU clock, so that the CPU is in the most power-saving mode when it is not working. Because in this mode, only the CPU clock is turned off. Once any interrupt event occurs, the CPU clock can be turned on immediately to handle related events, so there will be no delay in processing events, and at the same time, power saving can be achieved. It is a mode that takes into account both speed and power saving.

NUC1xx can use the WFI/WFE instructions provided by ARM Cortex-M0 to enter Idle mode. Once in Idle mode, the CPU will immediately enter Sleep mode and stop operating. Therefore, the program after the WFI/WFE instruction must wait until the CPU is awakened before it can be executed. At this time, the power consumption of NUC1xx will drop to about 16mA@3.3V-48MHz.

After entering the Idle power saving mode, if you want to wake up the CPU and return to the normal working mode, you must first generate an interrupt signal. The interrupt signal can be an interrupt generated by any module in the NUC1xx, or it can be used to wake up the CPU through an external interrupt. It should be noted that when deciding that the CPU is to be woken up by a certain interrupt, the interrupt must be set before entering the Idle power saving mode so that it can generate an interrupt event to wake up the CPU.

Power Down mode

Power Down is the most power-saving mode of Nuvoton Technology's NUC1xx. Once in Power Down mode, the crystal oscillator clock will be turned off, and the entire NUC1xx will be in a static state, and the power consumption will be reduced to a minimum. In this mode, only a few specific interrupt events can wake up the NUC1xx and restore it to working state. In Power Down mode, NUC1xx provides interrupt wake-up methods for GPIO, USB, UART, RTC, ACMP and CAN.

To enter the Power Down mode, in addition to calling the WFI/WFE instruction, the PD_WAIT_CPU and PWR_DOWN_EN functions must be turned on in sequence before calling the WFI/WFE instruction. This ensures that the CPU enters the Sleep mode first, and then the system enters the Power Down mode. At this time, NUc1xx is in the most power-saving state, and the power consumption will drop to about 15uA.

Once NUC1xx enters Power Down mode, most of the logic circuits are stopped, so to wake up the CPU, it must be woken up by a specially defined interrupt source. In Idle mode, any interrupt can wake up the CPU. However, the same thing is that both must set up the module to wake up the CPU in the future before entering the power saving mode, including the interrupt or wake-up function. Only after these preparations for waking up the CPU are completed can the power saving mode be entered, otherwise there is no way to wake up the CPU.

The so-called Power Down mode actually turns off the crystal oscillator clock, making the entire NUC1xx static. Because the crystal oscillator is also turned off, once a wake-up interrupt event occurs, the CPU can only continue to operate after the crystal oscillator stabilizes. Therefore, entering the normal working mode from Power Down will require a delay of some time, and the delay time provided by the NUC1xx series is preset to 4096 clock cycles. Calculated at 12MHz, the delay time is (1/12MHz)*4096=341.12us (T2 in Figure 2), and the time required for the crystal oscillator to start (T1 in Figure 2) will vary slightly with the crystal oscillator frequency, brand, PCB wiring, etc. Generally speaking, it takes about 1"2ms for a 12MHz crystal oscillator to start. The actual measurement example data is shown in Figure 2.

Conclusion

This article introduces the various power saving methods provided by Nuvoton Technology NUC1xx, including shutting down unused modules, adjusting the CPU clock, Idle power saving mode and Power Down power saving mode. In actual application, users can choose the appropriate method according to their own needs, or even combine different power saving methods to achieve the best power saving efficiency.

Reference address:Power saving methods for NUC1xx microcontrollers (MCUs)

Previous article:Design of wireless logging winch signal detection circuit based on XC2C64A chip
Next article:Design of Boot-Loader for AT91SAM7Sxx Series MCU

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号