Previous

Next

Bottom

Contents

Glossary

Index

 

Persistor CF1 User's Manual

Power Management Drivers and Functions

May2000

Revision 1.04

 Persistor Instruments Inc.
© 1998 All rights reserved.

Quick Reference Table

PWRLPStopSetup

PWRPreChgRemoveChore

PWRPostChgAddChore

PWRSuspendSecs

PWRPostChgRemoveChore

PWRSuspendUntil

PWRPreChgAddChore

PWRSuspendTicks

Background

One of the most attractive features of the CF1 is it's low power consumption modes. This section details how to setup and use these modes. At the time of this writing, this documentation was preliminary and almost non of the functions have been implemented. As such details about low power modes are to be forthcoming.

PWRLPStopSetup -- Determine the behavior of future LPSTOP mode changes.

This function controls the behavior of the CF1 when in LPSTOP mode. There are various options that effect the conservation of power. Three parameters are offered here to help you control the behavior of the CF1. First is stsim, which controls which clock the SIM uses during the LPSTOP state. If it is TRUE, the SIM uses the Voltage Controlled Oscillator that normally provides the main system clock, at the last frequency set before going into LPSTOP mode. If stsim is FALSE, the SIM uses the native clock frequency of 40kHz. Because power consumption varies linearly with clock frequency, this clearly offers a great level of incentive to use the 40kHz clock. The next parameter is stext which determines the behavior of the CLKOUT pin during LPSTOP. If it is TRUE, then the CLKOUT pin mimics the SIM clock line and whatever behavior was specified by the stsim parameter. Lastly there is the stcpu option. If stcpu is TRUE, then the intermodule bus clock is on for every module except the CPU. Turning off the CPU saves quite a bit of power but the remaining peripherals and subsystems continue to draw power. If stcpu is FALSE then the intermodule bus clock is off and the subsystems and peripherals clocked from that are off. However, there are some illogical combinations. For instance, if the SIM is running off of the 40kHz crystal, and not the VCO, it makes little sense to keep the intermodule bus clock on, because all the timing modules will be thrown off by the foreign clock rate.

Prototype:

void PWRLPStopSetup(bool stcpu, bool stsim, bool stext)

Definition:

#include <cf1bios.h>

Inputs:

stcpu is a boolean that determines the on/off nature of the intermodule bus clock during LPSTOP mode
stsim is a boolean that, if TRUE causes the SIM to run from the main VCO clock during LPSTOP mode. (False implies 40kHz)
stext
is a boolean that determines the on/off state of the CLKOUT pin during LPSTOP mode.

Notes:

Timing:

Timing-TBD

PWRPostChgAddChore -- Add a power mode post-change chore

This function allows you to perform one or more small tasks, immediately after a power mode change, in order to handle any hardware that might be sensitive to a power mode change. The maximum number of chores is defined in cf1bios.h as MAX_PWR_CHG_CHORES and then the BIOS installs two chores of its own so the actual number of chores you can add is (MAX_PWR_CHG_CHORES - 2) The priority you pass is an internal sorting order (0-7) to indicate the order in which the chores get executed. (priority 7 is executed first and 0 is last.)

Prototype:

bool PWRPostChgAddChore (vfptr chore, ushort priority);

Definition:

#include <cf1bios.h>

Inputs:

chore is a volatile function pointer to the chore you wish to install
priority is a parameter used as an internal sorting order for the tasks. (0-7)

Returns:

Returns a boolean that is TRUE if the chore was successfully added.

Notes:

These chores should be kept small. A good rule of thumb is to keep the total execution time of all chores combined under 100µs.
At the time of this writing, this function was not yet implemented.

Timing:

Timing-TBD

PWRPostChgRemoveChore -- Remove a power mode post-change chore

This function removes a post-power mode change chore from the power mode change chore list, previously installed by PWRPostChgAddChore.

Prototype:

bool PWRPostChgRemoveChore(vfptr chore)

Definition:

#include <cf1bios.h>

Inputs:

chore is a volatile function pointer to a chore that was perviously installed by the PWRPostChgAddChore function

Returns:

Returns a boolean that is TRUE if the chore was successfully removed.

Notes:

At the time of this writing, this function was not yet implemented.

Timing:

Timing-TBD

PWRPreChgAddChore -- Add a power mode pre-change chore

This function allows you to perform one or more small tasks, immediately before a power mode change, in order to prepare any hardware that might be sensitive to a power mode change. The maximum number of chores is defined in cf1bios.h as MAX_PWR_CHG_CHORES and then the BIOS installs two chores of its own so the actual number of chores you can add is (MAX_PWR_CHG_CHORES - 2) The priority you pass is an internal sorting order (0-7) to indicate the order in which the chores get executed. (priority 7 is executed first and 0 is last.)

Prototype:

bool PWRPreChgAddChore(vfptr chore, ushort priority);

Definition:

#include <cf1bios.h>

Inputs:

