About the Power Manager
About the Power Manager
The Power Manager, provided only in the firmware of the Macintosh
Portable computer, controls power to the internal hardware devices of the
Macintosh Portable in order to conserve power whenever the computer is not in
use. The Macintosh Portable operates only with System 6.0.4 and later
versions.
The Macintosh Portable computer operates from a built-in battery that can
be charged from a voltage converter plugged into an electric socket. The
Macintosh Portable has no power switch; instead, it contains firmware and
hardware that can put the computer into two low-power-consumption states,
the idle state and the sleep state.
In the idle state, the Power Manager firmware slows the computer from its
normal 16-megahertz (MHz) clock speed to a 1 MHz clock speed. The
Power Manager puts the Macintosh Portable in the idle state when the
system has been inactive for 15 seconds. When the Macintosh Portable has
been inactive for an additional period of time (the user can set the length of
this period), the Power Manager and the various device drivers shut off
power or remove clocks from the computer's various sub systems, including
the CPU, RAM, ROM, and I/O ports. This condition is known as the sleep state.
No data is lost from RAM when the Macintosh Portable is in the sleep state.
Most applications can be interrupted by the idle and sleep states without any
adverse effects. When the user resumes use of the computer (by pressing a
key, for example), most of the applications that were running before the
Macintosh Portable entered the sleep state are still loaded in memory and
resume running as if nothing had happened. If your application cannot tolerate
the sleep state, you can add an entry to an operating-system queue called the
sleep queue. The Power Manager calls every sleep queue routine before the
computer goes into the sleep state.
The user can also use the Battery desk accessory or either of two Finder menu
items to cause the Macintosh Portable to go into the sleep state immediately. If
the user chooses Sleep from the Battery desk accessory or from the Special
menu in the Finder, the Power Manager checks to see if any network
communications will be interrupted by going into the sleep state. If network
communications will be affected, a built-in sleep queue routine displays a
dialog box giving the user the option of canceling the Sleep command. If the
user chooses Shut Down from the Special menu in the Finder, the
Power Manager puts the Macintosh Portable in the sleep state regardless of
whether any network communication routines are running at the time.
The Power Manager is the firmware that provides an interface to the
50753 micro processor (the Power Manager Integrated Circuit or
Power Manager IC) in the Macintosh Portable computer. The
Power Manager firmware also provides some services unique to the
Macintosh Por table-such as reading the current clock speed-that are not
directly related to power control. The power management circuits and the
microcode in the on-chip ROM of the Power Manager are described in the
Guide to the Macintosh Family Hardware, second edition. The
Power Manager provides routines that your program can use to enable and
disable the idle state, to control power to some of the sub systems of the
Macintosh Portable computer, and to ensure that your program is not adversely
affected when the Power Manager puts the Macintosh Portable into the sleep
state.
The Idle State and The Sleep State describes the idle and sleep states and
explains how your program can use Power Manager routines. You need this
information only if you are writing a program-such as a device driver-that
must control power to a subsystem of the Macintosh Portable computer, or if
you are writing a program that might be affected by the idle or sleep state.
Because the Power Manager saves the contents of all of the CPU's registers,
including the stack pointer, before putting the Macintosh Portable in the sleep
state, and because the contents of RAM are preserved while the Macintosh
Portable is in the sleep state, most applications are not adversely affected by
the sleep state. Because the Macintosh Portable does not enter the idle state
when almost any sort of activity is going on or even when the watch cursor is
being displayed, few programs are adversely affected by the idle state.
Therefore, it is probable that your application will not have to make calls to
the Power Manager.
The power management circuits in the Macintosh Portable computer include a
battery-voltage monitor, a voltage regulator and battery-charging circuit, and
the Power Manager. The Power Manager controls the clocks and power
lines to the various internal components and external ports of the Macintosh
Portable computer. The microcode in the Power Manager implements many
of the Macintosh Portable computer's power management features, such as
power and clock control and the wakeup timer. A user or an application can set
the wakeup timer to return the computer from the sleep state to the operating
state at a specific time.
The following figure illustrates the relationships among your application, the
Power Manager firmware, the Power Manager, the power management
circuits, and the other sub systems of the Macintosh Portable computer. The
Power Manager firmware in the ROM of the Macintosh Portable provides
an interface that allows your application to control some of the functions of the
Power Manager. Under control of the microcode in the Power Manager,
the power management hardware charges the battery, provides the voltages
needed by the system, and automatically shuts down all power and clocks to the
system if the battery voltage falls below 5.65 volts. The automatic shutdown
function helps to prevent possible damage to the battery resulting from low
voltage.
Relationship of an application to the Power Manager
You can use the routines of the Power Manager to
enable, disable, or delay the idle feature
read the current clock speed
set or disable the wakeup timer and read its current setting
place an entry in the sleep queue so that the Power Manager calls
your routine before putting the Macintosh Portable into the sleep state
or returning it to the operating state
remove an entry from the sleep queue
control power to the internal modem and serial ports
read the status of the internal modem
read the state of the battery charge and the status of the battery
charger