[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
Smart Shutdown
So far, we've discussed only what to do when the device is running; now, let's consider what happens when it is turned off. Most of us take for granted that we can turn on our PDAand have it pick right up where it was when we last used it; if we were in the middle of entering a new contact, that's where we'll be when we turn it back on a week or month later. This is accomplished with an intelligent shutdown procedure that effectively tricks any executing application software into thinking the device was never turned off at all. When the user turns the device off by pressing the power button, an interrupt signals the operating system to begin a graceful shutdown that includes saving the context of lowest-level registers in the system.


The operating system does not actually shut programs down, but leaves their contents (code, stack, heap, static data) in memory. It then puts the processor into sleep mode, which turns off the processor core and peripherals but continues to power important internal peripherals, such as the real-time clock. In addition, battery-backed DRAM is kept in a self-refresh state during sleep mode, allowing its contents to remain intact. When the power button is pressed again, an interrupt signals the processor to wake up.


The wakeup ISR uses a checksum procedure to verify that the contents of the DRAM are still intact before restoring the internal state of the processor. Since DRAM should contain the same data as when powerdown occurred, the operating system can return directly to the thread that was running when the device was powered off. As far as the running application is concerned, it never even knew something happened. This approach saves power primarily because it avoids the processor-intensive and time-consuming task of rebooting. Rebooting a sophisticated device can take several seconds, during which time the system is loading drivers.


This time is essentially wasted from the user's standpoint, since he/she cannot actually use the device during this time. When you think about the number of times that you turn off and turn on your battery-operated devices, an intelligent shutdown procedure makes a lot of sense, both for reducing power consumption and improving usability. Another very important factor in intelligent shutdown is minimizing power consumption while in sleep mode. Since a battery-operated device may sit on a shelf overnight or over a weekend, and since some power is required to refresh DRAMs and parts of the processor's peripheral interface, the batteries actually lose some capacity during periods of sleep.


Minimizing sleep mode power consumption can be the difference between a device that has to have its batteries recharged every day and one that can go weeks between recharges. Minimizing sleep mode power consumption requires analyzing the hardware in your system and determining how to set it into the lowest-possible power state. Most battery-operated systems continue to power their general-purpose I/O pins during sleep mode. As inputs, these I/O pins can be used as interrupts to wake up the device; as outputs, they can be used to configure an external peripheral. Careful consideration of how these pins are configured can have a large effect on sleep mode power consumption.

last edited (February 27, 2003) by chetan, Number of views: 1785, Current Rev: 1

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.