Rev. 1.20 68 January 23, 2015 Rev. 1.20 69 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
Bit1~0 PCPS1~PCPS0:PC3~PC0sourcecurrentselect
00:source=Level0(min.)
01:source=Level1
10:source=Level2
11:source=Level3(max.)
ThesebitsareavailablewhenthecorrespondingpinisconguredasaCMOSoutput.
SLEDC1 Register – BS82C16A-3/BS82D20A-3
Bit 7 6 5 4 3 2 1 0
Name — — PDPS1 PDPS0
PCPS3 PCPS2 PCPS1 PCPS0
R/W — — R/W R/W R/W R/W R/W R/W
POR — — 0 1 0 1 0 1
Bit7~6 Unimplemented,readas"0"
Bit5~4 PDPS1~PDPS0:PD3~PD0sourcecurrentselect
00:source=Level0(min.)
01:source=Level1
10:source=Level2
11:source=Level3(max.)
ThesebitsareavailablewhenthecorrespondingpinisconguredasaCMOSoutput.
Bit3~2 PCPS3~PCPS2:PC7~PC4sourcecurrentselect
00:source=Level0(min.)
01:source=Level1
10:source=Level2
11:source=Level3(max.)
ThesebitsareavailablewhenthecorrespondingpinisconguredasaCMOSoutput.
Bit1~0 PCPS1~PCPS0:PC3~PC0sourcecurrentselect
00:source=Level0(min.)
01:source=Level1
10:source=Level2
11:source=Level3(max.)
ThesebitsareavailablewhenthecorrespondingpinisconguredasaCMOSoutput.
Programming Considerations
Withintheuserprogram,oneoftherstthingstoconsiderisportinitialisation.Afterareset,allof
theI/Odataandportcontrolregisterswillbesethigh.ThismeansthatallI/Opinswilldefaultto
aninputstate,thelevelofwhichdependsontheotherconnectedcircuitryandwhetherpull-high
selectionshavebeenchosen.Iftheportcontrolregisters,PAC~PDC,arethenprogrammedtosetup
somepinsasoutputs,theseoutputpinswillhaveaninitialhighoutputvalueunlesstheassociated
portdataregisters,PA~PD,arerstprogrammed.Selectingwhichpinsareinputsandwhichare
outputscanbeachievedbyte-widebyloadingthecorrectvaluesintotheappropriateportcontrol
registerorbyprogrammingindividualbitsintheportcontrolregisterusingthe"SET[m].i"and
"CLR[m].i"instructions.Notethatwhenusingthesebitcontrolinstructions,aread-modify-write
operationtakesplace.Themicrocontrollermustrstreadinthedataontheentireport,modifyitto
therequirednewbitvaluesandthenrewritethisdatabacktotheoutputports.
PortAhastheadditionalcapabilityofprovidingwake-upfunctions.Whenthedeviceisinthe
SLEEPorIDLEMode,variousmethodsareavailabletowakethedeviceup.Oneoftheseisahigh
tolowtransitionofanyofthePortApins.SingleormultiplepinsonPortAcanbesetuptohavethis
function.