Rev. 1.20 86 January 23, 2015 Rev. 1.20 87 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
Bit3 PT0ON:PTM0CounterOn/OffControl
0:Off
1:On
Thisbitcontrolstheoverallon/offfunctionofthePTM0.Settingthebithighenables
thecountertorun,clearingthebitdisablesthePTM0.Clearingthisbittozerowill
stopthecounterfromcountingandturnofftheP TM 0whichwillreduceitspower
consumption.Whenthebitchangesstatefromlowtohightheinternalcountervalue
willberesettozero,howeverwhenthebitchangesfromhightolow,theinternal
counterwillretainitsresidualvalueuntilthebitreturnshighagain.
IfthePTM0isintheCompareMatchOutputMode,PWMoutputModeorSingle
PulseOutputModethenthePTMoutputpinwillberesettoitsinitialcondition,as
speciedbythePT0OCbit,whenthePT0ONbitchangesfromlowtohigh.
Bit2~0 Unimplemented,readas"0"
PTM0C1 Register
Bit 7 6 5 4 3 2 1 0
Name PT0M1 PT0M0 PT0IO1 PT0IO0 PT0OC PT0POL PT0CKS PT0CCLR
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
Bit7~6 PT0M1~PT0M0:SelectPTM0OperatingMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodeforthePTM0.Toensurereliable
operationthePTM0shouldbeswitchedoffbeforeanychangesaremadetothebits.In
theTimer/CounterMode,thePTM0outputpinstateisundened.
B
it5~4 PT0IO1~PT0IO0:SelectTP1outputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode/SinglePulseOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Singlepulseoutput
CaptureInputMode
00:InputcaptureatrisingedgeofTP1_0,TP1_1orTCK1
01:InputcaptureatfallingedgeofTP1_0,TP1_1orTCK1
10:Inputcaptureatfalling/risingedgeofTP1_0,TP1_1orTCK1
11:Inputcapturedisabled
Timer/counterMode:
Unused
ThesetwobitsareusedtodeterminehowthePTM0outputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modethePTM0isrunning.