BS83A04A-3/BS83A04A-4
8-bit Touch Key Flash MCU
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
/
p
O
i
n
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
R
e
s
g
e
t
i
r
C
K
Q
S
M
U
X
R
a
e
d
D
a
a
t
R
g
e
s
i
e
t
r
S
y
e
s
t
m
W
a
e
k
u
-
p
P
A
o
n
y
l
W
k
a
-
e
u
p
S
l
e
c
e
t
Generic Input/Output Ports
Programming Considerations
Withinꢀtheꢀuserꢀprogram,ꢀoneꢀofꢀtheꢀthingsꢀfirstꢀtoꢀconsiderꢀisꢀportꢀinitialisation.ꢀAfterꢀaꢀreset,ꢀallꢀ
ofꢀtheꢀI/Oꢀdataꢀandꢀportꢀcontrolꢀregistersꢀwillꢀbeꢀsetꢀtoꢀhigh.ꢀThisꢀmeansꢀthatꢀallꢀI/Oꢀpinsꢀwillꢀbeꢀ
defaultedꢀ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ꢀregistersꢀareꢀthenꢀprogrammedꢀtoꢀsetupꢀ
someꢀpinsꢀasꢀoutputs,ꢀtheseꢀoutputꢀpinsꢀwillꢀhaveꢀanꢀinitialꢀhighꢀoutputꢀvalueꢀunlessꢀtheꢀassociatedꢀ
portꢀdataꢀregistersꢀareꢀ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.00
ꢇ9
�eꢀꢁꢂaꢁꢃ ꢄꢅꢆ ꢄ01ꢇ