SN8P2977
8-Bit Micro-Controller with Regulator, PGIA, 24-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 53
Version 1.7
Example: Switch normal/slow mode to Green mode and enable T0 wakeup function.
; Set T0 timer wakeup function.
B0BCLR
FT0IEN
; To disable T0 interrupt service
B0BCLR
FT0EN
; 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
B0BCLR
FCPUM0
;To set CPUMx = 10
B0BSET
FCPUM1
Note: During the green mode with T0 wake-up function, the wakeup pins and T0 can wakeup the system
back to the last mode. T0 wake-up period is controlled by program and T0EN must be set.
Example: Switch normal/slow mode to Green mode and enable ADC wakeup function.
; Set ADC timer wakeup function.
MOV
A,#11111111b
B0MOV
VREG,A
; To Turn On all analog voltage regulators.
MOV
A,#00000111b
B0MOV
AMPM1,A
; To Set PGIA function.
B0BSET
FADCENB
; To enable ADC Function
; Go into green mode with high clock running
B0BSET
FCPUM1
;To set CPUM0 = 1
Note_1: when system into green mode with conditions of ADC function enable and high clock still
running, the system will be wakeup when ADC conversion complete.
Note_2: The ADC green mode wakeup function is disable when ADCEN=0 or stop high clock (STPHX=1)
is set before into green mode.