BS85B12-3/BS85C20-3/BS85C20-5
Touch Key Flash MCU with LCD/LED Driver
Standard Type TM Operating Modes
TheꢀStandardꢀTypeꢀTMꢀcanꢀoperateꢀinꢀoneꢀofꢀfiveꢀoperatingꢀmodes,ꢀCompareꢀMatchꢀOutputꢀ
Mode,ꢀPWMꢀMode,ꢀSingleꢀPulseꢀOutputꢀMode,ꢀCaptureꢀInputꢀModeꢀorꢀTimer/CounterꢀMode.ꢀTheꢀ
operatingꢀmodeꢀisꢀselectedꢀusingꢀtheꢀTnM1ꢀandꢀTnM0ꢀbitsꢀinꢀtheꢀTMnC1ꢀregister.
Compare Match Output Mode
Toꢀselectꢀthisꢀmode,ꢀbitsꢀTnM1ꢀandꢀTnM0ꢀinꢀtheꢀTMnC1ꢀregister,ꢀshouldꢀbeꢀsetꢀtoꢀ00ꢀrespectively.ꢀ
Inꢀthisꢀmodeꢀonceꢀtheꢀcounterꢀisꢀenabledꢀandꢀrunningꢀitꢀcanꢀbeꢀclearedꢀbyꢀthreeꢀmethods.ꢀTheseꢀareꢀ
aꢀcounterꢀoverflow,ꢀaꢀcompareꢀmatchꢀfromꢀComparatorꢀAꢀandꢀaꢀcompareꢀmatchꢀfromꢀComparatorꢀP.ꢀ
WhenꢀtheꢀTnCCLRꢀbitꢀisꢀlow,ꢀthereꢀareꢀtwoꢀwaysꢀinꢀwhichꢀtheꢀcounterꢀcanꢀbeꢀcleared.ꢀOneꢀisꢀwhenꢀ
aꢀcompareꢀmatchꢀfromꢀComparatorꢀP,ꢀtheꢀotherꢀisꢀwhenꢀtheꢀCCRPꢀbitsꢀareꢀallꢀzeroꢀwhichꢀallowsꢀ
theꢀcounterꢀtoꢀoverflow.ꢀHereꢀbothꢀTnAFꢀandꢀTnPFꢀinterruptꢀrequestꢀflagsꢀforꢀComparatorꢀAꢀandꢀ
ComparatorꢀPꢀrespectively,ꢀwillꢀbothꢀbeꢀgenerated.
IfꢀtheꢀTnCCLRꢀbitꢀinꢀtheꢀTMnC1ꢀregisterꢀisꢀhighꢀthenꢀtheꢀcounterꢀwillꢀbeꢀclearedꢀwhenꢀaꢀcompareꢀ
matchꢀoccursꢀfromꢀComparatorꢀA.ꢀHowever,ꢀhereꢀonlyꢀtheꢀTnAFꢀinterruptꢀrequestꢀflagꢀwillꢀbeꢀ
generatedꢀevenꢀifꢀtheꢀvalueꢀofꢀtheꢀCCRPꢀbitsꢀisꢀlessꢀthanꢀthatꢀofꢀtheꢀCCRAꢀregisters.ꢀThereforeꢀwhenꢀ
TnCCLRꢀisꢀhighꢀnoꢀTnPFꢀinterruptꢀrequestꢀflagꢀwillꢀbeꢀgenerated.ꢀInꢀtheꢀCompareꢀMatchꢀOutputꢀ
Mode,ꢀtheꢀCCRAꢀcanꢀnotꢀbeꢀsetꢀtoꢀ0.
Coꢀnter
TnCCLR = 0; TnM[1:0] = 00
Coꢀnter Valꢀe
overflow
CCRP = 0
CCRP > 0
Coꢀnter cleared by CCRP valꢀe
0x3FF
CCRP
CCR�
CCRP > 0
Paꢀse Resꢀme
Coꢀnter
Reset
Stop
Time
TnON
TnP�U
Tn�POL
CCRP Int.
Flaꢁ TnPF
CCR� Int.
Flaꢁ Tn�F
TM O/P Pin
Oꢀtpꢀt inverts
when TnPOL is hiꢁh
Reset to initial valꢀe
Oꢀtpꢀt controlled
by other pin-shared fꢀnction
Oꢀtpꢀt not affected by
Tn�F flaꢁ. Remains Hiꢁh
ꢀntil reset by TnON bit
Oꢀtpꢀt Pin set
to Initial Level
Low if TnOC = 0
Oꢀtpꢀt Toꢁꢁle
with Tn�F flaꢁ
Oꢀtpꢀt Pin
Now TnIO [1:0] = 10
�ctive Hiꢁh Oꢀtpꢀt
Select
Here TnIO [1:0] = 11
Toꢁꢁle Oꢀtpꢀt Select
Compare Match Output Mode – TnCCLR = 0
Note:ꢀ1.ꢀWithꢀTnCCLR=0ꢀaꢀComparatorꢀPꢀmatchꢀwillꢀclearꢀtheꢀcounter
2.ꢀTheꢀTMꢀoutputꢀpinꢀisꢀcontrolledꢀonlyꢀbyꢀtheꢀTnAFꢀflag
3.ꢀTheꢀoutputꢀpinꢀisꢀresetꢀtoꢀitsinitialꢀstateꢀbyꢀaꢀTnONꢀbitꢀrisingꢀedge
Rev. 1.20
87
�ꢀꢁꢀst 10ꢂ 2012