Specifications

Table Of Contents
II-66 EPSON S1C62740 TECHNICAL SOFTWARE
CHAPTER 6: PERIPHERAL CIRCUITS (Sleep)
Use K10 input port to wakeup
Set the proper RAM's data and I/O register's data if necessary.
Set input comparison register (DFK10) to "1" or "0";
Set interrupt mask register EIK1 = "1";
Set interrupt flag (EI).
Executes "SLP" and the chip sleeps.
When K10 input port mismatch to DFK10, then the chip
wakeup, and go to K10 interrupt service routine.
After finishing the interrupt service routine then program
counter jump to the next of "SLP" instruction.
Example program
for the sleep
function
Following program shows the sleep function controlling procedure.
Label Mnemonic/operand Comment
;*
;* SLEEP
;*
ZIK1 EQU 0C2H ;K10 INTERRUPT FACTOR FLAG
ZEIK EQU 0C9H ;K00-K03, K10 INTERRUPT MASK REGISTER
ZK1 EQU 0D1H ;K10 INPUT PORT
ZDFK1 EQU 0D3H ;K10 DIFFERENTIAL REGISTER
;
CHDATA EQU 00H ;IF CPU IS SLEEPING, THEN
;IT STORE (5, A) IN RAMS 00H AND 01H
;
ORG 100H
JP INIT
;
ORG 10AH
JP K1INT ;K10 INTERRUPT ROUTINE
;
;* CPU IS GOING TO SLEEP
GOSLP:
;:
; SET AMP 1 & 0 OFF, A/D CONVERTER OFF AND OTHERS
; FOR SAVING POWER IF NECESSARY
;:
DI
LD X,CHDATA ;SET CPU SLEEPING FLAG
LBPX MX,5AH
;
LD X,ZK1 ;SET DIFFERENTIAL REGISTER THE SAME
LD Y,ZDFK1 ;AS K10 INPUT
LD MY,MX
;
LD X,ZIK1 ;RESET K10 INTERRUPT FLAG
LD A,MX