SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 54
Version 2.0
5.6 OPERATING MODE CONTROL MACRO
Sonix provides operating mode control macros to switch system operating mode easily.
Macro
Length
Description
SleepMode
1-word
The system insets into Sleep Mode (Power Down Mode).
GreenMode
3-word
The system inserts into Green Mode.
SlowMode
2-word
The system inserts into Slow Mode and stops high speed oscillator.
Slow2Normal
5-word
The system returns to Normal Mode from Slow Mode. The macro
includes operating mode switch, enable high speed oscillator, high
speed oscillator warm-up delay time.
Example: Switch normal/slow mode to power down (sleep) mode.
SleepMode
; Declare
“SleepMode” macro directly.
Example: Switch normal mode to slow mode.
SlowMode
; Declare
“SlowMode” macro directly.
Example: Switch slow mode to normal mode (The external high-speed oscillator stops).
Slow2Normal
; Declare
“Slow2Normal” macro directly.
Example: Switch normal/slow mode to green mode.
GreenMode
; Declare
“GreenMode” macro directly.
Example: Switch normal/slow mode to green mode and enable T0 wake-up function.
; Set T0 timer wakeup function.
B0BCLR
FT0IEN
; To disable T0 interrupt service
B0BCLR
FT0ENB
; To disable T0 timer
MOV
A,#20H
;
B0MOV
T0M,A
; To set T0 clock = Fcpu / 64
MOV
A,#74H
B0MOV
T0C,A
; To set T0C initial value = 74H (To set T0 interval = 10 ms)
B0BCLR
FT0IEN
; To disable T0 interrupt service
B0BCLR
FT0IRQ
; To clear T0 interrupt request
B0BSET
FT0ENB
; To enable T0 timer
; Go into green mode
GreenMode
; Declare
“GreenMode” macro directly.