chore is a volatile function pointer to the chore you wish to install
priority is a parameter used as an internal sorting order for the tasks. (0-7)

Returns:

Returns a boolean that is TRUE if the chore was successfully added.

Notes:

These chores should be kept small. A good rule of thumb is to keep the total execution time of all chores combined under 100µs.
At the time of this writing, this function was not yet implemented.

Timing:

Timing-TBD

PWRPreChgRemoveChore -- Remove a power mode pre-change chore

This function removes a pre-power mode change chore from the power mode change chore list, previously installed by PWRPreChgAddChore.

Prototype:

bool PWRPreChgRemoveChore(vfptr chore)

Definition:

#include <cf1bios.h>

Inputs:

chore is a volatile function pointer to a chore that was perviously installed by the PWRPreChgAddChore function

Returns:

Returns a boolean that is TRUE if the chore was successfully removed.

Notes:

At the time of this writing, this function was not yet implemented.

Timing:

Timing-TBD

PWRSuspendSecs -- Delay in suspend mode for a number of seconds

Suspend Mode is the lowest power mode that the CF1 has. Suspend mode actually removes power to every part of the CF1 except for the PIC, the SRAM and the real time clock. This function tells the CF1 to go into this suspend mode for the given number of seconds. The timer that controls "revival" from suspend mode is contained in the PIC. Its resolution is approximately 4 seconds but it is important to note that its accuracy varies wildly with temperature. This could be as gross as a week on the order of magnitude of a month. If precise timing is needed, it is recommended that you use a periodic wake-up to recalibrate your suspend mode sleep duration. Due to various factors, going into suspend mode for periods of time less than 1 minute is rather senseless, you may wish to consider the LPSTOP modes for short delays.

Prototype:

bool PWRSuspendSecs(ulong delaysecs);

Definition:

#include <cf1bios.h>

Inputs:

delaysecs is the number of seconds to stay asleep.

Returns:

Notes:

At the time of this writing, this function was not yet implemented.

Timing:

TBD

PWRSuspendTicks -- Delay in suspend mode for a number of ticks

Suspend Mode is the lowest power mode that the CF1 has. Suspend mode actually removes power to every part of the CF1 except for the PIC, the SRAM and the real time clock. This function tells the CF1 to go into this suspend mode for the given number of ticks which are native time periods for the separate onboard controller that manages suspend mode. The ticks are derived from a very temperature dependent RC oscillator which makes tick intervals vary from about 1.5s at the lowest temperatures (-40C) to about 4.5s at the highest (+85C). They are typically about 3 seconds at room temperature.

Prototype:

bool PWRSuspendSecs(ulong ticks, bool resume, short whatwakes );

Definition:

#include <cf1bios.h>

Inputs:

delaysecs is the number of seconds to stay asleep.
resume is true to resume execution at the next statement, false to perform a power up reset cycle on completion.
whatwakes is an enumeration constant that defines what conditions terminate the suspend mode as follows:

# New Name           Old Name     Wake Condition
0 WakeOnTimeout WakeTimeout only after the ticks timeout
1 WakeTmtOrWAKEFall WakePinChg tick timeout or /WAKE falling edge
2 WakeTmtOrCFChg WakeCFChg tick timeout or CF insertion/extraction
3 WakeTmtWAKECFChg WakePinOrCF tick timeout or CF, /WAKE, or CF change

Returns:

A value between 0 and 3 declaring what caused the wakeup and corresponding to the following enumeration:

# New Name           Waking Condition
         0 WokeFromTimeout    timeout caused wakeup
1 WokeWAKEFall       /WAKE falling edge
2 WokeCFChg          CF insertion/extraction
3 WokeWAKEandCFChg   both /WAKE and CF change occurred

Notes:

Once in suspend mode, only a timeout or one of the enabled wake conditions will restore power to the CF1. If you do not provide for a /WAKE or card change early termination, you will have to pull both main power and the backup supply to regain control of the CF1.

Timing:

NA

PWRSuspendUntil -- Delay in suspend mode until a future time

Suspend Mode is the lowest power mode that the CF1 has. Suspend mode actually removes power to every part of the CF1 except for the PIC, the SRAM and the real time clock. This function tells the CF1 to go into this suspend mode until the main clock reaches the given time. The timer that controls "revival" from suspend mode is contained in the PIC. Its resolution is approximately 3 seconds but it is important to note that its accuracy varies wildly with temperature. This could be as gross as a week on the order of magnitude of a month. If precise timing is needed, it is recommended that you use a periodic wake-up to recalibrate your suspend mode sleep duration. Due to various factors, going into suspend mode for periods of time less than 1 minute is rather senseless, you may wish to consider the LPSTOP modes for short delays.

Prototype:

void PWRSuspendUntil(ulong waketime);

Definition:

#include <cf1bios.h>

Inputs:

waketime is the clock time in seconds when you wish the CF1 to wake up.

Returns:

Notes:

At the time of this writing, this function was not yet implemented.

Timing:

TBD

 

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved