110
CipherLab BASIC Programming Part I
This section describes the commands related to power management that can be used to
monitor the voltage level of the main and backup batteries. The mobile computer is
equipped with a main battery for normal operation as well as a backup battery for
keeping SRAM data and time accuracy.
BACKUP_BATTERY
Purpose To get the voltage level of the backup battery.
Syntax A% = BACKUP_BATTERY
Remarks “A%”
is an integer variable to be assigned to the result. That is, the voltage
level of the backup battery is returned in units of milli-volt (mV).
The backup battery is used to retain data in SRAM and keep the real-
time clock
and calendar running, even when the power is off. The backup battery would
be considered as “Battery Low” when the BACK_BATTERY is
mV.
That means the SRAM and the calendar chip may lose their data at any
time thereafter, if the battery is not recharged or replaced.
Example
CheckBackupBattery:
IF BACKUP_BATTERY < BATTERY_LOW% THEN
BEEP(2000, 30)
CLS
PRINT “Backup Battery needs to be replaced!”
Loop:
GOTO Loop
MAIN_BATTERY
Purpose To get the voltage level of the main battery.
Syntax A% = MAIN_BATTERY
Remarks “A%” is an integer variable to be assigned to the
result. That is, the voltage
level of the main battery is returned in units of milli-volt (mV).
The main battery is the power source for the system operation. The main
battery would be considered as “Battery Low”
lower than 3400 m
V (or 2200 mV for alkaline battery on 8001). That means
the basic operations may still be running, but some functions that consume
high power may be disabled.
Example
BATTERY_LOW% = 3400
CheckMainBattery:
IF MAIN_BATTERY < BATTERY_LOW% THEN
BEEP(2000, 30)
CLS
PRINT “Main Battery needs to be recharged!”
Loop:
GOTO Loop