IO Port Programming
IO Port Programming
f
Thene ene to tol ef 4opns ot Po, P, P- Pe
32 pins ne Kt anide fon fou
pot
8 pns
&
whee lach pot takes Punetiovs
Perto - &at
Portl - s i t
Pot& -ght
STmp back
Dual ole e Poto
tt woths as
Foo-ADy: Bost udtplenes addhes and data
though pot o to Save pins.
PoRTI as npt:
Pett bs heen as a output
pet, to Make Ct
an nput pot again,
witng
Ito ol C bit.
Hov A, t#topph
Ct as nput pert
Hov , 4
Acal Dela
Pent2: 24 to a)
2)
nide)
no neac ter putt up penttos (puwnt
Pont 2 as nput
s ongt pot
Dual voa o pont
H_he ode Adden Rines
Otthen fnetion Pont 2. rt2 ombtns to fsm
Aong witt poto,
* adhes.
the entnal emey
Nachine ycle
Mov R2,# Cent|
Hee NOP
NoP
NOP
DJNZ R2, Here 2.
ReT 2
SCountt = Td -2
Ceunt 0.sxo 2
l·ogxID
o.sDmS
Hee 2
DTNZ R2,
2
Rer
SHpt Pragan to duplay Sqnaeiae
lHere! Set b p! o
Acall Delay
Aall Delat
Here
follewig leten N to P
(a) ¢ Sw=0 Senl
4Sw l, send Cotta y'to Pz
(b)
Set b Pi? mtmad
HoU p2,#'N
o p2, +y
Randing
A Swtteh cs onneotel to
to pn 27. íte a pogram to gt the Slats
SeTG P27
Aqain: Nov e, Pl-o
Mov P2:7, C
SIMP
Rang a RoH a
(eenal)
Assum the ON chip RoH has
ON Nen açe. oute
a Hon
the
a Pogam to copy ct tom (ode Space to 1e
oPr omey Spaee Stasting at adden to H(Sha
Po.
Pace a layte in ugper Ren,ge a Copy
Here
Gnit:
SIMP