ST2202A
20. POWER DOWN MODES
willꢀenableꢀSTPꢀmodeꢀinꢀtheꢀsameꢀmanner.ꢀWAIꢁ0ꢀandꢀ
WAIꢁ1ꢀmodesꢀcanꢀbeꢀwakedꢀupꢀbyꢀinterrupt.ꢀHowever,ꢀSTP
modeꢀcanꢀonlyꢀbeꢀwakedꢀupꢀbyꢀhardwareꢀreset.ꢀ
ST2202ꢀhasꢀthreeꢀpowerꢀdownꢀmodes:ꢀWAIꢁ0,ꢀWAIꢁ1ꢀandꢀ
STP.ꢀTheꢀinstructionꢀWAIꢀwillꢀenableꢀeitherꢀWAIꢁ0ꢀorꢀWAIꢁ1,ꢀ
whichꢀisꢀcontrolledꢀbyꢀWAITꢀ(F[2]).ꢀAndꢀtheꢀinstructionꢀSTPꢀ
ꢀ
ꢀ
TABLE 20-1 System Control Register (SYS)
Address Name R/W
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Default
Rꢀ
Wꢀ
XSELꢀ
XSELꢀ
OSTPꢀ
OSTPꢀ
XSTPꢀ
XSTPꢀ
WSKPꢀ WAITꢀ IRRENꢀ HIGHꢀ
WSKPꢀ WAITꢀ IRRENꢀ LVDENꢀ 0000ꢀ0000ꢀ
0000ꢀ0001ꢀ
$030 SYS
ꢁꢀ
Bitꢀ2:ꢀ ꢀ WAIT :ꢀWAIꢁ0ꢀ/ꢀWAIꢁ1modeꢀselectꢀbitꢀ
ꢀ=ꢀWAIꢀinstructionꢀcausesꢀtheꢀchipꢀtoꢀenterꢀWAIꢁ0ꢀmodeꢀ
1ꢀ=ꢀWAIꢀinstructionꢀcausesꢀtheꢀchipꢀtoꢀenterꢀWAIꢁ1ꢀmodeꢀ
0
ꢀ
20.1 WAI-0 Mode:
IfꢀWAITꢀisꢀcleared,ꢀWAIꢀinstructionꢀmakesꢀMCUꢀenterꢀWAIꢁ0ꢀ
mode.ꢀInꢀtheꢀmeanꢀtime,ꢀtheꢀoscillator,ꢀinterrupts,ꢀ
timer/counter,ꢀandꢀPSGꢀareꢀstillꢀworking.ꢀOnꢀtheꢀotherꢀhandꢀ
CPUꢀandꢀtheꢀrelatedꢀinstructionꢀexecutionꢀstop.ꢀAllꢀregisters,ꢀ
RAM,ꢀandꢀI/Oꢀpinsꢀwillꢀretainꢀtheꢀsameꢀstatesꢀasꢀthoseꢀ
beforeꢀtheꢀMCUꢀenteredꢀpowerꢀdownꢀmode.ꢀWAIꢁ0ꢀmodeꢀ
ꢀ
canꢀbeꢀwakedꢀupꢀbyꢀresetꢀorꢀinterruptꢀrequestꢀevenꢀIfꢀuserꢀ
setsꢀinterruptꢀdisableꢀflagꢀ
upꢀbutꢀnotꢀenteringꢀinterruptꢀserviceꢀroutine.ꢀIfꢀinterruptꢀ
disableꢀflagꢀisꢀclearedꢀ( =’0’),ꢀtheꢀcorrespondingꢀinterruptꢀ
I.ꢀInꢀthatꢀcaseꢀMCUꢀwillꢀbeꢀwakedꢀ
I
vectorꢀwillꢀbeꢀfetchedꢀandꢀtheꢀserviceꢀroutineꢀwillꢀbeꢀ
executed.ꢀTheꢀsampleꢀprogramꢀisꢀshownꢀbelow:ꢀ
LDAꢀ
STAꢀ
WAIꢀ
#$00ꢀ
<SYSꢀ
;ꢀWAIꢀ0ꢀmodeꢀ
ꢀ
20.2 WAI-1 Mode:
IfꢀWAITꢀisꢀset,ꢀWAIꢀinstructionꢀmakesꢀMCUꢀenterꢀWAIꢁ1ꢀ
mode.ꢀInꢀthisꢀmode,ꢀCPUꢀstops,ꢀbutꢀtheꢀPSG,ꢀtimer/counterꢀ
keepꢀrunningꢀifꢀtheirꢀclockꢀsourcesꢀareꢀfromꢀOSCX.ꢀTheꢀ
ꢀ
wakeꢁupꢀprocedureꢀisꢀtheꢀsameꢀasꢀforꢀWAIꢁ0.ꢀTheꢀ
differenceꢀisꢀthatꢀtheꢀwarmꢁupꢀcyclesꢀoccurꢀwhenꢀwakingꢀ
fromꢀWAIꢁ1.ꢀSampleꢀprogramꢀisꢀshownꢀasꢀfollowing:ꢀ
LDAꢀ
STAꢀ
WAIꢀ
#$04ꢀ
<SYSꢀ
;ꢀWAIꢀ1ꢀmodeꢀ
20.3 STP Mode:
STPꢀinstructionꢀwillꢀforceꢀMCUꢀtoꢀenterꢀstopꢀmode.ꢀInꢀthisꢀ
mode,ꢀMCUꢀstops,ꢀbutꢀPSG,ꢀtimer/counterꢀwon’tꢀstopꢀifꢀtheꢀ
canꢀonlyꢀbeꢀwakedꢀupꢀbyꢀhardwareꢀreset,ꢀandꢀtheꢀwarmꢁupꢀ
cyclesꢀoccurꢀatꢀtheꢀsameꢀtime.ꢀ
clockꢀsourceꢀisꢀfromꢀOSCX.ꢀInꢀpowerꢁdownꢀmode,ꢀMCUꢀ
ꢀ
ꢀ
***notice:ꢀ
Ifꢀ highꢀ frequencyꢀ wasꢀ optionedꢀ toꢀ crystalꢀ modeꢀ (notꢀ RCꢀ
oscillator),ꢀ systemꢀ clockꢀ needꢀ toꢀ beꢀ switchedꢀ toꢀ lowꢀ
ꢀ
frequencyꢀ(32768Hz)ꢀbeforeꢀintoꢀWAI1ꢀmode.ꢀ
;;afterꢀwakeꢀup.ꢀ
smb7ꢀꢀ
bbr7ꢀ ꢀ
smb6ꢀꢀ
<SYSꢀ
<SYS,$ꢀ
<SYSꢀ
;;ꢀChangeꢀtoꢀOSCXꢀ
;;ꢀWaitꢀOSCXꢀstableꢀ
;;ꢀOSCꢀOFFꢀ
ꢀ
ꢀ
ꢀ
ꢀ
rmb6ꢀꢀ
<SYSꢀ
;;ꢀOSCꢀON.ꢀ
jsrꢀ
ꢀ
WAIT_8msꢀ ;;ꢀForꢀOSCꢀstable.ꢀ
<SYSꢀ
<SYS,$ꢀ
rmb7ꢀꢀ
bbs7ꢀ ꢀ
;;ꢀChangeꢀtoꢀOSCꢀ
;;ꢀWaitꢀOSCꢀstable.
waiꢀ
ꢀ
ꢀ
ꢀ
;;ꢀsleepꢀ
ꢀ
ꢀ
ꢀ
ꢀ
ꢀ
ꢀ
ꢀ
Verꢀ2.5ꢀ
60
/75
ꢀ
9/16/2008ꢀ