|
Palm Database Programming The Electronic Version
Chapter 2: What You Need To Know About Palm Devices
This material was published in 1999. See the free
Palm OS Programming
online course I developed for
CodeWarriorU for some updated material.
Prev Chapter |
Prev Section |
Next Section |
Next Chapter |
Contents
Hardware
Palm devices are marvels of low-power, small form-factor
technology. The two AAA batteries in most models (for a thinner
profile, the Palm V uses built-in rechargeable batteries instead) can
last for several weeks of continuous use because of low-power
components and clever power management.
The Main Processor
The main processor in the current Palm devices is the Motorola
MC68328 DragonBall processor. The DragonBall is a low-power version of
the MC68000 processor, a popular chip used in computers such as the
original Macintosh and the Amiga. The 68328 and 68000 share the same
instruction sets, but the DragonBall processor is designed
specifically for the portable consumer market. Detailed information on
the chip can be found on Motorola's Web site at www.mot.com/SPS/WIRELESS/products/MC68328.html.
Sidebar: Assembly Language Programming
If you're interested in writing assembly language programs
for the Palm, the Pila cross-assembler is available for download
from numerous sites, including www.massena.com/darrin/pilot/asdk/asdknews.htm.
Please note that this book doesn't discuss assembly language
programming on the Palm.
Compared to the processor in a desktop computer, the
DragonBall is slow. A faster processor requires more power, and
low power consumption was a primary design goal of the Palm
platform. In fact, Palm Computing recommends that you offload
computationally expensive processing to a desktop computer in
order to save power and to keep the device responsive to the
user.
|
The Screen
The screen on the Palm device is currently 160 pixels wide by 160
pixels high. Your application's user interface has to fit within these
constraints. These dimensions may change at some point — they
may get bigger. The ScrDisplayMode() function (available in
later versions of the operating system) returns the screen dimensions
of the current device.
A digitizer makes the screen touch-sensitive. The operating system
transforms raw pen movements and taps into higher-level events (such
as keystrokes) that an application can process. Your application has
access to the raw events, though, and Chapter 4 shows you how to
intercept them before the system processes them. Most applications
just deal with the higher-level events.
Running Modes
Apart from the lower-power circuitry, the key to the Palm device's
miserly ways is its power management via its running modes. A
Palm device has three modes of operation:
- Sleep mode occurs when there has been no user activity on
the device for a certain number of minutes. The default is two
minutes, but you can change the wait period to one or three
minutes using the Preferences application. Sleep mode is also
entered when you turn off the device using the power button. In
sleep mode, the processor, screen, and most of the other hardware
do not receive any power, but the memory chips, the real-time
clock, and some low-level circuitry do stay powered. Pressing a
button restores power to the processor and the other hardware. The
real-time clock can also wake the device at a predetermined time.
- Doze mode (sometimes referred to as idle mode)
occurs when an application is waiting for user input. The
processor is halted until a hardware interrupt signals user
activity, such as the press of a button or a stroke of the pen.
Most of an application's time when the device is on is spent in
doze mode.
- Running mode occurs when the processor is executing
instructions. This mode consumes the most power, so the device
returns to doze mode as soon as possible in order to conserve
battery power.
As you can see, the power is never really turned off unless you
pull out the batteries and let the internal capacitors (which keep the
device charged while you change batteries) discharge completely. The
active application is simply in a halted state when in sleep mode,
ready to resume where it left off as soon as power is reapplied to the
processor.
Prev Chapter |
Prev Section |
Next Section |
Next Chapter |
Contents
Copyright ©1999 by Eric Giguere. All rights reserved.
From Palm Database Programming: The Complete Developer's Guide.
Reprinted here with permission from the publisher. Please see the
copyright
and disclaimer notices for more details.
If you find the material useful, consider buying one of
my books,
linking to this site from your own site or in your weblog,
or sending me a note.
|