EasyManua.ls Logo

Holtek BS82B12A-3 - Page 88

Holtek BS82B12A-3
168 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rev. 1.20 88 January 23, 2015 Rev. 1.20 89 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
IntheCompareMatchOutputMode,thePT0IO1~PT0IO0bitsdeterminehowthe
PTM0outputpinchangesstatewhenacomparematchoccursfromtheComparator
A.ThePTM0outputpincanbesetuptoswitchhigh,switchlowortotoggleits
presentstatewhenacomparematchoccursfromtheComparatorA.Whenthe
PT 0IO1~PT0IO0bitsarebothzero,thennochangewilltakeplaceontheoutput.
TheinitialvalueofthePTM0outputpinshouldbesetupusingthePT0OCbitinthe
PTM0C1register.NotethattheoutputlevelrequestedbythePT0IO1~PT0IO0bits
mustbedifferentfromtheinitialvaluesetupusingthePT0OCbitotherwisenochange
willoccuronthePTM1 outputpinwhenacomparematchoccurs.AfterthePTM0
outputpinchangesstateitcanberesettoitsinitiallevelbychangingthelevelofthe
PT0ONbitfromlowtohigh.
InthePWMMode,thePT0IO1andPT0IO0bitsdeterminehowthePTM0output
pinchangesstate whenacertaincomparematchconditionoccurs.ThePWM
outputfunctionismodiedbychangingthesetwobits.Itisnecessarytochangethe
valuesofthePT0IO1andPT0IO0bitsonlyafterthePTM0hasbeenswitchedoff.
UnpredictablePWMoutputswilloccurifthePT0IO1andPT0IO0bitsarechanged
whenthePTM0isrunning.
B
it3 PT0OC:TP1Outputcontrolbit
CompareMatchOutputMode
0:Initiallow
1:Initialhigh
PWMMode/SinglePulseOutputMode
0:Activelow
1:Activehigh
ThisistheoutputcontrolbitforthePTM0outputpin.Itsoperationdependsupon
whetherPTM0isbeingusedintheCompareMatchOutputModeorinthePWM
Mode/SinglePulseOutputMode.IthasnoeffectifthePTM0isintheTimer/Counter
Mode.IntheCompareMatchOutputModeitdeterminesthelogiclevelofthePTM0
outputpinbeforeacomparematchoccurs.InthePWMModeitdeterminesifthe
PWMsignalisactivehighoractivelow.
Bit2 PT0POL:TP1OutputpolarityControl
0:Non-invert
1:Invert
ThisbitcontrolsthepolarityofthePTM0outputpin.Whenthebitissethighthe
PTM0outputpinwillbeinvertedandnotinvertedwhenthebitiszero.Ithasnoeffect
ifthePTM0isintheTimer/CounterMode.
Bit1 PT0CKS:PTM0capturetriggersourceselect
0:FromTP1_0,TP1_1
1:FromTCK1
Bit0 PT0CCLR:SelectPTM0Counterclearcondition
0:PTM0ComparatrorPmatch
1:PTM0ComparatrorAmatch
Thisbitisusedtoselectthemethodwhichclearsthecounter.Rememberthatthe
PeriodicTMcontainstwocomparators,ComparatorAandComparatorP,eitherof
whichcanbeselectedtocleartheinternalcounter.WiththePT 0CCLR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Porwithacounteroverow.Acounteroverowclearingmethodcan
onlybeimplementediftheCCRPbitsareallclearedtozero.ThePT0CCLRbitisnot
usedinthePWM,SinglePulseorInputCaptureMode.

Table of Contents

Related product manuals