EasyManua.ls Logo

Holtek BS82B12A-3 - Page 76

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 76 January 23, 2015 Rev. 1.20 77 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
Bit3 CT0ON:CTM0CounterOn/OffControl
0:Off
1:On
Thisbitcontrolstheoverallon/offfunctionoftheCTM0.Settingthebithighenables
thecountertorun,clearingthebitdisablestheCTM0.Clearingthisbittozerowill
stopthecounterfromcountingandturnofftheCTM0whichwillreduceitspower
consumption.Whenthebitchangesstatefromlowtohightheinternalcountervalue
willberesettozero,howeverwhenthebitchangesfromhightolow,theinternal
counterwillretainitsresidualvalue.
IftheCTM0isintheCompareMatchOutputModethentheCTM0outputpinwill
beresettoitsinitialcondition,asspeciedbytheCT0OCbit,whentheCT0ONbit
changesfromlowtohigh.
Bit2~0 CT0RP2~CT0RP0:CTM0CCRP3-bitregister,comparedwiththeCTM0Counter
bit9~bit7ComparatorPMatchPeriod
000:1024CTM0clocks
001:128CTM0clocks
010:256CTM0clocks
011:384CTM0clocks
100:512CTM0clocks
101:640CTM0clocks
110:768CTM0clocks
111:896CTM0clocks
ThesethreebitsareusedtosetupthevalueontheinternalCCRP3-bitregister,which
arethencomparedwiththeinternalcounter’shighestthreebits.Theresultofthis
comparisoncanbeselectedtocleartheinternalcounteriftheCT0CCLRbitissetto
zero.SettingtheCT0CCLRbittozeroensuresthatacomparematchwiththeCCRP
valueswillresettheinternalcounter.AstheCCRPbitsareonlycomparedwiththe
highestthreecounterbits,thecomparevaluesexistin128clockcyclemultiples.
Clearingallthreebitstozeroisineffectallowingthecountertooverflowatits
maximumvalue.
CTM0C1 Register
Bit 7 6 5 4 3 2 1 0
Name CT0M1 CT0M0 CT0IO1 CT0IO0 CT0OC CT0POL CT0DPX CT0CCLR
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR 0 0 0 0 0 0 0 0
Bit7~6 CT0M1~CT0M0:SelectCTM0OperatingMode
00:CompareMatchOutputMode
01:Undened
10:PWMMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheCTM0.Toensurereliable
operationtheCTM0shouldbeswitchedoffbeforeanychangesaremadetothe
CT0M1andCT0M0bits.IntheTimer/CounterMode,theCTM0outputpincontrol
mustbedisabled.
Bit5~4 CT0IO1~CT0IO0:SelectTP0outputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode
00:PWMOutputinactivestate
01:PWMOutputactivestate
10:PWMoutput
11:Undened

Table of Contents

Related product manuals