ST2202A
12.1.2 PRES
InstructionꢀwriteꢀtowardꢀPRSꢀwillꢀreset,ꢀenableꢀorꢀselectꢀclockꢀ
sourcesꢀforꢀPRES.ꢀ
WhenꢀuserꢀsetꢀexternalꢀinterruptꢀasꢀtheꢀinputꢀofꢀPRESꢀforꢀeventꢀ
counter,ꢀ combiningꢀ PRESꢀ andꢀ Timer1ꢀ willꢀ getꢀ aꢀ 16bitꢁeventꢀ
counter.ꢀ
TheꢀprescalerꢀPRESꢀisꢀanꢀ8ꢁbitsꢀcounterꢀasꢀshownꢀinꢀFIGUREꢀ
12ꢁ1.ꢀ Whichꢀ providesꢀ fourꢀ clockꢀ sourcesꢀ forꢀ baseꢀ timerꢀ andꢀ
timer1,ꢀandꢀitꢀisꢀcontrolledꢀbyꢀregisterꢀPRS.ꢀTheꢀinstructionꢀreadꢀ
towardꢀPRSꢀwillꢀbringꢀoutꢀtheꢀcontentꢀofꢀPRESꢀandꢀtheꢀ
ꢀ
TABLE 12-2 Prescaler Control Register (PRS)
Bit 6 Bit 5 Bit 4 Bit 3 Bit 2
PRS[7]ꢀ PRS[6]ꢀ PRS[5]ꢀ PRS[4]ꢀ PRS[3]ꢀ PRS[2]ꢀ PRS[1]ꢀ PRS[0]ꢀ 0000ꢀ0000ꢀ
SRESꢀ SENAꢀ SENTꢀ ꢁꢀ ꢁꢀ ꢁꢀ ꢁꢀ ꢁꢀ ꢀ 000ꢀꢁꢀ ꢀ ꢁꢀꢁꢀꢁꢀꢁꢀ
Address Name R/W
Bit 7
Bit 1
Bit 0
Default
Rꢀ
$023
PRS
Wꢀ
ꢀ
READꢀ
Bitꢀ7~0:ꢀPRS[7~0] :ꢀValueꢀofꢀPRESꢀcounterꢀ
ꢀ
WRITEꢀ
Bitꢀ7:ꢀ ꢀ ꢀ SRES :ꢀPrescalerꢀResetꢀbitꢀ
Writeꢀ“1”ꢀtoꢀresetꢀtheꢀprescalerꢀ(PRS[7~0])ꢀ
ꢀ
Bitꢀ6:ꢀ ꢀ ꢀ SENA :ꢀPrescalerꢀenableꢀbitꢀ
0ꢀ=ꢀDisableꢀprescalerꢀcountingꢀ
1ꢀ=ꢀEnableꢀprescalerꢀcountingꢀ
ꢀ
Bitꢀ5:ꢀ ꢀ ꢀ SENT :ꢀClockꢀsource(TCLK)ꢀselectionꢀforꢀprescallerꢀPRESꢀ
0ꢀ=ꢀClockꢀsourceꢀfromꢀsystemꢀclockꢀ“SYSCK”ꢀ
1ꢀ=ꢀClockꢀsourceꢀfromꢀexternalꢀeventsꢀ“INTX”ꢀ
ꢀ
12.1.3 PREW
TheꢀprescalerꢀPREWꢀisꢀanꢀ8ꢁbitsꢀcounterꢀasꢀshownꢀinꢀFigureꢀ
11ꢁ6.ꢀ PREWꢀ providesꢀ fourꢀ clocksꢀ sourceꢀ forꢀ baseꢀ timerꢀ andꢀ
timer1.ꢀItꢀstopsꢀcountingꢀonlyꢀifꢀOSCXꢀstopsꢀorꢀhardwareꢀresetꢀ
occurs.ꢀ
Verꢀ2.5ꢀ
26
/75
ꢀ
9/16/2008ꢀ