SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
5.6 OPERATING MODE CONTROL MACRO
Sonix provides operating mode control macros to switch system operating mode easily.
Macro
Length
1-word
3-word
2-word
5-word
Description
SleepMode
GreenMode
SlowMode
Slow2Normal
The system insets into Sleep Mode (Power Down Mode).
The system inserts into Green Mode.
The system inserts into Slow Mode and stops high speed oscillator.
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
B0BCLR
MOV
B0MOV
MOV
B0MOV
B0BCLR
B0BCLR
B0BSET
FT0IEN
FT0ENB
A,#20H
T0M,A
A,#74H
T0C,A
FT0IEN
FT0IRQ
FT0ENB
; To disable T0 interrupt service
; To disable T0 timer
;
; To set T0 clock = Fcpu / 64
; To set T0C initial value = 74H (To set T0 interval = 10 ms)
; To disable T0 interrupt service
; To clear T0 interrupt request
; To enable T0 timer
; Go into green mode
GreenMode
; Declare “GreenMode” macro directly.
SONiX TECHNOLOGY CO., LTD
Page 54
Version 2.0