Professional Documents
Culture Documents
2129mmca Ooo6: To Learn Tools Relevant To Embedded System and Lot Developmeni
2129mmca Ooo6: To Learn Tools Relevant To Embedded System and Lot Developmeni
2129MMCA OOO6
OBJECTIVES
S.No Experiment
INT1 of8051
3. Write a programn to show the use of INTO &
8051
4. Write a Cprogram to perform 8-bit addition in
AiM:
write an
embedded
pngram blakig of LED
micn Conhller
LED
Keil TDE
Microconto ller
int
(udy Dely
Void
OFr LEO 1) Diy LED
()
ON 0) LED
() while
(void) Gin Vojd
main
(undl); Doay
vojd
pin
LED 0)P2A EDLsbit
include #
PRoaRAM:
Mineoneler using
PosI
don ben ha
LED
REsULT:
29
blnk LED
)e100v0)
)+) (jo; for
Ex No: 2 WRIE A PRoGRAM GENERAjE A
AIM:
write a
prgram
generate a |0KHz
Sguan wave
go51,
HARDWARE RERUIREMENTS !
* Keil îDE
* 805) Mieroconboller
# incud.
Shit P)^o
pin / deela variable
main c )
l clear pot
J inhalize hmer 0 as
load value
THO Count hmer will
pin 1}
high lagt to Pl.o
stast himr
wait
Duerfl.w
gain Count
THo Oo3c;
pin
while
join
) Conhn ne wih
OuTpuT:
a
vele
26
REsvLs:
AM:
write a
HARDWARE REguREMENTS
LED
Kei îpE
8051 Microeonholler
PRotoRAM
Mov a, #2sh
Mov b, H12k
Add a,b
Mov foh, a nved 4oh rarm mtm loeehsn
Mov a, 25 h
Subb a, b
Mov 4ih, a sub resulk muve d b 4)h ram
Mov a, # 25h
Mul ab
Mov 4eb,
Mov. 4sh, b
Mov a,
Mov b, # 12h
Div ab
Mov 44h,
qusht mvd h 44h mem lo cahin
Mov 45h,k
Nmaindr Men locah'bu.
Mov
Mor
Erd
b 2
() A b 21
() A -b )3
(y
guokent ()
Remindu (1)
() Sne a 26
(vi) DEC 25
REsvL:
Al arihmehe
prchon
hes eYecuted
Microcanbollo
keil
LED
REguREMENTS! HaRDWARE
perkr
PosI hon add e-bit
Pgram
write
a
AiM:
AppIioN P-bit
PERFORM PROGRAM WRnE No:4 Ex.
A
ProGRAN:
ORG
Mov
Movo Contt
Mov A, P| Moves Contet
CLR C
Apn
Ad Co nteat
resul
cony
cong priak
L2 Muv P2, Ri
RI Pot
Mov P3, A
END
A 0fF
20
RESVL:
executd
WRnE A PROGRAM FoR îNIERFAcING
SIEPPER WITH
AIM:
write a
he mobr
skppr
with foa)
HARDWARE
Steppor mobr
Drive Circuit
Keil DDE
ORG D000H
ACALL DELAY
Moy P2, # o6 H
ACALL DELAY
SJ MP UP
R3,
# 255
HI: MoV
R3, H2
H2 : DINZ
R4, HI
DJNZ
RET
RESUIT:
mhr
The stenp
miiroconholler hes ben
fosi
exdate!
WRSE PROGRAM To
Lep AND
KEY PAD îNTERMCE THE
WITH
AIM:
write
he
and
prgram intefare
Posi
Kyped wih Hhe
HARDwARE REgukEMENT
LCD
Kypal
* Keil
Micntonbller
PRobRAM:
# include
Sbit rl PiA 0;
cbit r2 PI^
Sbit Y3 PI
Sbit 4 Pl 3;
sbit
Sbit C2 P si
keyp.d enaehiw
Sbit P3 o;
Sbit P3^I;
sbil en P3 2j
of pot
Void main c )
malis
Ledemd (o m3 ):
Delay C);
Deloy ())
Ledemd ow o) ) Curtor blinting
Lodemd (or 0) :
Dely (o;
Ledemd (0n 8)i
Delay C);
while ()
RI 0
Loddat C):
Dolay c):
Leddet C'e);
Delay () i
Deley'C):
1f (cs )
Loddet ('3);
Delay ())
Delay I ())
complla
scanning
RI l} r2 30;
Leddat ('4):
Delay () i
Deley ! C)i
Leddat ('5))
Delay cT:
Scamij
Leddat ('*):
Delay (>;
Delay' ();
3
Leddet C'0):
Delag (
Delayl ();
Leddat (#):
Delay C):
P2
Ru 0;
5
Deioy ()
Delay cTi
V.d doly ()
Unsignd int î;
Void Jloy! ()
int ki
Ungnd
for (jo ) j<200; j)
20
For (ko)
REsULTY
he dply kypd
intufeing
mierconholle has bren execubd.