EM78P221/2N
8-Bit Microcontroller with OTP ROM
28
•
Product Specification (V1.0) 10.19.2007
(This specification is subject to change without further notice)
If Port 6 Input Status Change Interrupt is used to wake up the EM78P221/2N (as in
Case b above), the following instructions must be executed before SLEP:
MOV A,
@000110xxb
; Select WDT prescaler and disable WDT
BANK 1
MOV RE,
A
WDTC
; Clear WDT and prescaler
BANK 0
MOV
R6, R6
; Read Port 6
ENI (or DISI)
; Enable (or disable) global interrupt
MOV
A, @xxx1xxxxb
; Enable Port 6 input change wake-up bit
MOV
RE
MOV
A, @00000x1xb
; Enable Port 6 input change interrupt
BANK
1
MOV RF,
A
SLEP
; Sleep
Similarly, if the Comparator Interrupt is used to wake up the EM78P221/2N (as in Case
[c] above), the following instructions must be executed before SLEP:
MOV A,
@xxx01xxxb
; Select Comparator and P71 functions as
; general I/O pin
BANK
1
MOV RA,
A
MOV A,
@000110xxb
; Select WDT prescaler and Disable WDT
MOV
RE, A
WDTC
; Clear WDT and prescaler
ENI (or DISI)
; Enable (or disable) global interrupt
MOV
A, @00000100b
; Enable comparator output status change
; wake-up bit
BANK 0
MOV
RE, A
BANK 1
MOV
A, @0x00000001b
; Enable Comparator 1 output status change
; interrupt
MOV
RE, A
SLEP
; Sleep
6.5.1.1
Wake-up and Interrupt Modes Operation Summary
All categories under Reset, Wake-up and Interrupt modes are summarized below.
Wake-up Signal
Sleep Mode
Normal Mode
External interrupt
x
Interrupt (if interrupt enable)
or next instruction
Port 6 pin change
If enable ICWE bit Wake-up
+ interrupt (if interrupt next instruction
Interrupt (if interrupt enable)
or next instruction
TCC overflow interrupt
x
Interrupt (if interrupt enable)
or next instruction
Comparator interrupt
If enable CMPWE bit Wake-up
+ interrupt (if interrupt enable) + next instruction
Interrupt (if interrupt enable)
or next instruction
WDT Time out
Reset to Normal mode
Reset to Normal mode
Low Voltage Reset
Reset to Normal mode
Reset to Normal mode
After wake up:
1. If interrupt enable
→
in next instruction
2. If interrupt disable
→
next instruction