Rev. 1.20 94 January 23, 2015 Rev. 1.20 95 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
Single Pulse Mode
Toselectthismode,bitsPT0M1andPT0M0inthePTM0C1registershouldbesetto10
respectivelyandalsothePT0IO1andPT0IO0bitsshouldbesetto11respectively.TheSinglePulse
OutputMode,asthenamesuggests,willgenerateasingleshotpulseonthePTM0outputpin.
ThetriggerforthepulseoutputleadingedgeisalowtohightransitionofthePT0ONbit,whichcan
beimplementedusingtheapplicationprogram.HoweverintheSinglePulseMode,thePT0ONbit
canalsobemadetoautomaticallychangefromlowtohighusingtheexternalTCK1pin,whichwill
inturninitiatetheSinglePulseoutput.WhenthePT0ONbittransitionstoahighlevel,thecounter
willstartrunningandthepulseleadingedgewillbegenerated.ThePT0ONbitshouldremainhigh
whenthepulseisinitsactivestate.Thegeneratedpulsetrailingedgewillbegeneratedwhenthe
PT0ONbitisclearedtozero,whichcanbeimplementedusingtheapplicationprogramorwhena
comparematchoccursfromComparatorA.
HoweveracomparematchfromComparatorAwillalsoautomaticallyclearthePT0ONbitandthus
generatetheSinglePulseoutputtrailingedge.InthiswaytheCCRAvaluecanbeusedtocontrolthe
pulsewidth.AcomparematchfromComparatorAwillalsogenerateaPTM0interrupt.Thecounter
canonlyberesetbacktozerowhenthePT0ONbitchangesfromlowtohighwhenthecounter
restarts.IntheSinglePulseModeCCRPisnotused.ThePT0CCLRbitisnotusedinthisMode.
Single Pulse Generation