SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 50
Version 1.0
SYSTEM MODE SWITCHING
Normal/Slow mode to power down (sleep) mode.
CPUM0 = 1
)
B0BSET
FCPUM0
; Set CPUM0 = 1.
Note: In normal mode and slow mode, the CPUM1 = 0 and can omit to set CPUM1 = 0 routine.
Normal mode to slow mode.
B0BSET
FCLKMD
;To set CLKMD = 1
B0BSET
FSTPHX
;To stop external high-speed oscillator.
Note: To stop high-speed oscillator is not necessary and user can omit it.
Switch slow mode to normal mode (The external high-speed oscillator is still running)
B0BCLR
FCLKMD
;To set CLKMD = 0
Switch slow mode to normal mode (The external high-speed oscillator stops)
If external high clock stop and program want to switch back normal mode. It is necessary to delay at least 10mS for
external clock stable.
B0BCLR
FSTPHX
; Turn on the external high-speed oscillator.
B0MOV
Z, #27
; If VDD = 5V, internal RC=32KHz (typical) will delay
@@:
DECMS
Z
; 0.125ms X 81 = 10.125ms for external clock stable
JMP
@B
;
B0BCLR
FCLKMD
; Change the system back to the normal mode
Normal/Slow mode to green mode.
CPUM1, CPUM0 = 10
System can return to the last mode by P0, P1 and T0 wakeup function.
Example: Go into Green mode.
B0BSET
FCPUM1
; To set CPUM1, CPUM0 = 10
Note: In normal mode or slow mode, the CPUM0 = 0 and can omit to set CPUM0 = 0 routine.
Example: Go into Green mode and enable T0 wakeup 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 = F
CPU
/ 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
B0BCLR
FCPUM0
;To set CPUM
X
= 10
B0BSET
FCPUM1
Note: If T0ENB = 0, T0 is without wakeup from green mode to normal/slow mode function.