KS57C2308/P2308/C2316/P2316 POWER-DOWN
8-5
++ PROGRAMMING TIP — Reducing Power Consumption for Key Input Interrupt Processing
The following code shows real-time clock and interrupt processing for key inputs to reduce power consumption. In
this example, the system clock source is switched from the main system clock to a subsystem clock and the LCD
display is turned on:
KEYCLK DI
CALL MA2SUB ;Main system clock subsystem clock switch subroutine
SMB 15
LD EA,#00H
LD P2,EA ;All key strobe outputs to low level
LD A,#3H
LD IMOD2,A ;Select KS0–KS7 enable
SMB 0
BITR IRQW
BITR IRQ2
BITS IEW
BITS IE2
CLKS1 CALL WATDIS ;Execute clock and display changing subroutine
BTSTZ IRQ2
JR CIDLE
CALL SUB2MA ;Subsystem clock main system clock switch
subroutine EI
RET
CIDLE IDLE ;Engage idle mode
NOP
NOP
NOP
JPS CLKS1
NOTE
You must program at least three NOP instructions after IDLE and STOP instructions, to avoid flowing
of leakage current due to the floating state in the internal bus.