Preliminary
SN8P1702A/SN8P1703A
8-bit micro-controller build-in 12-bit ADC
SYSTEM MODE SWITCHING
Switch normal/slow mode to power down (sleep) mode.
CPUM0 = 1
B0BSET
FCPUM0
; Set CPUM0 = 1.
During the sleep, only the wakeup pin and reset can wakeup the system back to the normal mode.
Switch normal mode to slow mode.
B0BSET
B0BSET
FCLKMD
FSTPHX
;To set CLKMD = 1, Change the system into slow mode
;To stop external high-speed oscillator for power saving.
ꢀ
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
DECMS
JMP
Z, #27
Z
@B
; If VDD = 5V, internal RC=32KHz (typical) will delay
; 0.125ms X 81 = 10.125ms for external clock stable
@@:
;
B0BCLR
FCLKMD
; Change the system back to the normal mode
ꢁ
Example: Go into Green mode and enable TC0 wakeup function.
; Set TC0 timer wakeup function.
B0BCLR
B0BCLR
MOV
FTC0IEN
FTC0ENB
A,#20H
; To disable TC0 interrupt service
; To disable TC0 timer
;
B0MOV
MOV
TC0M,A
A,#74H
; To set TC0 clock = Fcpu / 64
B0MOV
TC0C,A
; To set TC0C initial value = 74H (To set TC0 interval = 10
ms)
B0BCLR
B0BCLR
B0BSET
FTC0IEN
FTC0IRQ
FTC0ENB
FTC0GN
; To disable TC0 interrupt service
; To clear TC0 interrupt request
; To enable TC0 timer
B0BSET
; To enable TC0 wakeup function
; Go into green mode
B0BCLR
FCPUM0
FCPUM1
;To set CPUMx = 10
B0BSET
ꢀ
Note: If TC0ENB = 0 or TC0GN = 0, TC0 will not wakeup from green mode to normal/slow mode function.
SONiX TECHNOLOGY CO., LTD
Page 50
Revision 0.5