Design Article
How to manage dynamic power in a microcontroller using its non-maskable interrupt
Ajit Basarur, Shantanu Prasad Prabhudesai, and Nazmul Hoda, Ittiam Systems
8/6/2008 1:09 PM EDT
As portable systems become increasingly power-conscious, the need for smart power management becomes equally important. Besides the main processor, an auxiliary Microcontroller Unit (MCU) often resides on such systems to take care of house keeping activities such as various user interfaces and a real-time clock (RTC), which has to tick even when the system is powered off.
In this article, we suggest a mechanism to implement power management scheme for the MCU based on system switch on and off states by using its non-maskable interrupt (NMI) pin.

1. Typical embedded system overview.
(Click this image to view a larger, more detailed version)
Description
In typical embedded systems, the main processor derives power from either AC/DC wall adapter or from a battery, whereas the MCU is powered from either of the above sources and – in their absence – from a coin cell to keep it powered on at all times. Coin cells used in embedded systems are of low capacity and usually not rechargeable, but they must be capable of powering up the MCU for the expected portable product life cycle.
During normal operation of the system, the MCU is used to control interfaces such as Infrared (IR) remote control, keypad(s), PS/2 keyboard etc., and it consumes significant amount of power in this state.
When the rest of the system is switched off, only the real-time clock (RTC) is expected to be running. Since the MCU handles the RTC and other user interfaces, it makes sense to switch off all its peripherals except the RTC and to configure it to a lower power consuming mode.
When the system transitions to an ON or OFF state the MCU should be informed of this change by means of an external component such as such as a reset controller or a dedicated standby key. Any general purpose input-output (GPIO) pin can be used for this signaling, but there are specific advantages when the NMI pin is used for this purpose.

2. MCU power management application.
(Click this image to view a larger, more detailed version)
Consider the application circuit as illustrated in Fig 2, in which MCU is being powered up from a coin cell battery and it is handling remote control, keypad and RTC applications. The RESET signal of an on-board system reset controller is used to signal the MCU of change in system power state and it is connected to RST / NMI pin of MCU.
When the system reset is asserted (using a push button switch) or when the system is powered off, the RESET signal output from the reset controller goes low. This signals the MCU to be put into its low power state, where all the peripherals of the MCU are off except the RTC. The MCU now draws minimal power from the coin cell, which is the only available source of power to it.
When the system is powered up or when system RESET is de-asserted, the MCU has to change back to its normal state where all its peripherals are active and the CPU can work at maximum computational power. Thus, the MCU has to be put in either normal state or low power state depending on the NMI pin status.
MCUs generally have the NMI and RESET functionality multiplexed onto a single pin with the RESET function as the primary pin configuration. The design circuit to implement a power management scheme in such scenario is illustrated in Fig 3.

3. MCU power management design circuit.
(Click this image to view a larger, more detailed version)
In the above design, an RC circuit with optimal RC time constant is placed across the RST/NMI pin of MCU to ensure that power is not drained from the coin cell in the absence of a main power supply. The presence of the RC circuit makes the RESET pin sense logic low after 2.3RC seconds, and hence the software present on the MCU must configure RST to NMI pin functionality before this time constant.
The advantages and disadvantages of using the given power management scheme are as follows:
Benefits of the power management scheme:
Consider that the MCU is running from a coin cell (non rechargeable) of capacity 20 mAh. The typical power consumption of an MCU (MSP430) in its normal (running) power state is 3 mA; by comparison, it consumes less than 1 µA of current in its low power state.
The lifetime of the coin cell is calculated using the following equation:
Coin cell life time (in hr) =
Battery capacity (mAh) / MCU current consumption (mA)
If the MCU is allowed to run in its normal state at all times, then the coin cell will last for less than seven hours in the absence of other sources; but if the MCU is intelligently switched to its lower power state most of the time, the battery can last as long as 20,000 hours (i.e. more than 2 years). Thus implementing the power management scheme can dramatically increase the life span of non-rechargeable coin cells.




mojtaba_dayani
5/23/2011 2:18 PM EDT
Coin cell is not rechargeable. So should to place a rectifier between the coin cell and power line?
Sign in to Reply