
Chapter 6
6.10.1 Example - Power Down and Wake Up by Input Port
;--------------------------------------------------------------
; The example demonstrates the sleep and wakeup modes through Port
; 1. While initialized, enable Port 1 pull-low and set the other
; bi-directional ports as output to prevent extra current
; consumption. After entering power down mode, a rising edge
; of Port 1 will wake up the system and execute the next
; instruction. The instruction will toggle Port 2 and then the
; system enters power down mode again.
;--------------------------------------------------------------
ORG
0x0000
JMP POWERON
; go to power-on procedure
ORG
0x0010
POWERON:
MOV A, @0x40
; enable port 1 pull-low, disable WDT
MOV 0x08, A
CLR 0x0C
; set port 2 to 0
CLR 0x0D
; set port 3 to 0
CLR 0x0E
; set port 4 to 0
CLR 0x0F
; set port 5 to 0
MOV A, @0
IOW 0xD
; set port 2 as output
IOW 0xE
; set port 3 as output
IOW 0xF
; set port 4 as output
SLEEP_MODE:
SLEP
; enter sleep mode
COM 0x0C
; toggle port 2 after wake up
JMP
SLEEP_MODE
6.10.2 Example - Power Down Mode Application for Keyboard-Scan
;--------------------------------------------------------------
; The example demonstrates the Keyboard-scan with sleep/wake-up
; applications. The system clock Fosc = 4MHz.
; The program uses a 1x4 key. If you press the keyboard, the
; processor will wake up. The Port 3 displays the value.
;--------------------------------------------------------------
ORG
0x0000
JMP POWERON
; go to power-on procedure
ORG
0x0010
POWERON:
MOV A, @0
MOV 0x0D, A
; set port 3 as the output
MOV A, @0x40
; set p1 pull-low, disable WDT
MOV 0x08, A
100
•
Software Application
EM60000Series User’s Manual
MOV A, @0
Содержание EM60000 series
Страница 8: ...Contents viii Contents EM60000 Series User s Manual ...
Страница 24: ...Chapter 2 16 Architecture EM60000 Series User s Manual ...
Страница 54: ...Chapter 4 46 Special Function Control EM60000Series User s Manual ...
Страница 80: ...Chapter 5 72 Instruction Set EM60000Series User s Manual ...