EM78P221/2N
8-Bit Microcontroller with OTP ROM
Product Specification (V1.0) 10.19.2007 • 25
(This specification is subject to change without further notice)
/SLEP
T17
T10
T11
ICIE
Interrupt
ENI Instruction
DISI Instruction
Interrupt
(Wake-up from
SLEEP)
Next Instruction
(Wake-up from
SLEEP)
CLK
CLK
CLK
Q
Q
Q
Q
Q
Q
_
_
_
D
D
D
P
P
P
L
L
L
R
R
R
C
C
C
RE.1
ICWE
Fig. 6-6 Port 6 Block Diagram with Input Change Interrupt/Wake-up
6.4.1 Usage of Port 6 Input Change Wake-up/Interrupt Function
Usage of Port 6 Input Status Change Wake-up/Interrupt
(1) Wake-up (2) Wake-up and Interrupt
(a) Before Sleep (a) Before Sleep
1. Disable WDT 1. Disable WDT
2. Read I/O Port 6 (MOV R6,R6) 2. Read I/O Port 6 (MOV R6,R6)
3. Execute "ENI" or "DISI" 3. Execute "ENI" or "DISI"
4. Enable wake-up bit
(Set Bank 0-RE ICWE =1)
4. Enable wake-up bit
(Set Bank 0-RE ICWE =1)
5. Execute "SLEP" instruction
5. Enable interrupt (Set BANK1-RF ICIE
=1)
(b) After wake-up 6. Execute "SLEP" instruction
→ Next instruction (b) After wake-up
1. IF "ENI" → Interrupt vector (008H)
2. IF "DISI" → Next instruction
(3) Interrupt
(a) Before Port 6 pin change
1. Read I/O Port 6 (MOV R6,R6)
2. Execute "ENI" or "DISI"
3. Enable interrupt (Set BANK1-RF ICIE =1)
(b) After Port 6 pin changed (interrupt)
1. IF "ENI" → Interrupt vector (008H)
2. IF "DISI" → Next instruction