BS85B12-3/BS85C20-3/BS85C20-5
Touch Key Flash MCU with LCD/LED Driver
Bitꢀ2ꢀ
TnPOL:ꢀTPn_0,ꢀTPn_1ꢀOutputꢀpolarityꢀControlꢀ
ꢀ 0:ꢀNon-invertꢀ
ꢀ 1:ꢀInvert
ThisꢀbitꢀcontrolsꢀtheꢀpolarityꢀofꢀtheꢀTPn_0ꢀorꢀTPn_1ꢀoutputꢀpin.ꢀWhenꢀtheꢀbitꢀisꢀsetꢀ
highꢀtheꢀTMꢀoutputꢀpinꢀwillꢀbeꢀinvertedꢀandꢀnotꢀinvertedꢀwhenꢀtheꢀbitꢀisꢀzero.ꢀItꢀhasꢀnoꢀ
effectꢀifꢀtheꢀTMꢀisꢀinꢀtheꢀTimer/CounterꢀMode.
Bitꢀ1ꢀ
Bitꢀ0ꢀ
TnDPX:ꢀTMnꢀPWMꢀperiod/dutyꢀControlꢀ
ꢀ 0:ꢀCCRPꢀ-ꢀperiod;ꢀCCRAꢀ-ꢀdutyꢀ
ꢀ 1:ꢀCCRPꢀ-ꢀduty;ꢀCCRAꢀ-ꢀperiod
Thisꢀbit,ꢀdeterminesꢀwhichꢀofꢀtheꢀCCRAꢀandꢀCCRPꢀregistersꢀareꢀusedꢀforꢀperiodꢀandꢀ
dutyꢀcontrolꢀofꢀtheꢀPWMꢀwaveform.
TnCCLR:ꢀSelectꢀTMnꢀCounterꢀclearꢀconditionꢀ
ꢀ 0:ꢀTMnꢀComparatrorꢀPꢀmatchꢀ
ꢀ 1:ꢀTMnꢀComparatrorꢀAꢀmatch
Thisꢀbitꢀisꢀusedꢀtoꢀselectꢀtheꢀmethodꢀwhichꢀclearsꢀtheꢀcounter.ꢀRememberꢀthatꢀtheꢀ
CompactꢀTMꢀcontainsꢀtwoꢀcomparators,ꢀComparatorꢀAꢀandꢀComparatorꢀP,ꢀeitherꢀofꢀ
whichꢀcanꢀbeꢀselectedꢀtoꢀclearꢀtheꢀinternalꢀcounter.ꢀWithꢀtheꢀTnCCLRꢀbitꢀsetꢀhigh,ꢀ
theꢀcounterꢀwillꢀbeꢀclearedꢀwhenꢀaꢀcompareꢀmatchꢀoccursꢀfromꢀtheꢀComparatorꢀA.ꢀ
Whenꢀtheꢀbitꢀisꢀlow,ꢀtheꢀcounterꢀwillꢀbeꢀclearedꢀwhenꢀaꢀcompareꢀmatchꢀoccursꢀfromꢀ
theꢀComparatorꢀPꢀorꢀwithꢀaꢀcounterꢀoverflow.ꢀAꢀcounterꢀoverflowꢀclearingꢀmethodꢀcanꢀ
onlyꢀbeꢀimplementedꢀifꢀtheꢀCCRPꢀbitsꢀareꢀallꢀclearedꢀtoꢀzero.ꢀTheꢀTnCCLRꢀbitꢀisꢀnotꢀ
usedꢀinꢀtheꢀPWMꢀMode.
Compact Type TM Operating Modes
TheꢀCompactꢀTypeꢀTMꢀcanꢀoperateꢀinꢀoneꢀofꢀthreeꢀoperatingꢀmodes,ꢀCompareꢀMatchꢀOutputꢀMode,ꢀ
PWMꢀ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ꢀoccursꢀ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ꢀtheꢀ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.ꢀIfꢀtheꢀCCRAꢀbitsꢀareꢀallꢀzero,ꢀtheꢀ
counterꢀwillꢀoverflowꢀwhenꢀitsꢀreachesꢀitsꢀmaximumꢀ10-bit,ꢀ3FFꢀHex,ꢀvalue,ꢀhoweverꢀhereꢀtheꢀTnAFꢀ
interruptꢀrequestꢀflagꢀwillꢀnotꢀbeꢀgenerated.
Rev. 1.20
77
�ꢀꢁꢀst 10ꢂ 2012