BS85B12-3/BS85C20-3/BS85C20-5
Touch Key Flash MCU with LCD/LED Driver
I/O Pin Structures
TheꢀaccompanyingꢀdiagramsꢀillustrateꢀtheꢀinternalꢀstructuresꢀofꢀsomeꢀgenericꢀI/Oꢀpinꢀtypes.ꢀAsꢀ
theꢀexactꢀlogicalꢀconstructionꢀofꢀtheꢀI/Oꢀpinꢀwillꢀdifferꢀfromꢀtheseꢀdrawings,ꢀtheyꢀareꢀsuppliedꢀasꢀaꢀ
guideꢀonlyꢀtoꢀassistꢀwithꢀtheꢀfunctionalꢀunderstandingꢀofꢀtheꢀI/Oꢀpins.ꢀTheꢀwideꢀrangeꢀofꢀpin-sharedꢀ
structuresꢀdoesꢀnotꢀpermitꢀallꢀtypesꢀtoꢀbeꢀshown.
V
D
D
P
R
S
l
u
-
l
i
H
h
g
e
s
g
e
t
i
r
C
o
n
r
l
o
t
B
t
i
l
e
c
e
t
W
a
e
k
D
t
a
a
B
u
s
D
Q
P
l
u
u
l
-
p
W
i
r
e
t
C
o
n
r
l
o
t
R
e
s
g
e
t
i
r
C
K
Q
S
C
i
h
p
R
e
e
s
t
I
/
O
i
n
p
R
a
e
d
C
o
t
n
o
r
l
R
e
s
g
e
t
i
r
D
t
a
a
B
i
t
D
Q
W
i
r
e
t
D
t
a
a
e
s
g
R
e
t
i
r
C
K
Q
S
M
U
X
R
a
e
d
D
a
t
R
a
g
e
s
i
e
t
r
S
y
e
s
t
m
W
a
k
e
-
u
p
P
A
o
n
y
l
W
k
a
-
e
u
p
S
l
e
c
e
t
Generic Input/Output Structure
Programming Considerations
Withinꢀtheꢀuserꢀprogram,ꢀoneꢀofꢀtheꢀfirstꢀthingsꢀtoꢀconsiderꢀisꢀportꢀinitialisation.ꢀAfterꢀaꢀreset,ꢀallꢀofꢀ
theꢀI/Oꢀdataꢀandꢀportꢀcontrolꢀregisterꢀwillꢀbeꢀsetꢀhigh.ꢀThisꢀmeansꢀthatꢀallꢀI/Oꢀpinsꢀwillꢀdefaultꢀtoꢀ
anꢀinputꢀstate,ꢀtheꢀlevelꢀofꢀwhichꢀdependsꢀonꢀtheꢀotherꢀconnectedꢀcircuitryꢀandꢀwhetherꢀpull-highꢀ
selectionsꢀhaveꢀbeenꢀchosen.ꢀIfꢀtheꢀportꢀcontrolꢀregister,ꢀPAC~PEC,ꢀisꢀthenꢀprogrammedꢀtoꢀsetupꢀ
someꢀpinsꢀasꢀoutputs,ꢀtheseꢀoutputꢀpinsꢀwillꢀhaveꢀanꢀinitialꢀhighꢀoutputꢀvalueꢀunlessꢀtheꢀassociatedꢀ
portꢀdataꢀregister,ꢀPA~PE,ꢀisꢀfirstꢀprogrammed.ꢀSelectingꢀwhichꢀpinsꢀareꢀinputsꢀandꢀwhichꢀareꢀ
outputsꢀcanꢀbeꢀachievedꢀbyte-wideꢀbyꢀloadingꢀtheꢀcorrectꢀvaluesꢀintoꢀtheꢀappropriateꢀportꢀcontrolꢀ
registerꢀorꢀbyꢀprogrammingꢀindividualꢀbitsꢀinꢀtheꢀportꢀcontrolꢀregisterꢀusingꢀtheꢀ"SETꢀ[m].i"ꢀandꢀ
"CLRꢀ[m].i"ꢀinstructions.ꢀNoteꢀthatꢀwhenꢀusingꢀtheseꢀbitꢀcontrolꢀinstructions,ꢀaꢀread-modify-writeꢀ
operationꢀtakesꢀplace.ꢀTheꢀmicrocontrollerꢀmustꢀfirstꢀreadꢀinꢀtheꢀdataꢀonꢀtheꢀentireꢀport,ꢀmodifyꢀitꢀtoꢀ
theꢀrequiredꢀnewꢀbitꢀvaluesꢀandꢀthenꢀrewriteꢀthisꢀdataꢀbackꢀtoꢀtheꢀoutputꢀports.
PortꢀAꢀhasꢀtheꢀadditionalꢀcapabilityꢀofꢀprovidingꢀwake-upꢀfunctions.ꢀWhenꢀtheꢀdeviceꢀisꢀinꢀtheꢀ
SLEEPꢀorꢀIDLEꢀMode,ꢀvariousꢀmethodsꢀareꢀavailableꢀtoꢀwakeꢀtheꢀdeviceꢀup.ꢀOneꢀofꢀtheseꢀisꢀaꢀhighꢀ
toꢀlowꢀtransitionꢀofꢀanyꢀofꢀtheꢀPortꢀAꢀpins.ꢀSingleꢀorꢀmultipleꢀpinsꢀonꢀPortꢀAꢀcanꢀbeꢀsetupꢀtoꢀhaveꢀthisꢀ
function.
Rev. 1.20
66
�ꢀꢁꢀst 10ꢂ 2012