Professional Documents
Culture Documents
MC Notes Unit 2
MC Notes Unit 2
Date
Page
Untt-
8051uoorpming
Lauguagt uograroming
dyndax :
Labd: Mntmoni cLopeands L Comnuntu)
Prograwm
my a^m
Asem blen
Proq ram
ny.ohf. -D Fls
nkea
Progra
s F . aby
OH
my . Ley
8051
Data tape
bas anlyr dats a gh
Di Byte (D8)
Usid t d e i - + data
Can b
daimal hx ov
ASC
ORG Lorigtn)
Ind cati bg nnin4 adds
ORG 5 l0H
DR Cwvwnt 3tet
frert
EGU_ (Equata)
USa o dsa
Const. us Hout OCpy
M
Ea Count EqU 2
END (End)
Indf cals
amem
emd
SouruF
Andirg o end dire cliv u he
1qnorad by aowmble.
8051 yogrammina in C
Advalaqs
easie e Rme Consuming
laien modih updal
ou Ca w end
Epd awilable in uncisn lieahia
C oCod aperab&to oi ucoatrollus
wi th tt mediitaba Moadilitatan
Dsadvautaaga:
T preduces
produd
pm aMcmbly
C Data TapE
Unsignad nt 16 bit
O to 6S53S oo00 -IFFFH)
by es ol RAM
&Ai roqtaw
wll Asenbly lauguay
Second augu to
,0 toge
portport 1.
A Aysownby
ORG 0
NEXT SETB PI2
CALL DELA
CLR P. a p 1ololo
CALL DELAY
Janp 3JMP NEXT
DELAY 1OV R3, OFFH4im
period
AAIN 3NZR3, AGIAIN
(RET
Oumau 3u
Nan ze/
Lo
C
F
8
-o
Date
Page
avd on as TLL
9
THI E L
TFrn dalay
lwo uays to (ua dalan n80S
DELAy
Mov R1 # 2S
Tmer to asau . dday)
Prorawmmed Cowatntena
clock puses,i Said to hea Timen".
To et TR
& SETB TRI o SET TCON. 6
Tmnl 'Te
hoetdua
GATE wven TR GATG1, INT
GATE 0 TR
(
eASSM
Date
Page
Timu o
Comdu Selhcloi
cleard or LL operatton (C/T:0)
Se Col opAlatin (ct1)
ML,MOMods &dr bit
Ceponoa
used
M Mo Opeati Mode
000 FF FH
O
Gruneal 16- O0
m e Counter
FFH
2 8 biE Autulods KneCaumu
3 TLO a 3-6it time
Coun cpate lad b
H 34adard TO Canbe
bi
TuO a g- bit t i k
Cane lko y T Cn e
3 ToeCouta I
atpetd
Tm l mods 1 0001 nu
lOH
Mods 0 0000
Oportalien
Timen
Osc&llatn A12
TMO D Tiu
Opeuo
T
To inp Csune
Pin (TMOD Coune
opaltion)
TRVO Bt inTcoN
TRO
C THO
To
Mod 3
0sc 12 M) tore
TLO
Topi Conel
TFO
D-
Gos t o
TO
)o TE Int
j Conad
TR1
nerme Ceunle
mod o, 1, 2 +man Ca
Poq sarnmad
adaptdadlu
TMOD 16 biE
060o -FEEF
TH, TLiHal 13 bit00001EFF
3SETB TRx biE oo FP
4 Chelx TFx JNB
5. CLR TRx
CLR TEX
O0o0 6 SS6
-4607
6 2 G E00H
PFFF
6sS3S) 6SS3G
TFO NEX7
NEXT TNB
eLR TRO
CLR TFO
3JMP 8ACK
pYam
#include LYe 51.h>
pet PI2
Void main U
TMOD OxOl
wil u)
TLO Ox o6
THO OxE,
TRO
pesE port
(TF 0 1)
TRO O:
TE0
wri a
ragam to
Contnousy doqau all port 2
uinq Men n modi 2, tim deloy 2mS
8-o
Ambly TmeiI Tim O
Oo lo O000
ORG 0
Mov TMOD, # 20H No. 21
pulyus 1.08 1
o 2
12u3
65536
63443
Page
(t)- (roxvau-ftral+1) i2
Tr deay Cxuptal lupa
FFEF IFFF
t r 13-bit
Far 16- 6 bit
t FFFF -oata 1) 2
Crgal unty
exialCoramucalien - 80S
os Auppa ayncuoneu)
UARI Umi verle Aynchroneus Racaven Transi
Raad-omy
Udto held tha ucaivad dta hom
xnal 3cwusvia RxD pin.
dsmata
pote
D
TD
3BUF
(ved onl
8- ddo us
Tn
Bisl9H
oheysial t Cantre
3M2 P E N T e r R R T R
3MO 8M
C at mode.
teup Ca Con
Modu andardUART
Sanping in
tdu 8 Data bi
Bu
b
owey