X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=doc%2Fhtml%2Ftep112.html;h=7376cad4b9be5b56a32f68ba93ac54e3e34115ba;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=1d31e63a96390c3836b1424235d16dc95fa82b3e;hpb=826bb539a6c489db5b216e7326bf693ec67d15e5;p=tinyos-2.x.git diff --git a/doc/html/tep112.html b/doc/html/tep112.html index 1d31e63a..7376cad4 100644 --- a/doc/html/tep112.html +++ b/doc/html/tep112.html @@ -3,7 +3,7 @@ - + Microcontroller Power Management +

Microcontroller Power Management

@@ -302,15 +298,14 @@ ul.auto-toc { - + - +
Robert Szewczyk, Philip Levis, Martin Turon, Lama Nachman, Philip Buonadonna, Vlado Handziski
Draft-Created:19-Sep-2005
Draft-Version:1.7
Draft-Version:1.8
Draft-Modified:2007-01-10
Draft-Modified:2009-07-07
Draft-Discuss:TinyOS Developer List <tinyos-devel at mail.millennium.berkeley.edu>
-

Note

This memo documents a part of TinyOS for the TinyOS Community, and @@ -318,13 +313,13 @@ requests discussion and suggestions for improvements. Distribution of this memo is unlimited. This memo is in full compliance with TEP 1.

-
-

Abstract

+
+

Abstract

This memo documents how TinyOS manages the lower power state of a microcontroller.

-
-

1. Introduction

+
+

1. Introduction

Microcontrollers often have several power states, with varying power draws, wakeup latencies, and peripheral support. The microcontroller should always be in the lowest possible power state that can satisfy @@ -340,8 +335,8 @@ bit, and a power state override. This memo documents these mechanisms and how they work, as well as the basics of subsystem power management.

-
-

2. Background

+
+

2. Background

The TinyOS scheduler[2] puts a processor into a sleep state when the task queue is empty. However, processors can have a spectrum of power states. For example, the MSP430 has one active mode (issuing @@ -393,8 +388,8 @@ to give the TinyOS microcontroller power manager information on their requirements, which it considers when calculating the right low power state.

-
-

3. Microcontroller Power Management

+
+

3. Microcontroller Power Management

TinyOS 2.x uses three basic mechanisms to manage and control microcontroller power states: a dirty bit, a chip-specific low power state calculation function, and a power state override function. The @@ -457,8 +452,8 @@ whose signature MUST include the following interfaces:

McuSleepC MAY have additional interfaces.

-
-

3.1 The Dirty Bit

+
+

3.1 The Dirty Bit

Whenever a Hardware Presentation Layer (HPL, see TEP 2: Hardware Abstraction Architecture[1]) component changes an aspect of hardware configuration that might change the possible low power state @@ -468,8 +463,8 @@ McuPowerState.update() is called, then McuSleepC MUST recompute the low power state before the next time it goes to sleep as a result of McuSleep.sleep() being called.

-
-

3.2 Low Power State Calculation

+
+

3.2 Low Power State Calculation

McuSleepC is responsible for calculating the lowest power state that it can safely put the microcontroller into without disrupting the operation of TinyOS subsystems. McuSleepC SHOULD minimize how often it @@ -549,8 +544,8 @@ combine function would look like this:

-
-

3.3 Power State Override

+
+

3.3 Power State Override

When McuSleepC computes the best low power state, it MUST call PowerOverride.lowestState(). McuSleepC SHOULD have a default implementation of this command, which returns the lowest power state @@ -572,9 +567,16 @@ TinyOS to behave badly. The presence of a combine function for mcu_power_t means that this command can have fan-out calls.

Section 5 describes one example use of McuPowerOverride, in the timer stack for the Atmega128 microcontroller family.

+

As part of power state override, a platform MUST define the enum +TOS_SLEEP_NONE in its hardware.h file. This enum defines the highest +power state of the platform's microcontroller in a chip-independent +way. If a component wires to McuPowerOverride and returns TOS_SLEEP_NONE, +this will cause TinyOS to never put the microcontroller into a power +saving state. This enum allows a component to prevent sleep in a +platform-independent way.

-
-

4. Peripherals and Subsystems

+
+

4. Peripherals and Subsystems

At the HIL level, TinyOS subsystems generally have a simple, imperative power management interface. Depending on the latencies involved, this interface is either StdControl, SplitControl, @@ -587,24 +589,34 @@ change in status and control registers (e.g., a clock is disabled). Following the requirements in 3.1, the MCU power management subsystem will be notified of a significant change and act appropriately when the system next goes to sleep. TEP 115[5] -describes the power management of non-virtualized devices in +describes the power management of non-virtualized devices in greater detail, and TEP 108[4] describes how TinyOS can automatically include power management into shared non-virtualized devices.

-
-

5. Implementation

-

An implementation of McuSleepC can be found in tinyos-2.x/tos/chips/atm128, +

+

5. Implementation

+

An implementation of McuSleepC can be found in tinyos-2.x/tos/chips/atm128, tinyos-2.x/tos/chips/msp430, and tinyos-2.x/tos/chips/px27ax.

-

An example of a use of McuPowerOverride can be found in the atmega128 timer +

An example use of McuPowerOverride can be found in the atmega128 timer system. Because some low-power states have much longer wakeup latencies than others, the timer system does not allow long latencies if it has a timer -that is going to fire soon. The implementation can be found in +that is going to fire soon. The implementation can be found in tinyos-2.x/tos/chips/atm128/timer/HplAtm128Timer0AsyncP.nc, and tinyos-2.x/tos/chips/atm128/timer/HplAtm128Timer0AsyncC.nc automatically wires it to McuSleepC if it is included.

+

For the atmega128 microcontroller, TOS_SLEEP_NONE is the "idle" power +state.

+

A second example use of McuPowerOverride is in the msp430 timer system. +By default, the msp430 lowest power state is LPM4, which does not keep +clocks enabled. If tinyos-2.x/tos/chips/msp430/timer/Msp430ClockC.nc'' +is included in the component graph, however, this configuration wires +the McuPowerOverride of ``tinyos-2.x/tos/chips/msp430/timer/Msp430ClockP.nc +to McuSleepC. This implemementation of McuPowerOverride raises the lowest +power state to LPM3, which keeps clocks enabled.

+

For msp430 microcontrollers, TOS_SLEEP_NONE is the "active" power state.

-
-

6. Author's Address

+
+

6. Author's Address

Robert Szewczyk
Moteiv Corporation
@@ -659,8 +671,8 @@ wires it to McuSleepC if it is included.


-