Rev. 1.20 66 January 23, 2015 Rev. 1.20 67 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
Pull-high Resistors
Manyproductapplicationsrequirepull-highresistorsfortheirswitchinputsusuallyrequiringthe
useofanexternalresistor.Toeliminatetheneedfortheseexternalresistors,allI/Opins,when
conguredasaninputhavethecapabilityofbeingconnectedtoaninternalpull-highresistor.These
pull-highresistorsareselectedusingregistersPAPU~PDPU,andareimplementedusingweak
PMOStransistors.
Port A Wake-up
TheHALTinstructionforcesthemicrocontrollerintotheSLEEPorIDLEModewhichpreserves
power,afeaturethatisimportantforbatteryandotherlow-powerapplications.Variousmethods
existtowake-upthemicrocontroller,oneofwhichistochangethelogicconditionononeofthePort
Apinsfromhightolow.Thisfunctionisespeciallysuitableforapplicationsthatcanbewokenup
viaexternalswitches.EachpinonPortAcanbeselectedindividuallytohavethiswake-upfeature
usingthePAWUregister.
I/O Port Control Registers
EachI/OporthasitsowncontrolregisterknownasPAC~PDC,tocontroltheinput/output
configuration.Withthiscontrolregister,eachCMOSoutputorinputcanbereconfigured
dynamicallyundersoftwarecontrol.EachpinoftheI/Oportsisdirectlymappedtoabitinits
associatedportcontrolregister.FortheI/Opintofunctionasaninput,thecorrespondingbitofthe
controlregistermustbewrittenasa"1".Thiswillthenallowthelogicstateoftheinputpintobe
directlyreadbyinstructions.Whenthecorrespondingbitofthecontrolregisteriswrittenasa"0",
theI/OpinwillbesetupasaCMOSoutput.Ifthepiniscurrentlysetupasanoutput,instructions
canstillbeusedtoreadtheoutputregister.However,itshouldbenotedthattheprogramwillinfact
onlyreadthestatusoftheoutputdatalatchandnottheactuallogicstatusoftheoutputpin.
I/O Pin Structures
TheaccompanyingdiagramsillustratetheinternalstructuresofsomegenericI/Opintypes.As
theexactlogicalconstructionoftheI/Opinwilldifferfromthesedrawings,theyaresuppliedasa
guideonlytoassistwiththefunctionalunderstandingoftheI/Opins.Thewiderangeofpin-shared
structuresdoesnotpermitalltypestobeshown.
Generic Input/Output Structure