You are on page 1of 131

GVHD: TS HUYNH THU Luan Van Tot Nghiep

SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:3 1-2002











CHNG I:
NGUYEN LY TE BAO HOC C
THE NGI VA LY THUYET PHEP
O IEN TIM
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:4 1-2002
90mv
t
mv
I:Tong quan ve nguyen ly ien va may o:
1,S lc cau tao c the ngi va nguyen ly ien:
Nh ta a biet cau tao c the ta co khoang 100 ngan t te bao.Mot te
bao co ba phan chnh:
-Mang
-Chat nguyen sinh
-Nhan trong cung,khng ln
*Mang co nhiem vu hap thu va bai tiet,co cau tao t protit va lipit.
*Nguyen sinh chat la nhng bot,dung dch gom ng ,amkien
tao nen te bao ton tai va phat trien.
*Nhan la mot khoi ln trong cung cua te bao,dung e nh hng
phat trien va di truyen.No gom co cac ADN,c the con ngi co khoang
35,000ADN.Trong ADN co cac ma ch va chnh s sap xep cac ma ch
khac nhau tao nen ac tnh quan trong trong van e di truyen cua con ngi
chung ta.
2,S hnh thanh dong ien sinh vat:
Te bao trang thai tnh :cac Ion + nam ben ngoai mang te bao ,cac
Ion -nam ben trong.
A ++++++ B
+ +
Na K ,
mv u u
AC AB
90 . 0 = =


Ta thay co mot ien the
gia ben ngoai va ben trong cua mang te bao.




trang thai ong:
Khi ta tac ong vao no mot lc F th thay mot lng Ion+ i vao va
Ion- i ra,ghi nhan co mot hieu ien the >0.Tiep tuc tac ong F theo thi
gian ta thay hieu ien the ln hn.
Chu k au tien: - + + +


----.C

+ +
Cl
Na K ,

t
Na+ Cl-
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:5 1-2002
mv
t
mv
t
mv
t
mv
t
Chu ky th hai tiep tuc i vao va
tiep tuc i ra:

- - + +




Chu ky th ba:

- - - +




Chu ky th t:

- - - -





ay la chu trnh kh cc
Thc te ien the nay gan nh lien tuc.
Qua trnh tai kh cc:
Chu trnh th nhat:
+ - - -




Chu trnh th hai:

Na+ Cl-
Na+ Cl-
Na+ Cl-
K+ Cl-
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:6 1-2002
mv
t
mv
t
mv
t
t
kh cc
tai kh cc
-90 mv
+ + - -





Chu trnh th ba:

+ + + -





Chu trnh th t:


+ + + +






C nh vay qua trnh xay ra lien tuc trong c the con ngi cho en
khi tim ngng ap.
Nh vay trong trng hp nay nhp ap cua tim chnh la lc F tac
ong tao ra mot dang song tuan hoan gan nh lien tuc theo thi gian:







K+ Cl-
K+ Cl-
K+ Cl-
20 mv
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:7 1-2002
Na+ K+
Khoang thi gian tac ong phai phu hp.neu tac ong qua nhanh
hoac qua cham du cho bien o co ln th van khong xay ra qua trnh kh
cc va tai kh cc c.V c the ngi co tnh quan tnh.
Mot dong ien tng ng co the mo phong nh sau:

300
1k
ben trong
-90mv
20mv
ben ngoai


-S hap thu qua mang te bao ch tham thau Na+ ma khong cho tham
thau K+.Qua trnh ket thuc khi tat ca Na+ i vao trong het ,Cl- i ra het
.Ngc lai tai kh cc,trong mang tham thau ra ngoai la K+. cuoi tai
kh cc cac K+ i ra ngoai het.
e can bang nong oNa+,K+ trong te bao th co mot may bm Na+
va K+ e chuan b cho chu k sau:
Na+ i vao th phai bm ra,K+ i ra th phai bm vao.


Ngoai




Trong
3,o dan ien cua c the:
Gia s cap mot nguon DC:Ben trong te bao co nhng Ion+ vaIon-.Ta
ap vao no mot nguon ien ben ngoai.Ion- dch chuyen ve trng am va
ngc lai Ion+ dch chuyen ve trng am.


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:8 1-2002
ngng
t
++ - + --
+ - ++ te bao
+--++

_ +
_ + te bao
_ +


E






I tong dng lai gia tr ngng nao la tuy thuoc vao ien tr cua
tng ngi.
oi vi cap nguon AC: ++ - + --
+ - ++ te bao
+--++


_ +
_ + te bao
_ +


N
Neu toc o bien thien cham,th Ion dch chuyen theo 2 chieu,neu toc
o qua nhanh th Ion ng yen tai cho.
Trng ben trong Et= o tN
3
4

: o He so dch chuyen cua Ion.Neu 0 = o th tat ca cac Ion ng yen v
toc o qua nhanh,Et=0 nang lng nguon ngoai bien thanh nhiet.
I
tong
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:9 1-2002
T(s)
mv
II,Ly thuyet ve may o:
1,C s o va lay tn hieu:
a,Ly thuyet ien tim:
Nh vay theo cach trnh bay ve cau tao c the ngi cung nh
cac ong vat song khac.Khi nhp tim ap,no tac dung mot lc F lam cho c
the co mot song ien va do nhp tim co chu ky nen dang song ien ra cung
co chu ky tuan hoan:





R


P T

Q
S
0.15s 0.25S 0.4S
A B C

0.4S 0.4S


0.8S
Mot chu k cua nhp tim.



Giai oan A la oan kh cc va tai kh cc cua tam nh.
Giai oan B la oan kh cc va tai kh cc cua tam that.
*0.4S giai oan au con goi la tam thu( co vao).
*0.4S giai oan sau con sau goi la tam trng(dan ra).
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:10 1-2002
Nh vay mot chu ky cua nhp tim mat trung bnh la 0.8S.Noi
nhp tim la bao nhieu nhp laso nhp tren mot phut va la mot chuan
ma ngi ta thng goi.



A
B







Tai iem A la iem m cua van to chim khi ma ap xuat cua tam that
ln hn ap suat cua van o.Hnh uon cong t A en B mo ta ap xuat tren
van to chim.
Khi ap suat tam that nho hn ap suat cua van to chim th iem B la
thi iem ong van to chim e mau khong b doi ngc lai ma tiep tuc i
ti.
b,Phan loai cac ao trnh:
ien tam o dung e kiem tra trang thai cua c the da vao dang
song.

Cac chuyen ao cua c the ngi chia lam ba chuyen ao.
+Chuyen ao song cc :Gom 3 ao trnh.
Dung hai cc e o:
Chan phai noi mass iem o gia tay phai,tay trai va chan trai.
+Chuyen ao n cc:Gom ba ao trnh.
Dung mot ien cc tham do mot ien cc chung.
Noi chung tay trai va chan trai ra cc am.Cc dng tham do noi
vao tay phai.
+Chuyen ao n cc tim:Gom 6 ao trnh.
Mot va hai vung tam nh.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:11 1-2002
Ba va bon vung van.
Nam va sau tam that.
Cc do noi vao 1 hoac 3 ,3 hoac 6.
Ngoai ra phan nay se c trnh bay ky trong chng hai.
2,Tong quan ve ien tim:
Nh vay da vao cac ao trnh ngi ta tuy theo cach o va cac suy
luan co the chuan oan mot so benh ly ngi ve tim mach kha chnh xac.
Cac qua trnh nay cung xuat hien rat s m t khi cac may o ho tr
chnh xac dang song c ve ra ro rang .Ngay nay th van e nhan dang
tn hieu va chuan oan a tr thanh cong cu ac lc phuc vu cho y khoa
trong viec ieu tr va theo doi benh ly va hau nh cac may o eu co
benh vien.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:12 1-2002






CHNG II:
LY THIET VE IEN TIM,NGUYEN
LY, CAC PHNG PHAP O VA
NGUYEN LY MAY O

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:13 1-2002
***S lc cac van e lien quan:
Mot trong cac ky thuat chnh e chan oan benh tim la da vao ien
tam o hay con goi la ien tim o (ECG = Electrocardiograph). May ECG
cho phep suy ra cac khuyet tat ve ien va c cua tim bang cach o cac
ECG, ma chung la cac ien the tren be mat c the. Vi may ECG, ta co
the xac nh nhp tim va cac tham so tim khac.
I:Phep o ien tam va ien the sinh hoc :
1. ien sinh ly cua tim :
Trong phep o ien tam (ECG), tn hieu ien ang quan tam la do
ban than tim tao ra. V vay ECG co gia tr chan oan, v no phan anh bien
dien sinh hoc cua tim. Mac du nhng ieu sau ay lien quan ti rieng tim,
song no phan anh cac nguyen ly ien sinh hoc c ban oi vi nhng he
thong c quan khac, v du ien c o (EMG).


Tim ngi chu yeu gom c ac biet (c tim). Cac te bao c rieng le
ng knh khoang 15m va dai 100m va bo vi nhau ta nh nhng thoi.
Chung nam song song vi nhau va ket tu thanh cac be si c von tao thanh
si xoan rong hnh thanh vach tim.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:14 1-2002
Bao quanh cac te bao tim la nhng sinh chat von tach rieng khoang
gian bao vi khoang ngoai bao. oi vi te bao tim ien hnh, nang lng
chuyen hoa c s dung e tao thanh moi trng trong giau kali nhng t
natri so vi thanh phan ngoai bao natri cao va kali thap. Do co s khong
can bang hien dien o, ton tai ien the tnh tren mang te bao, ben trong
chng 90mV am so vi ben ngoai. Khi te bao b kch thch (bang cach cho
dong ien lam tang tam thi the ngang mang), cac tnh chat cua mang thay
oi theo chu trnh, pha th nhat cua no la o tham manh oi vi natri ln
chay vao trong do cac Gradien khuech tan va ien.
oi vi cac c tam that, pha 0 la hanh trnh len do s kch hoat mang
bao. Pha 2 la khoang thi gian keo dai the hi thay oi (oan bang). Pha 3
la s khoi phuc nhanh va pha 4 la ieu kien ngh on nh. Ngc lai, pha 4
ca nut xoang nh cho thay s tang tien cua the cho ti khi, iem gay, the
tac dung xay ra sau o. Trong trng hp nay khong co pha 1 hoac pha 2.
Dong chay vao nay ung tao ra dong ien va trong khi chuyen tiep
te bao ve c ban co tnh chat nh nguon lng cc ien. Dong natri chuyen
tiep nay chu trach nhiem ve (va mot phan cua) dong mach ien noi tai von
lien ket cac te bao lan can va co tac dung nh tac nhan kch thch khi phat
hoat ong cua chung. Theo cach nay, hoat ong (mot khi a c khi
phat) m rong mat tiep ti cac te bao lan can. Khi mang phuc hoi (tr ve
cac tnh chat ngh), the tac ong cua te bao ket thuc va no lai trang thai
ngh va co kha nang c tai kch thch.
Hnh 26-6 cho thay the tac ong tam that ien hnh. Hanh trnh len
tng ng vi kch hoat (kh phan cc) va trong khoang thi gian nay te
bao nguon la emf (S) the hien nh lng cc. oan bang (pha 2
hnh 26-6) te bao ngh (nh nguon ien). Do s phuc hoi (pha 3) tiep tuc vi
toc o tng oi thap, te bao tao ra S tng oi yeu trong khoang thi
gian keo dai.
Ngoai nhng te bao loai c a mo ta, cac te bao nut xoang nh (te
bao p) ton tai vung nut SA cua tim (xem hnh 26-5 va 26-6). Trong khi
the ngh co the c duy tr vo han cac te bao bnh thng th oi vi cac
te bao nut xoang nh the qua mang phat t tang cho ti khi at ti ngng
kch thch, lam tang the tac ong, nh mo ta tren. Nh vay cac te bao nut
xoang nh la nhng te bao t kch thch. Cac dao ong cua chung chuyen
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:15 1-2002
ti cac te bao lan can bang cac dong mach noi tai va theo cach o s kch
thch tuan hoan c thiet lap moi phan cua tim.
Loai te bao bo sung von tao thanh mo dan (ni toc o dan bang hai
ti mi lan cua c bnh thng) c goi la te bao Purkinje. Nhng te bao
o trong nhng bo (ong) ac biet ma mot so ngi tin rang ton tai gia
nut SA va AV (ong lien nut), thong qua nut AV (bo chung, bo His), va t
phan tam that cua nut AV ti cac thanh trong cua tam that. Nhng bo o
tao thanh he thong His-Purkinje (mang Purkinje).
Nh a lu y, nut SA gay ra hien tng tuan hoan, tan so la nhp tim.
trang thai benh khi nut SA khong hoat ong, cac nut xoang nh, nut AV
co the kiem soat, khi o nhp tim se thap hn, v thong thng e kch nut
AV nut SA t nhien phai co tan so cao hn. C tim bnh thng, trong mot
so ieu kien, co the kh phan cc mot cach t phat va tr thanh nut xoang
nh ( lech v tr), dan ti s co tam that sm (PVC).
S kch hoat tat ca cac te bao trong tim, do nut SA khi phat, tao
thanh c s cho ECG. Nh a lu y , cac te bao a b kch hoat (kh phan
cc) tac ong nh nguon dong lng cc. Cac dong ien noi tai cuoi cung
khong ch ong gop vao s m rong hoat ong ma con dan ti s co mat
cua cac dong ien moi ni trong toan than (von bien dien nh moi trng
ien tr thu ong).
Trong khi phuc hoi moi te bao lai co tnh chat nh nguon S, mac
du o ln nho hn nhieu va thi khoang dai hn nhieu so vi khi kch hoat.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:16 1-2002

Hnh 26-7:ien tam o vo hng tieu chuan
2. ien tam o :
Neu khuech ai ien the o c gia tay phai va tay trai, th tn
hieu ECG se phai co dang nh hnh 26-7. Moi trong so ba phc hp song
P, QRS va T, tng ng vi mot bien co ien sinh ly rieng. S bat au chu
trnh ien xay ra nh cac te bao nut xoang nh SA. Khi ong t phat
cua chung c truyen i bi s dan qua mo tam nh. Nh vay bien co
chnh au tien la s kh phan cc cua cac tam nh phai va trai, va hoat
ong ien tap the o lam nay sinh song P.
Hoat ong b ngan m rong trc tiep t cac tam nh ti cac tam that
nh s co mat cua vanh mo si khong dan ien ngan cach hai mien o, tr
lan can nut AV. nut AV ton tai ng dan, tuy nhien, toc o rat thap la
ac trng cua vung nay. Nh vay si khi phat hoat ong cac tam that b
tre mot thi gian can thiet e hoat ong truyen au tien t nut SA sang nut
AV va sau o qua bo chung cua nut AV. Thi khoang lam nay sinh khoang
ky hieu P-R, von la ch so o o tre phc hp.
Mot khi he thong dan tam that (Purkinje) a c kch hoat th xuat
hien s lan truyen nhanh va khi phat hoat ong chung cua tam that. ieu
nay lam xuat hien phc hp QRS cua ien tam o. Dang song cua QRS
phan anh s phan cc phc hp cua cac tam that va thi khoang cua no
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:17 1-2002
anh gia tong thi gian can thiet. Nh ta thay hnh 26-7, song Q au tien
lech xuong trc khi lech len. Co the thieu mot hoac nhieu phan.
S phuc hoi cung la qua trnh sinh ra trng the, noi chung co o ln
thap hn. S phuc hoi cua tam that tao ra song T. oan S T thng
ng goc khi xac nh cac oan TP ke tiep, tuy nhie n trong trng hp ton
thng te bao oan o co the nang len hoac ha xuong. S phuc hoi cua mo
tam nh cung dan en song ien tam o (TP); tuy nhien no co o ln thap
va thng b che bi QRS ma no phu len.
Cac tn hieu nh ECG noi chung di 5mV.
3. He thong ao trnh ien tam o :

Hnh 26-3: V tr cac ien cc cua cac ao trnh ECG c ban

Hnh 26-3 cho thay v tr cac ien cc tren c the oi vi cac ao
trnh ECG lam sang tieu chuan. ien ap c ghi lai gia cac cap ien cc
chon loc. V du :
V
I
= (the tay trai) (the tay phai) (lead I)
V
II
= (the chan trai) (the tay phai) (lead II)
V
III
= (the chan trai) (the tay trai) (lead III)
Cac ao trnh o (cac cach noi ien cc) c goi la ao trnh au
mut, hoac chi. Hay chu y rang do nh luat ien ap Kirchhoff.
V
I
+ V
H
= V
H
, ch co hai the oc lap.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:18 1-2002
ao trnh tong hp dung nh chuan c tao ra bang cach noi cac chi
thong qua cac ien tr 5kO ti iem chung goi la au noi ra gia Wilson
(CT). Cac ao trnh thng v (V
1
ti V
6
) la cac ien ap gia cac ien cc
d kien ngc va CT. Cac ao trnh bo sung xuat phat t do moi ao trnh
ch so vi au noi ra gia, tr ong gop cua chi tng ng vi CT c
ngat. (ieu nay lam tang tn hieu 1,5 lan).
**12 ao trnh tong cong theo quy c c s dung trong phep ien
tam ky lam sang.Tom tat cac cach noi cho bang 26-4. Hnh 26 10 cho
thay bang ghi bnh thng ien hnh t moi trong so 12 ao trnh.
Vi mc tim bieu dien nh lng cc, tat ca 12 ao trnh co the c
tong hp t tch vo hng cua lng cc tim (vect) va vect phan anh hnh
dang ao trnh (vect ao trnh). Thc ra, v tr cua vect tim (vong vect)
la oi tng cua cac he thong ao trnh trc giao hieu chnh chuyen dung
cua phep vect tam ky. Ban chat lng cc cua tim, nh may phat ien, to
ra la xap x tot. Nghien cu dong ien a ch ra rang tnh chat phi lng
cc quan trong bieu lo cac phan cua QRS. Phep o thc tien va viec s
dung trong lam sang cac so hang bac cao hn (a cc) van ang c
nghien cu.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:19 1-2002
Bang 26-4. Cac ao trnh ien tam o tieu chuan

Cac ao trnh chi hoac tieu chuan
V
1
= u(LA) - u(RA) V
II
= u(LL) - u(RA) V
III
= u(LL) - u(LA)
Trong o:u(LA) = The tay trai; u(RA) = The tay phai; u(LL) = The
chan trai
Cac ao trnh vung thng v
au noi ra gia Wilson(CT) la cho noi cua ba ien tr 5kO, moi ien tr
c noi vi mot ao trnh chi; cac ao trinh vung thng v s dung CT
nh chuan; cac ao trnh vung thng v c bo tr nh sau :
V
1
Khoang gian sn phai th t tai ra xng c
V
2
Khoang gian sng trai th t tai ra xng c
V
3
Khoang gian sn trai th nam tai ng gia xng on
V
4
Gia ng V
2
va V
4

V
5
Cung mc nh V
4
ng nhanh trc
V
6
Cung mc nh V
4
ng nhanh gia
Cac ao trnh chi bo sung
aV
L
tay trai so vi cho noi cac ien tr 5kO, mot vi RA, mot vi LL
aV
R
tay phai so vi cho noi cac ien tr 5kO, mot vi LA, mot vi LL
aV
R
Chan trai so vi cho noi cac ien tr 5kO, mot vi RA, mot vi LA



Hnh 26 10 : ien tam o 12 ao trnh t tim bnh thng
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:20 1-2002
3.1 Cac phep o ECG mat phang trc ao trnh lng cc :
(bipolar = lng cc/ song cc).
Ba phep o ien the thng c dung e xac nh vecto mat phang
trc cung vi tam giac Einthoven la :
ien the gia RA va LA
ien the gia RA va LL
ien the gia LA va LL
Ba phep o ECG nay c goi la cac phep o ao trnh lng cc
chuan hay mat phang trc chuan va thng c goi la ao trnh I (lead I
ECG ao trnh II (Lead II ECG), va ao trnh III (Lead III ECG) nh cho
hnh 26-3
3.2 Cac phep o ECG mat phang trc ao trnh n cc:
(Unipolar limp lead)
Cac phep o ECG ao trnh n cc cho phep ghi nhan n cc cac
ien the moi mot trong ba cc(tay trai, tay phai va chan trai) bang cach
tao ra mot ien cc khac hoac cc trung tam(central terminal) bang cach
ket hp tn hieu co c t hai chi khac cac phep o ao trnh n cc c
goi la :
aVR (augmented vecto right = ben phai vecto m rong
aVL (augmented vecto left = ben trai vecto m rong)
aVF (augmented vecto foot = ban chan vecto m rong).
Cac cau hnh ien cc ao trnh n cc n thuan la hnh chieu cua
cung vector tim len ba truc 60
0
khac xoay i 30
0
(theo chieu ngc chieu
kim ong ho) t cau hnh Einthoven. Ba phan song ien tim co quan he vi
3 phan song chan tay chuan :

2
2
2
III II
aVF
III I
aVL
II I
aVR
+
=

=
+
=

Phep o n cc aVR lien quan en ien the tay phai (RA) dung
tay trai (LA) va chan trai (LL) e lam thanh ien cc thng. (Xem hnh
26-3 cho aVL va aVF). Nh vay dang song ECG se dng vi aVL, dng
vi aVF, nhng am vi aVR.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:21 1-2002
3.3. Cac phep o ECG mat phang doc (chnh) gia :
Cac vecto hnh chieu vecto tim len mat phang cat doc c goi la
cac phep o ECG ao trnh thc quan n cc hoac cac phep o ECG
ao trnh E (E=Esoplayus=thc quan).
Ngay nay hiem khi ngi ta ghi ECG ao trnh E.
3.4. Cac phep o ECG mat phang (cat) ngang :
Ky thuat ghi ien tim thong thng cung ghi hnh chieu mat phang
ngang cua vector tim. Nhieu ky thuat o ao trnh n cc c ap dung
vao ghi ien tim mat phang ngang. Mot ien cc chung c tao bang cach
lay tong ien the tay phai, tay trai va chan phai, va phep o la ghi nhan
ien the gia ien cc chung nay va mot ien cc ngc c at nhng
ien khac nhau tren than ngi. Cac phep o ECG mat phang ngang c
goi la cac phep o ao trnh V (V lead measurement) V1,V2,V3,V4,V5
va V6. V tr cua V1 en V6 c cho trong bang 26-4 tren
Mac du cac phep o ECG mat phang ngang chuan vi cau hnh
V1V6, nhng ngi ta cung s dung mot so cau hnh mat phang ngang
khac.
4. Tn hieu ECG :
Cac tn hieu ien hnh cho ien tam ky hnh 26 10 oi vi ECG 12
ao trnh. Trong ieu kien bnh thng dang song la tuan hoan vi nhp tim
(thng khoang 70 nhp tren 1 phut). Chu trnh n la vao c 0,85s, va thi
khoang QRS la 0,09s. Ly thuyet tn hieu gi y ham lng tan cao len ti
khoang 60 Hz, chu yeu do phc hp QRS. Ham lung tan thap co the c
c lng t ban than tnh chu ky von la xap x 0,8 Hz.
oi vi cac muc ch chan oan cac khoang va cac oan thi gian,
cung nh cac bien o, c s dung. Ngoai ra dang cua cac song P, QRS
va T co the la quan trong. Nhng dang so ng o co the la bat bnh thng
neu nut xoang nh lech khoi v tr khi phat chu trnh tim, tc la PVC, do
ng kch hoat la bat bnh thng; do o s phat trien tam thi cua cac
nguon tim va cac trng the cua chung la hoan toan khac nhau. S kha
dung cua cac mach khien co the che tao dung cu re kha d co kha nang
ong thi khuech ai va nh nhieu tn hieu ien tam ky. D lieu a nh
sau o co the c hien hnh nh cac ban o be mat than the ang the. He
thong hien hanh s dung t 100 en 250 ien cc at tren khap mnh ngi
; trong mot so trng hp khoang cach ien cc la khong eu e phan anh
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:22 1-2002
cac gradien the cao hn gan tim hn. Tuy nhien nghien cu phan tch tn
hieu cho thay rang ch 25 ti 30 ien cc (ve c ban) cung cap cac d lieu
oc lap va cac be mat ien tam ky con lai co the rut ra c t nhng ien
cc o. V chung cha toan bo thong tin kha dung, nhng ban o nh vay
the hien s cai tien cac he thong thng.
Mot so cach tiep can thanh cong va phan tch chan oan bang may
tnh va cac ien tam o a c phat trien; cac thuat toan da tren s nhan
dang song va ca bien o cac khoang thi gian cua cac song thanh phan.
ac tnh tn hieu ECG:
Hnh 13 cho thay ba bang thong c s dung cho cac ng dung khac
nhau trong ECG (Tompkins va Wester,1981). Bang thong (BW) lam sang
c dung e ghi ECG 12 phan song chuan la 0.05 1001. Vi cac ng
dung giam sat, nh cho cac benh nhan can cham soc thng xuyen va cho
cac benh nhan cap cu, BW b gii han con 0.550Hz. trong cac moi trng
nay, cac roi loan nhp chu yeu c quan tam en hn la cac thay oi hnh
thai te nh trong cac dang song. Nh vay BW co gii han lam suy giam
nhieu tan so cao hn b gay ra bi cac s co c (nhieu EMG) va nhieu tan
so thap hn bi s di chuyen bi hai ien cc (cac thay oi ng nen).
Bang thong th ba c dung cho cac may o nhp tim (heart rate meter =
cardiotachometer) lam cc ai ty so S/N e phat hien phc hp QRS. Nh
vay mot bo loc cho qua cac tan so cua phc hp QRS trong khi o loai bo
nhieu bao gom cac song khong phai QRS trong tn hieu nh cac song P va
T. Bo loc nay giup phat hien cac phc hp QRS nhng lam meo ECG
nhieu en noi ma s xuat hien cua tn hieu c loc nay khong the chap
nhan c trong lam sang.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:23 1-2002
Mot ng dung khac khong ch ra ay m rong BW en 500Hz e
o cac ien the tre. ay la cac s kien nho tan so cao hn ma xay ra trong
ECG sau phc hp QRS.
(Hnh 13).
Hnh 13 cac BW c dung trong ECG. BW lam sang chuan cho
ECG lam sang 12 phan song la 0.05 100Hz. Cac may o nhp tim e xac
nh nhp tim cua ngi vi cac nhp ap bnh thng s dung mot bo loc
dai thong n gian c tap trung 17Hz va co Q khoang 3 hoac 4.
Bien o nh cua tn hieu ECG trong dai 1mV, v vay mach khuech ai
ECG tieu bieu co o li khoang 1000 e em tn hieu nh thanh dai
khoang 1V.
5. Dung cu o ECG :
Phan c ban cua may ECG ien hnh la bo khuech ai vi sai tr
khang vao cao. Thng dung opamp co ngo vao FET.au vao bo khuech
ai co the ghep vi ieu khien bu ien ap vi DC e san bang hieu cua cac
ien ap ng chuan DC cua moi ien cc.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:24 1-2002
Mot trong so cac van e con dai dang nhat trong cac phep o ECG la
giam va loai bo nhieu AC. Neu coi c the nh mat cau dan ien ban knh
0,5m, th ien dung cua no ti vo han c cho bi
C=4*c
0
(0,5) = 55pF
ien dung ti cac nguon ng day ien lc xung quanh thay oi
theo cac mc o gan nhng c lay xap x 100pF. tan so ng day
ien lc 60Hz, ieu o tao ra tr khang 26MO. neu chan phai c noi vi
at chung cua bo khuech ai thong qua ien cc vi ien tr tiep xuc 2KO
chang han, the ng day ien lc 120V se giam theo ty le 2000/(26x10
6
)
ti gia tr khoang 100mV nh au vao tieng on. o la tn hieu c ban, vt
qua ban than ECG. Tuy nhien, s dung cac bo khuech ai vi sai tn hieu
nay se c loai bo phan ln, v thng th moi ao trnh ve c ban phat
trien cung tn hieu AC.
Van e chnh th hai trong ghi ECG la o troi ng tam, von co the
nay sinh t cang thang sinh ly hoac cac ien cc c noi kem. Benh nhan
phai nam xuong khi ghi ECG va phai am bao khong co tieng on hoac
trang thai au n tinh than khac. Nhng ieu kien nh va y cung la lam
giam nhieu do tieng on c. Mac du co s than trong o, can co mang RC
e chan dong trc tiep d. Hang so thi gian 3s tng ng vi iem na
cong suat tan so thap 1/20 Hz, von to ra u thap e gi dang song bnh
thng. Giai phap khac oi vi van e nay la s dung bo ghim ng tam.
Van e quan trong th ba la an toan ien trong kiem tra lien tuc
benh vien.
ap tuyen tan so cao khong thch hp co the dan en meo dang
song. ac biet cac bien o va thi khoang cua cac song thch ang
co theb sai.
ap tuyen tan so cao gia 60 va 500 Hz c chap nhan chung nh
khoang can thiet. Cac khao sat ve cac ECG ac trng a chng minh rang
cac sai so bien o Q , R va S nho hn 0,1mV oi hoi tan so cat tren
100Hz. Cac sai so nh thi b anh hng t hn va to ra thoa ang cac
tan so cat 60 en 80 Hz. Khao sat anh hng cua cac tan so cat tren va
di ti cac tham so ECG a c Thomas thc hien. Cac ket qua c
tom tat bang 26 5 va 26 6 .
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:25 1-2002
Bang 26 5: Anh hng cua tan so cat di ti cac tham so ECG

Tan so cat (Hz) Tng quan Song R, mV S,Q - mV
0.001 0.992 1.94 0.012
0.01 0.992 1.94 0.014
0.1 0.989 1.91 0.018
1 0.958 1.82 0.222
5 0.72 1.4 0.756
Tan so cat tren c ieu chnh 200 Hz tng quan vi ECG khong
loc. Bien o song khong loc la 2 mV va S Q goc la 0mV.

Bang 26 6 : Anh hng cua tan so cat tren oi vi tham so ECG

Tan so
cat, Hz
Tng
quan
Song R,
mV
Song Q,
mV
QRS, ms P Q,
ms
Q T, ms
500 1.0 2.0 0.4 70 94 204
200 0.991 1.92 0.37 70 94 204
100 0.971 1.87 0.36 70 92 206
80 0.955 1.83 0.34 70 92 206
60 0.923 1.81 0.33 72 90 208
40 0.832 1.71 0.29 76 88 210
20 0.52 1.34 0.18 94 82 216
Tan so cat di la 0,05 Hz. (0 Hz oi vi tan so tren 500 Hz von a
cho cac gia tr chuan). Tng quan la vi dang song khong loc (0 ti 500
Hz).
6. Cac ien cc (Electrode) :
Ngay xa ngi ta s dung cac ien cc kim loai e noi ve ien vao
c the ngi. Mot chat ien phan (thng la c tao bi dung dch muoi
an trong mot chat ong (keo) tao thanh giao tiep ien gia ien cc kim
loai va da. Trong c the ngi, cac dong ien c tao ra bi s di chuyen
cua cac ion trai lai trong day dan, cac dong ien do s di chuyen cac ien
t. Cac he thong ien cc lam viec chuyen oi cac dong ien ion thanh cac
dong ien ien t.
Cac kim loai dan ien nh ong phu Nickel c dung lam cac ien
cc ECG nhng chung co van e. Hai ien cc can e thu thap mot ECG
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:26 1-2002
cung vi chat ien phan va than c phu muoi an hoat ong nh
pin(battery). Mot ien the lech (offset) DC xay ra gia cac ien cc va co
the ln hoac ln hn tn hieu ECG nh. Mot lp kep ien tch (cac ion
dng va am cach nhau mot khoang) xay ra trong ien cc. S di chuyen
ien cc nh tao bi s di chuyen cua benh nhan lam anh hng lp kep
nay va thay oi lech (offset) DC. V ien the offset nay c khuech ai
len khoang 1000 lan cung vi ECG, cac thay oi nho lam dch i nhieu
ng nen (baseline) tn hieu ra. Mot ien cc ma hoat ong theo cach
nay c goi la ien cc co phan cc (polarizable electrode) va ch hu
dung cho cac benh nhan nam ngh hay khong di chuyen.
Ngay nay vat lieu c dung nhieu nhat cho cac ien cc la bac-
clorua bac (Ag-AgCl) v no xap x nh ien cc khong co phan cc. Hnh
14 cho thay mot ien cc nh vay. Kieu ien cc nay co ien the offset rat
nho. No co mot lp AgCl c at tren ban cc Ag. Cac ion clorua i vao
c the, vao chat ien phan, va vao lp AgCl, o chung chuyen thanh
dong ien t trong ban cc Ag va trong day (dan) noi. Phng thc nay lam
giam i ien the offset DC thanh mot gia tr rat nho so vi tn hieu ECG
nh. Nh vay s di chuyen ien cc tao ra mot s dch chuyen ng nen
trong ECG c khuech ai th nho hn nhieu so vi ien cc co phan cc.
ma ch tng ng
Cax=5nF
ba n bi n
0.3V
dung d ch muo i
i e n c c
mo te ba o
Rax
1-100k

(Hnh 14).
Hnh 14 : ien cc ECG Ag AgCl. Nhieu ien cc hien ai co cac
lp ien phan ma c tao bi chat ong cng co tnh dnh chat ong cng
toi thieu hoa anh hng cua lp kep ien tch.
V tr cua cac ien cc tren c the cho phep ghi nhan chnh xac cac
ECG theo cac truc X,Y va Z th rat quan trong. e co c VCG chnh xac,
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:27 1-2002
cac ien cc phai c at cac v tr ma cho phep ghi nhan chnh xac ba
vecto nay.
Tuy nhien c the va tim co cac ac tnh ma khong the tranh c vi
muc ch thc te. ieu nay lam cho viec ghi nhan tuyet oi chnh xac VCG
hau nh la khong the c vi bat c he thong nao co ien cc at khong
hoan hao.
VCG co the c ghi nhan bang cach co c ien the gia hai iem
di cac canh tay cho X hoac thanh phan trai sang phai, gia ngc va
lng cho thanh phan Z va gia au va chan trai cho thanh phan Y. n
thuan hien th bat ky hai trong ba tn hieu nay tren Scope X-Y vi cung o
nhay cho ca cac khuyec ai X va Y se cho cac sai so ang ke khi ien the
c tao ra trong tim b suy giam bi cac lng khac nhau trong cac hng
X,Y va Z va than ngi khong phai thuan nhat, cac tn hieu na y c tao
theo cac truc ma khong chnh xac vuong goc vi nhau.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:28 1-2002










CHNG III:
NGUYEN LY MAY O
CAM BIEN THU TN HIEU VA
TRUYEN I XA
THU, GIAI IEU CHE PHUC HOI
TN HIEU VA HIEN TH KET QUA
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:29 1-2002
I:S o khoi may phat:
1, Khoi nguon cung cap:




100/16V
C1
103
C5
103
470/50V
-5V
RA O I 12V
470/50V
-5V
T1
BIE N A P
1 5
6
4 8
-
100/16V
LM7805
1 3
2
IN OUT
G
N
D
-
-
+
1
2
3
4
VA O 200V/ 50Hz
LM7905
2 3
1
IN OUT
G
N
D
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:30 1-2002
2,Khoi phan kenh:


U7
SW
VCC
in4
U1
4510
4
12
13
3
5
10
15
1
9
6
11
14
2
7
A1
A2
A3
A4
CI
U/D
CLK
PE
RST
Q1
Q2
Q3
Q4
CO
1.5K
in3
U6
U6
A B C D E F G P
'
.
R3
10K
R2
1.5K
in2
U3
14051
13
14
15
12
1
5
2
4
6
11
10
9
3
X0
X1
X2
X3
X4
X5
X6
X7
INH
A
B
C
X
D2
LED
VCC
in1
C1
103
VCC
R1
1.5K
R7
1.5K
Q1
3
2
1
out
U2
4511
7
1
2
6
3
4
5
13
12
11
10
9
15
14
A
B
C
D
LT
BI
LE
A
B
C
D
E
F
G
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:31 1-2002
3,Khoi cam bien,phan cc cho au vao:

IN
OUT
C2
102
R2 22k
5V
R4
150k
C1
102
C3
102
R3
2.2k
R1
50k
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:32 1-2002
4,Khoi khuech ai,loc thong day va loc nhieu 50Hz:







5v
C4
6.8nF
IN
R2
2.7K
+
-
U7A
TL082
3
2
1
VR
100K
C5
3.3nF
C2
10/50v
OUT
+
-
TL082
3
2
1
8
4
-5v
R8
680
R5
1k
R9
470K
R6
100k
R7
1k
R1
2.7K
R3
1M
-
+
TL082
3
2
1
C1
0.1U/50V
R4
1M
C6
3.3nF
C3
104
-
+
TL082
3
2
1

















GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:33 1-2002
5,Khoi sa dang xung:




+
-
TL082
5
6
7
8
4
RV1
50K
OUT
IN
C1
101 D1
R13
680
5v
-5v
R10
1k
R12
470
R11
4.7K

















GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:34 1-2002
6,Khoi ieu che am tan:





C12
103
C10
68n
D6
LED
IN
C11
102
R20
100k
OUT
+5V
VR
20K
1
3
2
R22
39k
R21
1.5k
U17
LM555
5
2
6
4
3
7
8
C
O
N
TRIG
THRES
R
S
T
OUT
DIS V
C
C














GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:35 1-2002
7,Khoi ieu che phat song va khuech ai cong suat cao tan:





C10
22P
ANTENNA
R8
1K
DAO O NG COLLIP 90MHz
C12
L1
Q3
HA 564
1K
R17
L3
C6
C
C8
33
IN
C13
47
IN
R5
2.7K
Q1
C945
Q2
C945
C7
33P
C8
102
T1
R15
1K 5-30P
R7
470
R16
39K
+5V
L4
L2
C9
33
10uH
R18
100
C9
.01
R6 10K
C9
5P











GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:36 1-2002
II:S o khoi may thu:
1,S o mach cua bo thu FM va giai ieu che:



L4
C4
0.01
R3
470
D1
C3
33
C14
15
R8
220k
C6
0.001
C7
15
TA 10.7M
C9
15
R14
10k
C12
100
R7
220k
BA4236
R10
10k
C17
1/50V
11
71
0
1
2
891
3
17
R5
100k
R11
100
R12 1.8k
D5
LED
R1
2.2k
C1
15
C5
0.01
8V
R6
39k
R9
2.2k
C2
33
1
2
3
5
67
9
4
8
C8
0.001
L1
3.5uF
C21
100
D2
C19
4.7/50V
C20
0.022
T1 1 5
4 8
C16
103
L3
8V
R4
27k
BA4404
C10
5
D3
C15
0.01
8V
ANT1
ANTENNA
C13
15
analog out
VCC_BAR
C11
0.01
C18 0.22
A-100k
R2
100k
L2

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:37 1-2002
Tn hieu ra analog nay co the co nhieu ca ch e x l ,v du nh ta co
the khuech ai e nghe bang loa,co the sa dang e in ra bang
giay(d nhien cach nay th phai co qui c chuan cho trc),co the
nhn en bao va ac biet la dung vi x ly e hien th ket qua hoac
ket noi giao tiep may tnh...
trong pham vi cua em th dung ba phng phap la nghe bang loa,
en bao va hien th bang vi x l .
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:38 1-2002
2,S o mach hien th bang vi x ly:
a,Khoi vi x ly:
R7
C4
10/16V
R2
4.7k
U1
AT89C51
9
18
19
29
30
31
1
2
3
4
5
6
7
8
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
39
38
37
36
35
34
33
32
RST
XTAL2
XTAL1
PSEN
ALE/PROG
EA/VPP
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INT0
P3.3/INT1
P3.4/T0
P3.5/T1
P3.6/WR
P3.7/RD
P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7
R4
R3
10k
giao tiep led 7 oan
1
2
3
4
5
6
7
8
9
10
11
12
Q4
A1015
C5
100u/50V
R6
Q6
A1015
C
R8
0
0
J2
Nguon cung cap
1
3
2
C1
103
12Mhz
0
Q5
A1015
0
10k
470
C2
30p











GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:39 1-2002
b,Khoi hien th:
R4
R
R2
R
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
R7
R6
4.7k
R3
R
5V
Q4
2N3135
Q5
2N3135
R1
10k
H
I
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
470
R5
R
T port 2 ti
P1.7 P1.6 Q3
2N3135
P1.5


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:40 1-2002











CHNG IV:
TNH TOAN THONG SO MACH
CHO THIET B O
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:41 1-2002
I: Tnh toan cho khoi phat:
A:Tnh toan cho cac phan mach:
1,Khoi nguon cung cap:
















Van e chon nguon cho thong so mach cua may o la kha n gian
v thiet b may o la nhng phan t khong tieu ton cong suat nhieu,hn na
cach tao nguon cung cap nay cung khong can that chnh xac cho lam.
Chon bien ap cach ly au vao 220v au ra nguon oi 12v,dong nh
mc 450mA,iot nan nguon la1N4018 dong tai 1A,ap ngc 300v.Sau o
dung phng phap nan toan ky cho ra nguon oi +15v va 15v dung tu
470 F /50v loc nguon .Sau o dung 7805 va 7905 e on ap ra =5v va
5v,tu loc au ra 100 F q /16v cap cho mach.Ngoai ra con s dung nguon 12V
cho mach phan kenh.Phan nguon nay s dung trc tiep t nguon +15V,V
cac IC CMOS co the chu ap en 18V.
Tu chong nhieu sau cung dung tu 103.
Ngoai ra can mac them tu 102 chu ap 500V au song cong tac nhan
e dap xung khi ta ong m nguon.
Phan nguon cho khoi thu cung lam tng t nhng co them LM
7808 e cap ap cho mach thu FM.

100/16V
C1
103
C5
103
470/50V
-5V
RA O I 12V
470/50V
-5V
T1
BIE N A P
1 5
6
4 8
-
100/16V
LM7805
1 3
2
IN OUT
G
N
D
-
-
+
1
2
3
4
VA O 200V/ 50Hz
LM7905
2 3
1
IN OUT
G
N
D
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:42 1-2002
2,Khoi chon kenh tn hieu vao:

U7
SW
VCC
in4
U1
4510
4
12
13
3
5
10
15
1
9
6
11
14
2
7
A1
A2
A3
A4
CI
U/D
CLK
PE
RST
Q1
Q2
Q3
Q4
CO
1.5K
in3
U6
U6
A B C D E F G P
'
.
R3
10K
R2
1.5K
in2
U3
14051
13
14
15
12
1
5
2
4
6
11
10
9
3
X0
X1
X2
X3
X4
X5
X6
X7
INH
A
B
C
X
D2
LED
VCC
in1
C1
103
VCC
R1
1.5K
R7
1.5K
Q1
3
2
1
out
U2
4511
7
1
2
6
3
4
5
13
12
11
10
9
15
14
A
B
C
D
LT
BI
LE
A
B
C
D
E
F
G



Muc ch la cho ket noi c nhieu ngo vao cung luc va ch can
nhan nut chuyen oi ta co the xem c nhieu ni trong c the ngi,quan
sat c nhieu dang song chang han va nh vay rat tien li cho ngi s
dung thiet b.
Dung SW lam xung CK cho IC 4510.Ta tao dao c mach chuyen
kenh bang cach lay dang xung ra Q1 va Q2 cap cho hai ng A,B cua IC
4051. ay 4510 che o em co load gia tr ban au bang ng PE,da
vao ngo ra Co.Chon load gia tr ban au qua trnh em la ABCD =1010(bat
au em t so 5).
Ta co:Q3Q2Q1Q0=0101,0110,0111,1000,load 0101 va tiep tuc,lay
dang xung ra la Q1Q0 ta c 01,10,10,00.Nh vay thoa man yeu cau cua
ta.IC 4510 tac ong xung CK mc cao,ta chon cach tao xung bang SW.
Nh vay ta co:
Chon R3=1.5k
C1=22nF

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:43 1-2002
RC=1.5* s q 33 10 * 10 * 22 * 10
12 3 3
=

,o doc nay va ap ng c cho IC,tu


co vai tro chong rung cho mach.Nguon cung cap cho mach la 12V,cac tr
han dong cho led va tr cho mc mot la 1.5k.Ta co dong qua led :
ma I 87 , 6
1500
7 . 1 12
=

= .Khi nhan cong tac va nha ra ien ap


tren tu co dang
nh sau:








Ngoai ra IC 4051 co 8 kenh vao analog ma ta co the m ong them
bang cach thay oi bo em cho IC 4510. luan van nay lam ch co y tng
trng ma thoi.
T

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:44 1-2002
3:Khoi cam bien,phan cc cho au vao:

IN
OUT
C2
102
R2 22k
5V
R4
150k
C1
102
C3
102
R3
2.2k
R1
50k


Ban chat cua cach lay tn hieu nay la t c chuyen thanh ien.
Tr khang vao cua au do vao khoang 1200O ,e phan cc cho au
do ta chon VR1=50k,R2=22k,R3=2.2k,tu C1=102,tu C1 co tac dung loc
thong thap va chong nhieu,nh vay sau o au ra c mot ien ap co
nh khoang 1-2mv.
Tu C3 va R4 tao thanh mach loc thong thap lan sau cung.
Chon tan so cat f=100Hz,C3 =102.
Ta co R= O = =

k
fC
150
10 * 10 * 100 * 14 . 3 * 2
1
2
1
10
t

Nh ta a biet dang song nhp tim co dang nh sau:



2mv
-1mv

t
ma
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:45 1-2002
4:Khoi khuech ai,loc thong day va loc ien li:



5v
C4
6.8nF
IN
R2
2.7K
+
-
U7A
TL082
3
2
1
VR
100K
C5
3.3nF
C2
10/50v
OUT
+
-
TL082
3
2
1
8
4
-5v
R8
680
R5
1k
R9
470K
R6
100k
R7
1k
R1
2.7K
R3
1M
-
+
TL082
3
2
1
C1
0.1U/50V
R4
1M
C6
3.3nF
C3
104
-
+
TL082
3
2
1






Phan mach co ro rang ba khoi ,khoi au la loc thong day ke en la
khoi khuech va sau cung la loc nhieu 50Hz.
oi vi loc thong thap.Chon day thong la 0.1-100Hz.Tnh toan cho
khoi nay ta co c nh sau:
Chon he so khuech ai 10 lan F C
fC
A 1 . 0
100 * 10
10
1 10
1
10
4 4
= = = =


Vi f thap =0.1 Hz tnh tng t ta chon C2=104,R1=R2=2.7k.
Sau khi lay c dang song t au do,ay la tn hieu nho .V vay ta
phai khuyech ai tn hieu nay e co bien o can thiet phuc vu cho cac muc
ch sau. ay chon mc ien ap +-5v.Cac thong so theo tnh toan tren,vi
R6=100k
R7=1k
Suy ra R5=R6llR7=1k
He so khuech ai gan 100 lan,nh vay tn hieu au ra thu c co
bien o nh gan 130mv.S d theo ly thuyet la 200mv nhng tn hieu a
suy hao qua cac mach loc thu ong hn la khuech ai 10 lan tai loc thong
day.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:46 1-2002
Dang song qua mach khuech ai nh sau:
150mv
-100mv
200mv

Sau khi qua khoi khuech ai ta loc nhieu ien li.Nhieu ien li
co hai dang ,nhieu t bien ap cach ly qua bo nan ien va nhieu t ien
trng xoay chieu cua mang li.Neu khong loc nhieu nay tn hieu se b
chen vao mot dang ien ap hnh sin ma oi khi co bien o ln hn ca mc
tn hieu thu c t cam bien.
e thong tan cao ta chon:
VR=100k,
O = =
= = = =
M R R
nF C C Hz
RC
f
1 4 3
3 , 3 6 5 , 50
2
1
t

Chon R9=470k,C4=6.8nF e thong tan thap.
Bien tr dung chnh o li cua mach sau khi khuech ai la n sau
cung.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:47 1-2002
5,Khoi sa dang xung:
D1
RV1
50K
+
-
TL082
5
6
7
8
4
OUT
R12
470
5v
-5v
IN
R10
1k
R11
4.7K
R13
680
C1
101

ay la mach trigger,muc ch sa dang xung,au ra la mot day xung
vuong lien tuc theo nhp tim. ay V-=Vcc* mv
R
R
74
68
5
9
10
= =
Nh vay khi ien ap vao V+ ln hn 74mv th ngo ra bao hoa
dng,ngc lai ngo ra bao hoa am ,khi o R12 va diot xa nh am,chon
R12=470 , R13=680.
au vao C1 va R11 tao thanh mach loc thong thap co
Khz
C R
f 300
10 * 7 . 4 * 10 * 100 * 14 . 3 * 2
1
1 11 2
1
3 12
= = =

t
.
Muc ch cua loc nay e chong tac nhan nhieu khi co s co xung tac
ong.Nh khi m nguon chang han.
Ta c dang song nh sau:













150mv
-100mv
200mv

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:48 1-2002
6,Khoi ieu che am tan:


C12
103
C10
68n
D6
LED
IN
C11
102
R20
100k
OUT
+5V
VR
20K
1
3
2
R22
39k
R21
1.5k
U17
LM555
5
2
6
4
3
7
8
C
O
N
TRIG
THRES
R
S
T
OUT
DIS V
C
C

Dang song tren c a vao mach ieu che am tan,muc ch la
long xung tan so 3000Hz vao xung vuong cua mach sa dang.Thc chat
ay la mach dao ong co reset. ay tnh toan ta chon f=3000Hz.
Nh vay ta chon :
Vcc=5v,R22=39k,bien tr tuyen tnh 100k, tu C10=68nf,tai au ra
dung R21 va LED D6 e bieu th trang thai co dao ong hay khong? Ngoai
ra R20 va C11 dung lien lac va cat nhieu tan thap hn nhieu.
Dang song ra sau cung cua mach ieu che am tan:












4.5v
400
dao
ong

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:49 1-2002

7,Khoi ieu che phat song va khuech cong suat ai cao tan:

C10
22P
ANTENNA
R8
1K
DAO O NG COLLIP 90MHz
C12
L1
Q3
HA 564
1K
R17
L3
C6
C
C8
33
IN
C13
47
IN
R5
2.7K
Q1
C945
Q2
C945
C7
33P
C8
102
T1
R15
1K 5-30P
R7
470
R16
39K
+5V
L4
L2
C9
33
10uH
R18
100
C9
.01
R6 10K
C9
5P



Tiep tuc a vao mach ieu che e phat song i xa .Thc chat ay la
mach dao ong Colpitt.
S o tren gom co hai phan.Transitor Q1 tao dao ong chuan .Q2 va
Q3 khuech ai cong suat cao tan.
Nh vay theo cach ieu che nay la ieu che AM trong FM .ieu nay
c ly giai nh sau:
Khi dao ong noi a on nh roi,neu khong co tn hieu am tan vao
,no van dao ong on nh vi tan so nh cu .Mot khi co dao ong am tan
a vao.No lam cho phan cc DC cua Q1 b thay oi va nh the chnh s
thay oi nay lam cho o li mach hoi tiep b giam va nh vay dan en tan
so dao ong noi thay oi theo.Nh vay ta a co mot ieu che FM.S d
dung phng phap nay la v no n gian,hn na ta khong can chnh xac
dang song ieu che va phuc hoi sau nay.
Phan dao ong c tnh toan nh sau:
R15=47k ,R18=100O,R16=39k phan cc cho Q1,Q2(C945) .
Tu 0.01 chong nhieu nguon.
C8=102 phoi hp tr khang au vao.
C7=33 va au th cap cua cuon cam lam tr khang au vao cho Q2.
L1=10 F phoi hp vi anten lan truyen song ien t i xa.Ngoai ra
no con la chc nang cua mot cuon chan(cach ly nguon DC ve mac cao tan).
ay chon Mhz f 90
0
= (muc ch phat song ieu tan trong day bang
tan FM).
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:50 1-2002
Nh vay ta tnh ra c gia tr cua L can tao tan so tren.
Ta co H
C C
C C
L
C C
C C
L
q
e
e 208 . 0
13 9
13 * 9
1
13 9
13 * 9
1
2
0
0
=
+
=
+
=
Thc ra trong mach nay cuon cam L la mot so vong day quan tren loi
ferit va loi c chnh nhuyen bang tuavit e thay oi tr so cuon cam .Khi
chon ung tan so ta o keo lai co nh (cach chon la lay may radio chon
tan,d nhien la co sai so tan so ay).
Mach dao ong nay n gian ,de lam nhng o di tan cao(
f
A kiem
tra gan hn 100Khz) ac biet o di tan cang ln khi ieu che qua sau(bien
o tn hieu vao cang ln).ay la nhc iem cua mach.
Mach khuech ai cong suat cao tan:
Ta co the khong dung Q3 mach van phat song bnh thng nhng cong suat
ra yeu.Mot van e thiet ke cong suat cao tan th kho khan hn nhieu so vi
khuech ai am tan.No kho khan t cach bo tr linh khien en ng mach
in.
Chon R16=39k phan cc cho transitor.Cach phan cc nay th tot hn
so vi cau phan ap trong van e cao tan,v tao ra tan so
|
f cao hn.
Tiep theo chon R5=2.7k
R6=10k
R8=1k
R7=470
Phan cc cho Q3.ien ap tai cc B Q3 la 0.9 V.
C8=33p lam tu Bypass ve mac xoay chieu.
L2,L3 lam cuon chang.
e phoi hp tr khang ra ta chon C9=5p
L4=5uH
C10=22p
Cuoi cung sau khi ra anten ta con co tu thay oi t 5p en 30p.Sau
khi c cong suat ra toi a ta chot lai va thay bang tu thng.
Chon anten phat song la anten loai dipoleHert co tr khang gan ung
73 om.
Theo cach lam nay ch co tnh chat pho thong.Neu can o chnh xac
va chat lng cao th thng nhng cong ty a cho ra i cac IC chuyen
dung e ieu che va khuech ai cong suat cho FM.No thng s dung cho
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:51 1-2002
bo am,mot so thiet b c ly gan va at biet la cac mon tro chi tre em cua
Trung Quoc.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:52 1-2002
B:Mot so van e lien quan en khoi phat:
a,On nh bien o dao ong:
Cac phan tch tuyen tnh de dang xac nh tan so dao ong nhng
khong e cap ti van e bien do.Co hai phng phap dung e kiem soat
bien o dao ong:dao ong t gii han va mach ieu chnh bien o.
1,Dao ong t gii han:do o li vong{ 1 . > B A
v
}(thng bang 2,3). Khi
bien o tang, ban dan at en bao hoa,o li vong giam i va keo theo
trang thai bien o dao ong c on nh
2,Dung mach ieu chnh bien o dao ong:Da vao hoi tiep am cua
mach.Phng phap gii han dong cho Q2

Q2
2N2222
3
2
1
R9
2.2k
C13
15
Q1
2N2222
3
2
1
Ngo ra dao o ng V0
C13
15
L4


b, On nh tan so dao ong:
o bat on tan so dao ong tng oi :
0 0 0
0
e
e
c
A
=
A
=

=
f
f
f
f f

Co hai loai bat on tan so
1, Theo thi gian dai(thay oi tan so t t do bat on ve nhiet o ,o
am ,nguon cung cap..)
2,Theo thi gian ngan, mot giay hay vai chu ky tn hieu do nhieu
nhiet,nhieu shoto bat on theo thi gian ngan giam ang ke khi khi he
so pham chat cua mach tang len
Theo tren dao ong cong hng co
LC
1
0
= = .Di cac yeu to gay sai
dang L,C mot lng C L A A , .Tan so dao ong thay oi:
) )( (
1
C C L L + A A +
= e .Khi o o bat on tan so tng oi
) (
2
1
0 0
C
C
L
L
f
f A
+
A
=
A
=
A
=
e
e
c .
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:53 1-2002
Nh vay e co he so e nho ta chon C,L co he so nhiet nho va bien
thien ngc nhau( ) ;
.
:
.
0 0
t C
C
t L
L
C L
A
A
=
A
A
= o o
0
t A :o bien thien nhiet o.
-Cong suat ra bo dao ong nho,khong keo tai qua ln.
-On nh nhiet bo dao ong
-Nguon cung cap on nh,can tach biet rieng cho phan dao ong.
-Dung mach cong hng co Q ln(chat lng cam va tu co tr noi
nho),dung tang em cach ly phan dao ong vi cac phan trc va sau.
Ngoai ra neu Q ln con co tac dung loc hai bac cao tot hn.
-S dung hoi tiep hp l (dung hoi tiep am, ien tr Re).
-Ban dan co tan so cat cao(
0
2 f f
B
> ) nhieu thap.
-Mach co phan cc hp l.
Tr lai van e cua mach.
Tai thi gian co xung vuong(ay la xung vuong nho trong tan so
3000Hz cua phan ieu che am tan) tan so tang len .Tai ay tan so la
f
f f A + =
0 1
,vi
f
Mhz f A = , 90
0
o di tan cc ai 100Khz.
Tai thi gian khong co xung vuong th song phat i la dang sin chuan
vi Mhz f 90
0
= khong co di tan ln.
Dang song phat i:












D nhien o th nay ch co tnh chat tng trng ma thoi.

90Mhz+ di
tan
90Mhz+ditan khong ang
ke


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:54 1-2002
C:Van e nhieu trong mot mach thc te:
1,Nhieu do ien trng tac ong len ien cc:
Nhieu ,ay la van e quan trong nhat cua ien t thong tin ,neu
khong khac phuc c no,khong nen nhieu, triet nhieu c th moi van e
cua ien t thong tin xem nh cham het thay HOANG NH CHIEN.
Chnh v vay nen thc te mach em thiet ke se co nhieu rat nhieu nguon:
Ry
ECG
220V
Rx
Y X
4
m
Im Iy
Rm
Ix
R
Zin

Cho thong so:
Ix=Iy=6nA
Rx=30k
Ry=10k
Im=1uA
Rm=30k
Rc=500
Zin=5M
uV
Z
R R R I
U
IN
Y X M M
DT
120
10 . 5
10 . 20 . 30 10 ) (
6
6 6
= =

=


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:55 1-2002
2,Nhieu do t trng tac ong len c the:
Ry
ECG
Rx
Y X
S
Rm
R
Zin


2
2 . 0 . 20 . 50 . 14 . 3 . 2 2 m uT fBS U
TT
= = t
Trong o chon dien tch S=0.2m vuong.
o ln t thong=20uT
Utt khoang 1 en 2mV
3,Nhieu ban dan:
Mot nguon nhieu ngau nhien quan trong can xet trong thiet ke mach
la nhieu cua cac phan t tch cc ban dan gay nen:diot ,BJT,FET,ICNo
gom co nhieu tan so thap va nhieu tan so cao:
*Nhieu tan thap:phat sinh bi khuyet tat be mat tinh the ban dan gay
nen.Va thng xay ra di tan so 1khz,,ham mat o pho cong suat nhieu t
le nghch vi tan so cua tn hieu ,t le thuan vi nhiet o va dong DC.
*Nhieu tan cao:Xuat hien vung tan so cao ,gan vung tan so Cutoff
cua thiet b.Khi thi gian di chuyen cua ien tch co the so sanh c vi
chu ky cua tn hieu se co mot so ien tch khuech tan ngc tr lai nguon
hoac Emitter.
Ngoai ra con nhieu shot noise gay ra bi ban chat dch chuyen dong
ien trong ban dan.Cac hat mang ien trong chat ban dan khong di chuyen
thanh mot dong lien tuc on nh,ngay ca dong DC bi v khoang cach ma
chung di chuyen phu thuoc mot cach ngau nhien vao ng chuye n ong.
Nhieu shot hoan toan ngau nhien va co mat o pho trai bang phang
trong day tan so.
Nhieu ban dan la do cac thong so ve tnh chat ban dan gay ra nhieu
lam cho mot mach khuech ai se mat tuyen tnh Nh vay khi s dung
ban dan la se b nhng nguon nhieu nay .
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:56 1-2002
Mot so han che khac phuc do nhieu ban dan gay ra:
-S dung ban dan chong nhieu cao(hay la t gay nhieu).Ngay nay vi
s phat trien ngay cang cao cua nen khoa hoc ky thuat ngi ta a che tao
c cac ban dan gay nhieu thap hn,ong thi tieu ton t nang lng hn ,
no ap ng c nhu cau cua nha s dung.
-Phai s dung ung theo thong so nha san suat cho trc.Rang moi
loai co mot vung on nh t gay nhieu .Neu s sai ch dan hay dung khong
ung muc muc ch cung se tao nhieu hn .V du nh ta phan cc mot
transitor lot ra vung tuyen tnh cua chang han.
4,Nhieu nhiet :
Nhieu nhiet gay ra bi s dch chuyen ngau nhien cua cac ien t va
ion trong cac vat dan,ien tr .No c ngien cu va phat hien bi John
son nam 1928 nen con goi la nhieu Johnson.Nhieu nhiet phat sinh dang
ien ap hay dong ien phu thuoc vao nhiet o va co pho trai dai trong day
tan so.
Cong suat cua nhieu nhiet t le vi bang thong,do do de giam cong
suat cua nhieu nhiet may thu can thiet ke sao co co bang thong nho nhat
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:57 1-2002
D: Van e anten thu phat:
1,Tr khang vao cua an ten:(Antenna Input Impedance):













Ta xem anten phat nh la mot mach ien phoi hp au ra.
Tr khang cua anten c xem gan ung nh sau:
A A A
jX R Z + =
Cong suat hap thu cua anten:
Va
Rs
V
Vs
Xa
Ra
Xs


} {
*
* Re
2
1
A A A
I V P =

Nh vay cong suat thu c ln nhat khi co phoi hp tr khang.
ieu nay xay ra khi:
S A
S A
S A
X X
R R
Z Z
=
=
=
*

Cong suat kha dung cua nguon la:
May phat
Vs
Anten phat
Cong suat hap thu
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:58 1-2002
S
S
Z Z
A S
R
V
P P
S A
2
8
1
*
= =
=

Khi mat phoi hp th se co mot song phan xa ve nguon gay giam
cong suat phat goi he so mat phoi hp la q:
2
4
B A
S A
S A
Z Z
R R
q
qP P
+
=
=

Goi t la he so phan xa .Ta co s lien thong gia q va t .

2
1 t = q
S A
S A
Z Z
Z Z
+

= t
2,Hieu suat cua antenna:
Khi nhan c mot cong suat Pa gi ti.Th anten ch bc xa c
mot phan Pr nho hn Pa.Do phai tieu hao tren gia ,che chan ien moi.
Tieu hao tren vat dan ien,cac vat dan nh ong ,nhom th khong ly
tng.
Nh vay muon tang hieu suat:
Phai lam gia n gian.
Dung vat dan that tot.
ieu nau lam tang gia thanh cho thiet b.

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:59 1-2002
E: Tong quan phan mach phat:
Nh vay trong phan tren la toan bo khoi phat phat song FM vi tan
so la 90Mhz va toan bo phan nay a can chnh ,mach chay tot .Ban ve van
e cong suat phat th mach nay co cong suat rat nho,khoang cach anten thu
ac khong qua 7m, neu hng tnh tot anten thu co the len khoang cach toi
a la 10m.
Chon anten phat la anten thang thay oi o day c va tr khang
ac tnh gan ung la 73O .Ta co gan ung cong suat phat la:
P
t
= mW
R
V
cc
4 . 15
146
5 . 1
2
1
2
2
= =
Thc te khi dung mot Radio thong thng khoang cach thu c la
10m.Khi co tn hieu ta nghe tieng te te con khi khong co th khong nghe
g.Nhng khi m Volume ln th van nghe co tieng khe cua nhieu
50Hz.Mac du a co gang triet nhieu nhng van khong triet e chap nhan
ieu nay v t so tn hieu tren nhieu van con rat ln.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:60 1-2002
II:Tnh toan cho phan thu:
A: S lc cac IC chuyen dung dung trong mach thu:
1, IC BA 4404 :
ay la mot khoi tch hp cac phan thu cua he thong nh:khuech ai
cao tan,loc va giai ieu che ra tn hieu IF, da vao mot ien ap thien lech
t ngoai cap cho phan cc varicap no co the thay oi bo khung cong hng
e loc c cac tan so khac nhau.Tan so thu c co the bien thien t
87Mhz en 108Mhz.Ngoai ra no con co phan on nh tan so bang mot ien
ap DC hoi tiep ve.Nguon cung cap la 8V.Xem them phan Block diagram.
2, IC BA4236:
ay la IC chuyen dung khuech ai trung tan co o chon loc cao nh
co cac bo loc trung tan IF.Thu c tn hieu mong muon va loai nhieu
ngoai bang thong,co AGC(Automatic Gain control)tranh qua tai cho phan
giai ieu che.Giam meo trong he thong giai ieu che FM.Mc tn hieu sau
khi oi tan nho hn 1mv trong khi yeu cau tn hieu ra phai at 1Vp-p. o
li khuech ai ien ap at khoang 60-100Db .Chnh v vay Trong IC co ba
tang khuech ai bang BJT,FET,MOSFET e at gia tr nay.au ra la tn
hieu am tan ma ni phat song gi i,bien o nho hn 1V.
Nh co AGC nen mach luon at c o li on nh ,hn na tn
hieu am tan ra con co he thong hoi tiep ve .Ngha la IC co chc nang nhan
hoi tiep,chnh ieu nay nen no c s dung rong rai (khong nhng trong
may radio cua Tosiba ma con mot so hieu khac cung dung no).
en bao trang thai co thu ai phat hay khong cung da vao tn hieu
AGC nay e so sanh va chay sang khi co thu mot ai ro rang.
Trong o no s dung day ien ap rat rong t 3 en 10V.Khi ien ap
10V cong suat tieu thu toi a la 25mW va cong suat ra am tan la 5mW.
3,Noi ve AGC trong IF:
ay la mach t ong ieu chnh tang hoac giam o li khuech ai
khi tn hieu thu c manh hay yeu (ai xa hoac ai gan)bang cach t thay
oi ien ap phan cc.Nh vay AGC la he thong hoi tiep ieu chnh o li
may thu da vao bien o tn hieu thu ong thi m rong day ong(Dynamic
Range-DR).Day ong la ngo vao tn hieu nho nhat va ln nhat ma tn hieu
ra khong b meo.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:61 1-2002
Trong may thu FM,ien ap AGC co the tach trc tiep t mach giai
ieu che FM. Ca hai bo tach song phan biet va tach song t le ieu co the
de dang lay ra ien ap AGC.Gia s nh mach sau :

in IF hoac Audio Amp
D1
R1
R
D2
+
-
U6
3
4
1
5
2
R3
R
C1
+
-
U5
3
4
1
5
2
C2
DC out
R2
R

Trong mach Diot D1 va D2 cung C1 va C2 tao thanh mach nhan oi
ien ap .ong thi C2 va R2 co thi hang ln e tach lay thanh phan DC.
Opam co the mac ao hoac khong e tao cc tnh ien ap can thiet phu
hp cho mach.
4,Noi ve AFC trong IF:
Mot kieu mach hoi tiep tng t nhAGC dung may thu cao tan
goi la AFC (t ong ieu chnh tan so) ,lam cho tan so dao ong noi cua
may thu cao tan c on nh,khong b troi(s troi tan so do nhieu nguyen
nhan nh nhiet o thay oi, thong so ky sinh cua mach v.v.) .Ngay nay cac
may thu hien ai khong can thiet cho lam van e AFC v bo tong hp tan
so co o on nh cao trong day tan cong tac.V du mot s o khoi sau cho
mot AFC:
o ng chnh
C5
C
L4
C3
C
Amp
R4
R
RF Amp
R6
R
AT
MIX
R5
R
D2
V-
IF Amp
C4
C
LO
FM Dem

Bien o ap ngo ra bo tach song thay oi theo o di tan.Neu tang tan
so ien ap ra dng neu giam tan so ien ap ra am.Mach loc thong thap R5
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:62 1-2002
va C3 lay tn hieu DC bien oi cham hn a ve phan cc cho Varicap e
ieu chnh dao ong noi.Khi tan so dao ong b troi bo giai ieu che se
phat hien lam cho tang hoac giam ien ap DC.T o phan cc cho Varicap
ngc lai no lam giam dao ong noi ) (
0 s IF
F F f = va mot qua trnh ngc
lai.
5,Phan tch tn hieu FM:
Tn hieu song mang cao tan khi cha b ieu che la n hai va c
xac nh nh sau:
) ( cos ) cos(
) ( cos ) cos(
0
0
t V V v
t I i i
c
c
u u =
u u =
= + =
= + =

Trong o:
0
) ( u = u + =
c
t
c
= : tan so song mang :
0
u pha ban au
: ) (t u pha tc thi tai thi iem t.No xac nh trang thai dao ong
cua tn hieu tai thi iem t.
e n gian cho phan tch ta xem tn hieu FM co dang nh sau:
t Vm t m
m
= cos ) ( = va pha ban au cua song mang 0
0
= u .Nh vay co the bieu
dien lai ] sin cos{
0
t m v v
m
= = + =
Trong o he so m bieu th o sau cua qua trnh ieu che gia bien o
cua tn hieu ieu che
m
v vi cac thong so song mang cao tan bien oi t le
va xac nh phan bo cong suat.
0
= tan so song mang trung tam
m
= tan so tn
hieu am tan.
Dong cao tan FM:
) sin cos(
) sin cos(
t t V v
t m t V v
m
m
c FM
m f c FM
=
=
=
=
= =
A
+ =
+ =

pha ay u cua tn hieu FM: t t t
m
m
c
=
=
=
= u sin ( ) (
A
+ = )
tan so tc thi FM: t
dt
t d
t
m c
= = =
u
= cos
) (
) ( A + = =
: = A c goi la o di tan va t le vi
m
v
6,Bien tan va pho trong FM:
Pho FM rat khac biet vi pho cua tn hieu FM.Khi ch so ieu che
nho (m<2.5)ta co pho FM day hep gom song mang va hai bien tng t nh
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:63 1-2002
AM.Nhng khi he so m ln th pho cua no trai ra.Bien o song mang (hay
tan so trung tam)giam va bien o cua cac hai tang.
Xet FM dai hep(NBFM(narrowband FM):m<2.5)

Ta xem gan ung ) ( sin , 1 cos rad u u u = A = A
) sin ) sin ( {cos t t m t V v
c m f c NBFM
= = = =

song mang trung tan bien tan
Pho bien th cach nay gan ung NBFM co song mang va hai bien
tng t AM.
Xet FM day rong(WBFM(widebandFM) m>2.5) gom thanh phan tan
so song mang va cac day bien
m c
n= = + vi n=1,2,3..
Bien o cua chung t le vi ham bessel loai 1 bac n

=
+ + + + =
1
) ( ) ( 0
1 ]} ) cos( ) 1 ( ... ) [cos( cos {
n
m c
n
m c mf n c mf FM
t n t n J t J V v = = = = =

Bieu th pha cua hai nao o
Khi khong co ieu che th bien o cua song mang chu yeu la hai
chnh tai trung tam(hay noi cach khac nang lng tap trung tai pho nay)
Khi co dieu che hai trung tan nho lai va ong thi xuat hien cac hai
day bien tang len tuy theo mc ieu che.
Pha cua cac thanh phan pho =0 hoac t .Cho v d mot vai trng hp
ieu che vi cac he so
f
m khac nhau:













GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:64 1-2002
Khac vi AM( cong suat AM thay oi theo tn hieu ieu che cong
suat FM luon rat t thay oi(sai so khong ang ke) va ay cung la iem li
cho ta tnh toan thiet ke mach.Khi o di tan tang bien o tn hieu ieu che
yeu cau tang v vay yeu cau bang thong tang.
7,Van e bang thong va cong suat trong FM:
Tong cong suat cao tan tn hieu ieu che FM khong oi va luon la
mot hang so,no bang cong suat song mang khi khong co ieu che .Ve ly
thuyet o rong bang thong cho tn hieu FM th vo cung ln nhng ieu nay
khong the,co thc te la se rang buoc, nh vay ch xet no trong 1 khoang
nao o.Thc te ngi ta lay bang thong trong o tap trung uc 99% cong
suat cua FM
Goi V la bien o cua song mang FM khong ieu che tren tai R,ta co
cong suat song mang
Ptotal
R
V
P
mf C
= =
=
2
2
) 0 (

Cong suat FM khi co ieu che:
] 2 .... 2 [
2
) (
2
) ( 1
2
) ( 0 ) 0 ( ) ( mf n mf mf mf C mf FM
J J J P P + + + =
=

99% nang lng cao tan tap trung trong bang thong FM.Bang thong nay
tnh theo cong thc: ) 1 ( 2 mf mf F B
m FM
+ + ~
m
F : tan so ieu che tn hieu tan thap bang goc.
m
F
f
m he so ieu che FM.
Bang thong 3Db cua mach cao tan phai ln hn bang thong
tnh theo cong thc tren e khong meo.
FM day hep (NBFM) dung trong thong tin thoai FM co o di
tan khoang (5-15Khz).
FM day rong co tnh chat chong nhieu cao hn dung trong
phat thanh quang ba ,FM setreo tieng cho TV ,truyen hnh ve tinhTheo
FCC o di tan toi a cho phep la 200Khz.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:65 1-2002
Mot vai v du:o di tan cc ai am thanh TV la 75Khz,bang thong
am thanh TV(30-15KHz)
1,
khz B
Khz F Khz
FM
m f
150 ) 1 . 0 75 ( 2
1 , 0 ; 75
= + =
= = A

2,
Khz B
Khz F Khz
FM
m f
152 ) 1 75 ( 2
1 ; 75
= + =
= A

3,
Khz b
Khz F Khz
FM
m f
170 ) 10 75 ( 2
10 ; 75
= + =
= = A

Ta thay khi tn hieu ieu che thay oi t (0.1-10Khz),bang thong ch
thay oi nho t 150 170Khz.ieu nay ly giai tai sau FM oi khi c qui
ve he thong co bang thong khong oi.
Trong FM dung bo sa dang nang mc bien o pha ta n so cao tn
hieu ieu che
m
= nen o di tan cc ai co the xuat hien tan so cao
) 2 (
max max max
F t = = = .Tnh chong nhieu FM co tnh triet nhieu bien o v tin
tc c long trong s bien thien tan so.Nhieu bien o b xen bo khuech
ai han bien trc khi giai ieu che FM trong may thu.Mac khac nhieu
khong mong muon co tan so can ke trong day tan cua tn hieu du co b xen
nhng no van lot qua c(triet het nhieu nay th co le cung triet het tn
hieu)t o lot vao bang thong may thu gay ieu che pha k sinh.o di tan
pha ky sinh
max 0
.F
f
Au = A trong o Aula o lech pha k sinh(radian).Khao
sat t so ien ap tn hieu tren nhieu tao ra mot o xoay pha k sinh.
rad hay 52 . 0 30 ) 2 ( sin
0 1
= = Au


o di tan k sinh Khz Khz f 5 . 7 15 . 52 . 0 = = A .Tieu chuan phat thanh FM
co o di tan cc ai Khz
f
75 = A .
Vi Fmax =15Khz co o di tan cc ai sai lech do nhieu ieu che
pha k sinh so vi khong nhieu la7.5/75=0.1.Tc la t so ien ap tn hieu
tren nhieu ngo vao la 2 th au ra tang len 10 .Vay FM co kha nang vo
hieu hoa anh hung cua nhieu ,trong khi AM t so nay la nh nhau. ay
la iem hn han cua cach chon dung FM.
Thong tin FM co tnh chong nhieu cao,de thc hien va c dung
rong rai,chat lng am thanh tot hn nhieu so vi AM.
Ket luan chung :ieu che sau chat lng tot nhng nhc iem bang
thong keo theo ln de gay nhieu, ngc lai ieu che can bang thong nho
nhng gay meo tn hieu.Tuy theo chat lng va bang thong cho phep ma ta
la chon phu hp.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:66 1-2002
B:Tnh toan cho bo thu va giai ieu che :
1,Tnh toan cho bo giai ieu che FM:
L4
C4
0.01
R3
470
D1
C3
33
C14
15
R8
220k
C6
0.001
C7
15
TA 10.7M
C9
15
R14
10k
C12
100
R7
220k
BA4236
R10
10k
C17
1/50V
11
71
0
1
2
891
3
17
R5
100k
R11
100
R12 1.8k
D5
LED
R1
2.2k
C1
15
C5
0.01
8V
R6
39k
R9
2.2k
C2
33
1
2
3
5
67
9
4
8
C8
0.001
L1
3.5uF
C21
100
D2
C19
4.7/50V
C20
0.022
T1 1 5
4 8
C16
103
L3
8V
R4
27k
BA4404
C10
5
D3
C15
0.01
8V
ANT1
ANTENNA
C13
15
analog out
VCC_BAR
C11
0.01
C18 0.22
A-100k
R2
100k
L2






GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:67 1-2002
Tnh toan gia tr cho mach:
Nhn lai s o mach co nhng phan rat ro rang nh phoi hp tr
khang au vao,loc chon tan,tn hieu IF...
S o bo thu nay c trnh bay phan trc,nguyen ly mach ien
nay that s c lay trong may thu radio Tosiba.No s dung hai IC thu va
giai ieu che chuyen dung BA4404 va BA4236 ma a trnh bay.Anten thu
cung nh anten phat.Vi khoi thu nay neu tinh chnh tan so bo thu co the
thu c cac ai phat thanh trong dai tan t 88Mhz en 108Mhz. ay
chon tan so phat va thu la 90Mhz .
Tu C1 la tu lien lac cao tan chon tr so 15p
Tu C3 cung la tu lien lac chon tr so 33p
L1,C2 la mach phoi hp(mach loc thu ong) au vao, chon tu C2 la
33p,suy ra tai f=90Mhz ta co
L1=3.5uF
Tng t tai bien ap T1 chon C12= 100p suy ra tai tan so IF
=10.7Mhz ta tnh c L=87uF.
Volt D2 ve mat DC khong co y ngha.Khi thong tn hieu no co tac
dung xa xung t bo giai ieu che IF.
Chan 2 cap nguon chon Vcc= 8V qua bien tr han dong la R3=470.
Cac tu chong nhieu la C4,C5,C11 chon =0.01.
Chan 2 va 3,6 va 7 la song ng nhau.au vao ap cho varicaptor chnh
s chenh lech nay tao thien ap cho Varicap ,lam khung dao ong noi thay
oi tan so bo thu.S thien ap cho chan 2 va chan 6 c chnh thong qua
bien tr tuyen tnh A-100k.Khi thien ap cc ai th bo thu co dao ong
108Mhz va khi thien ap cc tieu,dao ong bo thu la 88Mhz.
Chon R14=10k,R4=27k.
R2=R5=100k
C6=C8=0.001
C7=C9=15P
Cung vi hai diot D1 va D3 tao thanh mach oi tan.Cach oi tan nay
goi la oi tan theo phng phap can bang.
u iem cua phng phap nay la loai tan so anh cua nhieu rat tot .
Chan 9 nhan tn hieu vong hoi tiep am tan ve.Trng hp qua tai,no
giam bien o IF cho phu hp.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:68 1-2002
Ket thuc au ra la tn hieu trung tan co tan so trung tam theo chuan
FM la 10.7Mhz.
Sau khi tn hieu trung tan lay qua cuon cong hng cua T2 no qua bo
loc gom 10.7 Mhz i vao IC BA 4236 e giai ma tiep trung tan.
IC BA 4236 sau khi nhan tn hieu trung tan no tiep cong oan giai ma ra tn
hieu am tan .Cac tu C18,C19 va C20 la phan cc cho IC c chon nh
hnh ve.
Sau khi giai ieu che tn hieu am tan qua mach loc thong thap
C16=103 va R18=220k cong vi tu C15=0.01 cong R7=220K tao thanh
vong hoi tiep cho mach.Ngoai ra chan 17 con co 1 LED noi vao,no tch cc
mc khong khi bao trang thai co ai.
Cuoi cung tn hieu analog ra qua tu kien lac C17 =1uF/50V va
R9=2.2k.



GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:69 1-2002
C:S o giai thuat va phan lap trnh hien th ket qua nhp tim:
1:Sa dang tn hieu e giao tiep vi vi x l:
phan hai khi thu tn hieu FM va giai ieu che ta thu c sau cung
mot tn hieu am tan bien thien theo nhp ap tim. Tuy nhien do truyen i
xa va thu lai th van e mac phai nhieu la ieu hien nhien.Hn na nhieu
do ien trng va t trng t xung quanh ta.Vi tn hieu nh vay neu
khong co qua trnh sa oi th khong the giao tiep cho vi x l.
Tn hieu thu c co dang gan giong nh sau:
Giai phap cho mot mach sa dang tn hieu n gian.Khi co tn hieu
au vao dung mach trigger e ngan bien o,trc o co bo nan loc diot
nham lay tn hieu mot chieu.Ta da vao ac tnh khi co tn hieu th co ien
ap mot chieu va ngo ra se tch cc mc cao.Nhieu cung la tn hieu nhng
co bien o nho hn nen khong u mc cho ngo vao V+ nen ngo ra van tch
cc mc thap.Nh vay au ra la mot chuoi xung theo dang cua nhp
tim.Tnh toan cho mach.
Chon giai phap:
Chon R3 ngo vao 100,tu C3 :102R1=1k,VR=50k,R4=R5=1k.D3 la
diot thng 1N4001,diot nay co nhiem vu xa mc am cua tn hieu ngo ra
opamp.Cung cap nguon oi cho mach la+ -5V.Cung xin noi them neu tu C3
qua ln,thi gian xa va nap khong thch hp se lam cho dang xung ra
khong nh y muon ,co the qua dai chu ky nhiem vu,neu qua nho se khong
u mc DC cho mach.

5V
OUT
D1
D3 C3 102
1
2
IN
H
I
0
R3
100
2
1
R5
1k
2 1
-
+
LM741
3
6
7
4
2
VR50K
R1
1k
2
1 0
H
I
0
R4
1k
2 1
-5V


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:70 1-2002
2,Giai phap cho mot mach dao ong 60Hz dung LM555:
R8
1k
2
1
R710k
2 1
0
5V
C1
67u
LM555
3
48
5
2
6
7
OUT
R
S
T
V
C
C
C
V
TRG
THR
DSCHG
R6
4.7k
2
1
D2
LED
C2
1n
1
2
0
R9
1k
2
1
H
I
0

Tnh toan cho phan nay:
LM555 la IC chuyen dung ,no co rat nhieu ng dung trong mot so
giai phap no cho ket qua n gian va s tien li hn han.Vi chu k la 1s ta
co
s R R C R R 1 ) 6 8 ( 693 . 0 1 * ) 7 8 ( * 693 . 0 = + + + = t chon R8=1k,R7=10k,chu k
nap 60% suy ra tu C=67u,vi chu k xa 40% suy ra R6=4.7k. ay mach
thc te tu co gia tr C= 68u.
Chon C2=1n,muc ch chong nhieu cho mach ngo ra co mot led
quang kiem soat.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:71 1-2002
3,Gii thieu s lc qua trnh hien th:
Nh ta a biet nhp tim trung bnh cua ngi vao khoang 60 en 80
nhp ap tren 1 phut.Neu lam viec met co the len tren 100 va khi ngu co
the di 50.Vay vi may o nay em se cho hien th ket qua qua led 7 oan
nhp ap o.Thi gian hien th theo nhp tim (gia s nh tim ap 60 nhp
tren phut th 1 giay thay oi ket qua mot lan.Do cach thc lap trnh la trong
trnh nhan chia cho xoay vong 5 o nh nen tang o chnh xac cho ket qua
,ong thi con co phan test mach tr c khi o,neu khong co tn hieu nhp
tim(tn hieu interrup) th mi reset mach test chuan so 100.ong thi co
cong tat e chuyen o tan so IC555 (c tnh toan trc khoang 60 HZ)

4,Phan x ly tn hieu thu c:
a, Mach vi x ly:


R4
C
0
10k
470
R2
4.7k
Q6
A1015
giao tiep led 7 oan
1
2
3
4
5
6
7
8
9
10
11
12
U1
AT89C51
9
18
19
29
30
31
1
2
3
4
5
6
7
8
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
39
38
37
36
35
34
33
32
RST
XTAL2
XTAL1
PSEN
ALE/PROG
EA/VPP
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INT0
P3.3/INT1
P3.4/T0
P3.5/T1
P3.6/WR
P3.7/RD
P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7
R7
0
R6
0
J2
Nguon cung cap
1
3
2
Q5
A1015
12Mhz
C1
103
Q4
A1015
R8
0
C2
30p
R3
10k
C5
100u/50V
C4
10/16V

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:72 1-2002
b,Khoi hien th:
P1.7 P1.6
P1.5
R6
4.7k
R3
R
Q4
2N3135
5V
R2
R
Q5
2N3135
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
H
I
R7
R5
R
R1
10k
470
Q3
2N3135
76429 1
3
8
1
0
5
abcdf e
.
,
g
DB
R4
R
T port 2 ti





Nguon cung cap la +5V ,chon 3 transitor cung cap nguon cho led la
A1015 (dong max la 50 ma,he so khuech ai la 200,Vce anh thung la
200V).Trong trng hp ca 7 thanh trong led eu sang dong tieu thu ln
nhat:
Dong qua mot thanh sang la 5ma,ap ri tren mot thanh la 1.7V.
Nh vay dong tai ln nhat la 7*5=35ma.Suy ra dong
Ib=35/200=0.175ma
mc 0V transitor bao hoa, mc 5V transitor tat.Tnh toan chon tr
phan cc cho transitor la:
R1=4.7k
R2=10k
Tr han dong cho tng thanh led la R3=470.
Dung IC 74LS47 e giai ma t ma BCD sang ma 7 oan.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:73 1-2002
**Tom tat bang giai ma nh sau:

Ma BCD
A B C D
Ma 7 oan
a b c d e f g
0 0 0 0 0 0 0 0 0 0 1
0 0 0 1 1 0 0 1 1 1 1
0 0 1 0 0 0 1 0 0 1 0
0 0 1 1 0 0 0 0 1 1 0
0 1 0 0 1 0 1 0 1 0 0
0 1 0 1 0 1 1 1 1 0 0
0 1 1 0 0 1 0 0 0 0 0
0 1 1 1 0 0 0 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 1 0 0


* Nh vay thanh led nao co mc tch cc 0 va c cap nguon th
no sang.ieu nay thay t phan cng kha e dang.











GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:74 1-2002
c, S o giai thuat:










=0

1
=





=0


=1








RESET BO NH
Khai bao cac interrup
Bt nhan_chia=0&bit_hien_thi=0
oc gia tr t o nh
qui nh
Kiem tra
bitnhanchia
Goi chng trnh con
nhan chia va lu vao o
nh mi
Kiem tra
bithienthi
Lay noi dung o nh
Goi trnh hien th
Chng trnh cam
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:75 1-2002




























INTERRUP 0
dng timer 0,load gia tr vao
thanh ghi,set bit_nhan_chia
set cho timer 0 chay,set lai thanh
ghi
Thoat
INTERRUP
TIMER0
dng timer 0 tang thanh ghi bien
em ,reload gia tr cho timer
0,tiep tuc cho timer 0 chay
Thoat
INTERRUP
TIMER 1
Dng timer 1,kiem tra gia tr nhan
goi chng trnh tnh toan,lu lai
gia tr danh cho hien th ,nap lai
gia tr cho timer1 ,cho chay tiep.
Thoat
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:76 1-2002
d,Cach em nhp tim:
Nh a trnh bay ,sau khi tn hieu thu c qua mach loc thong
thap,sau o em vao khuech ai,tiep theo sa dang ra xung vuong.
Bay gi ta ly tng xung vuong thu c co dang nh sau:










Tai A bat au em,tai B dng em,thu so lieu va x ly,sau o bat
au em lai t au.Tai C th tng t nh B,c the qua trnh nay lap vong
lien tuc.
Sau khi em ta se qui oi:
Do em so lan tran nen chnh la em chu ky tn hieu,ngc lai ta
phai hien th so nhp tren phut la tan so .Nen ta phai qui oi qua mot phep
tnh.
V du xung chuan 1Hz (chu k la 1s)neu nap reload la 50000 nen
moi giay se tran 20 lan va hien th 60 nhp tren phut.Bay gi xung la 2Hz
1s tran 10 lan,ma ta phai hien th la 120 nhp tren phut.Nh vay so lan tran
t th phai hien th so ln.Ngha la co phep nghch ao e qui oi.ieu nay
th khong kho khan lam.
Tong quan lai s o giai thuat:Dung interrup 0 e em xung ck ben
ngoai,thc s khi co xung tac ong vao interrup 0 ,no lai khi ong cho cac
phan ben trong lam viec.e tang o chnh ,xac dung timer 0 em ben trong
theo nhp thach anh,khi timer 0 tran,no tang gia tr thanh ghi va nh vay ket
qua la so lan tran timer 0 trong mot lan intrrup 0.
Ngoai ra e tang o chnh xac va e giai quyet cho trng hp tn
hieu interrup khong lien tuc nh xung dao ong chuan cua phan test(IC
555).Giai phap a ra la co mot trnh lap vong lien tuc nam thanh ghi (phan
nay nam trong chng trnh con nhan chia tnh toan gia tr).
A B C
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:77 1-2002











Lay trung bnh cong cua nam so hang:
Ta co
5
5 4 3 2 1 A A A A A
A
+ + + +
=


Va sau o trnh nhan chia c lay so lieu i tnh toan va c ket qua
cat vao o nh sau o trnh hien th Led th c lay so nay em hien th qua
Port.
e,Cac trnh interrup,giai thuat va chng trnh con:
*Cac trnh interrup:
+Interrup 0 :ay la mot trong hai interrup cua 8951, tac ong xung
canh xuong, dung nhan xung tac ong t ben ngoai vao ,cu the la tn hieu
thu c t bo giai ieu che sau khi qua khuech ai va sa dang ra xung
vuong.No rat de s dung ch can khai bao vai dong lenh ,ac biet la rat de
giao tiep vi cac thiet b khac nh xung t LM555 ,mach trigger
+Interrup timer0: dung timer0 lam interrup,interrup nay tac ong khi
timer b tran,t interrup0 ieu khien interrup timer0,nh vay timer0 em
xung clock va khi nhan interrup0 no oc gia tr so lan tran t timer0 vao o
nh qui nh.
+Interrup timer1:cung tng t nh timer0,no em xung chuan ck cua
may,chu ky ung 1s va sau mot giay goi no gan o nh mi va goi trnh
nhan chia.Giai phap thay the va lap vong nam thanh ghi nh a trnh bay
tren.
+Trnh nhan chia:ay la chng trnh con tnh toan so lieu c goi
bang timer0.No gom cong ,tr nhan,chia 16 bit dung x l so lieu nhan c
va qui oi ra so nhp tren mot phut t ket qua nhan c.
A1 A2
A3
A4
A5
Bien vao
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:78 1-2002
+Trnh hien th LED:Nhn vao mach th cach nay la giai ma mem va
a trc tiep ra port(do mach cua ta khong co s dung port nhieu nen lam
phng phap nay ton phan cng hn.S dung phng phap tra bang va
xuat,khi c goi no lay so lieu t o nh qui nh sau o tra bang va xuat
ra port.Tong cong co 3 LED do nhp tim con ngi khong qua cao(250 ,350
nhp tren phut).
Ngoai ra con so so chng trnh nho nh: nhan chia 16 bit,cong tr 16
bt va mot so nhan mot so lap vong na ma ta khong trnh bay ay.
Mac du phan mem viet kha chnh xac nhng oi khi van co mot so
ket qua hien th sai.L do sai nay khong phai do phan mem ma la do tac
ong cua nhieu,chu yeu la nhieu do moi trng thu phat.e khac phuc th
em a co gang chnh sa phan cng ,ket qua co kha quan hn nhng van
khong het triet e,oi khi van co mot ket qua sai xuat hien.T ay mi nay
sinh van e triet nhieu bang phan mem giai thuat.
f,Giai phap chong nhieu bang phan mem:
Nh ta a biet nhp tim con ngi khong the thay oi trong mot vai
giay vi toc o bien thien qua ln(rut ra t thc te).Chnh v vay mot giai
thuat khac phat sinh la lam the nao e tang o chnh xac cho phep o ma
chong nhieu cao hn.Ngoai y o la dung nam thanh ghi e lap vong tang
o chnh xac th mot giai phap khac la,so sanh va noi suy.
Ngha la bay gi so lieu thu vao,trc khi lu vao o nh.No qua qua
trnh kiem tra xem co nam trong khoang nhp tim t 30 en 250 khong, neu
co th nhan,neu khong th loai(d nhien la a qui oi).Va sau khi nhan th
co trnh duyet khac,no kiem tra so mi vao co nam di toc o bien thien
cua nhp tim khong ,neu co th nhan va neu khong th loai.Khi mot ket qua
khac b loai th no lay ket qua cu bu ap cho lan mi nay.Cac trng hp b
loai th xem nh la co mot nhieu nao o tac ong.
Sau khi viet phan mem nh a trnh bay y o th mach chay rat tot
khong a ra ket qua sai na.Chnh v vay ma chng trnh (file.asm) hi
dai.


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:79 1-2002
g,Chng trnh nap cho AT 89C51(file.asm):
POUT_0 EQU 30H
POUT_1 EQU 31H
POUT_2 EQU 32H
POUT_3 EQU 33H
DP EQU 34H
TIMEHIGH EQU 35H
A0 EQU 43H
A1 EQU 37H
A2 EQU 38H
A3 EQU 39H
A4 EQU 40H
A5 EQU 41H
A6 EQU 42H
A7 EQU 43H
DELAY EQU 36H
ORG 0000H
LJMP MAIN
ORG 0003H
LJMP ISR_EX0
ORG 000BH
LJMP ISR_TIMER0
ORG 001BH
LJMP ISR_TIMER1
MAIN:
MOV TMOD,#11H ;TIME0 VA TIME1 O CHE DO MODE1
MOV TH0,#HIGH(-50000)
MOV TL0,#LOW(-50000)
SETB TR0
MOV TH1,#HIGH(-50000)
MOV TL1,#LOW(-50000)
SETB TR1
SETB EA ;CHO PHEP NGAT INTERRUP 0
SETB EX0
SETB IT0
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:80 1-2002
SETB ET0
SETB ET1
MOV R4,#20
MOV TIMEHIGH,#18
MOV R5,#0
MAIN_LOOP:
MOV R6,A5
MOV R7,A6
ACALL DISPLAY_LED;GOI CHUONG TRINH HIEN THI
; in p0,p1,p2,p3
; out p2.(p1.4,P1.7)
JMP MAIN_LOOP ;TRO VE CHUONG TRINH CHINH
;CAC CHUONG TRINH INTERRUP
ISR_EX0:
CLR TR0
MOV TIMEHIGH,R5
MOV R5,#0
MOV TH0,#HIGH(-50000)
MOV TL0,#LOW(-50000)
SETB TR0
RETI ;KET THUC CHO PHEP NGAT
ISR_TIMER0: ;CHUONG TRINH CHO PHEP NGAT TIME 0
CLR TR0
MOV TH0,#HIGH(-50000)
MOV TL0,#LOW(-50000)
INC R5
SETB TR0
RETI ;KET THUC NGAT TIME 0
ISR_TIMER1:
CLR TR1
DJNZ R4,KIP
MOV A,TIMEHIGH
CJNE A,#14,LAN1
JMP THUCHIEN
LAN1:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:81 1-2002
JNC LAN2
JMP HOLD
LAN2:
CJNE A,#27,KIP3
JMP THUCHIEN
KIP3:
JC THUCHIEN
JMP HOLD
THUCHIEN:
MOV R0,TIMEHIGH
MOV A7,TIMEHIGH
ACALL CHUONG_TRINH_NHAN_CHIA
MOV A5,R6
MOV A6,R7
CPL P1.0
MOV R4,#20
MOV TH1,#HIGH(-50000)
MOV TL1,#LOW(-50000)
SETB TR1
JMP EXIT
HOLD:
MOV R0,A7
ACALL CHUONG_TRINH_NHAN_CHIA
MOV A5,R6
MOV A6,R7
MOV R4,#20
MOV TH1,#HIGH(-50000)
MOV TL1,#LOW(-50000)
SETB TR1
JMP EXIT
KIP:
MOV TH1,#HIGH(-50000)
MOV TL1,#LOW(-50000)
SETB TR1
EXIT:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:82 1-2002
RETI
;CAC CHUONG TRINH CON
CHUONG_TRINH_NHAN_CHIA:;CHUONG TRINH TINH TOAN GIA
TRI NHAN DUOC
MOV B,#5
MOV A,#0
MOV A4,39H
MOV A3,38H
MOV A2,37H
MOV A1,43H
MOV A0,00H
ADD A,A2
ADD A,A3
ADD A,A4
ADD A,A1
ADD A,A0
DIV AB
MOV B,A
MOV R6,#70
MOV R7,#04
ACALL DIV_16_8
MOV A,R6
ACALL BINTOBCD
RET ;KET THUC TINH TOAN
DISPLAY_LED:
ACALL DICHUYEN
PUSH 00H
PUSH 01H
PUSH B
PUSH ACC
MOV R1,#4
MOV R0,#POUT_0
MOV B,#0F7H
LOOP_4TIMES:
MOV A,@R0
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:83 1-2002
MOV DPTR,#BCDTOSEG
MOVC A,@A+DPTR
INC R0
DJNZ DP,DP_DIS
CLR ACC.7
DP_DIS:
MOV P2,A
MOV A,B
RL A
MOV B,A
ORL P1,#0F0H
ANL P1,A
MOV DELAY,#30
DJNZ DELAY,$
DJNZ R1,LOOP_4TIMES
POP ACC
POP B
POP 01H
POP 00H
RET
BCDTOSEG:
DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,0BFH
BINTOBCD:
MOV B,#10
DIV AB
MOV R6,B
MOV B,#10
DIV AB
MOV R7,A
MOV A,B
SWAP A
ORL A,R6
MOV R6,A
RET
DICHUYEN:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:84 1-2002
MOV A,R7
ANL A,#0F0H
SWAP A
MOV POUT_3,A
MOV A,R7
ANL A,#0FH
MOV POUT_2,A
MOV A,R6
ANL A,#0F0H
SWAP A
MOV POUT_1,A
MOV A,R6
ANL A,#0FH
MOV POUT_0,A
RET
DIV_16_8:
PUSH 02H
PUSH ACC
MOV R2,#16
CLR A
DIVIDE:
XCH A,R6
CLR C
RLC A
XCH A,R6
XCH A,R7
RLC A
XCH A,R7
RLC A
CJNE A,B,NOT_EQUAL
SJMP A_GREATER_EQ_B
NOT_EQUAL:
JC BELOW
A_GREATER_EQ_B:
SUBB A,B
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:85 1-2002
XCH A,R6
ORL A,#1
XCH A,R6
BELOW:
DJNZ R2,DIVIDE
XCH A,B
POP ACC
POP 02H
RET
END
;HOAN THANH 7:18 PM 12/18/2001








GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:86 1-2002













CHNG V:
ANH GIA KET QUA THI CONG
VA CAC DANG SONG
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:87 1-2002
I:Ket qua thi cong khoi cam bien va phat tn hieu:
1,S lc thi cong:
Phan cng cua mach th n gian khong co g phc tap,kho khan.
Thc te khi thi congmach th mac phai mot so van e nho,nhng a tm
cach khac phuc va cuoi cung cung hoan thanh mach nh d nh,ung thi
gian yeu cau.Van e la e co mot mach hoan thien hn th can phai sa
mach lai oi chut va hoan thien cam bien v no la quan trong hang au
trong may.Du cho cac khoi khac co tot en au ma ta khong lay c tn
hieu t cam bien th no khong con ung muc ch e tai yeu ca u.
2,Ket qua thi cong khoi nguon:
Do thong so mach khong s dung cac nguon phc tap va can o
chnh xac cao nen ay ch lam mot loai nguon bnh thng e cung
cap.Cu the nh sau:
Chon nguon cho khoi thu va phat la nh nhau:
Bien ap loai 12V oi cach ly dong nh mc 450mA.
Sau khi nan bang volt cau dung 7805 va 7905 e tao ra +-5V cung
cap cho mach.
Tac ca cac tu loc dung 100uF/50V va tu chong nhieu dung tu 103.
Ngoai ra con co tu loc khi en cac khoi cu the.Tu loc tai cac khoi la
10uF/50V va tu loc la 102.
Khong can giai nhiet cho 7805 va 7905 v cong suat tieu tan con
trong gii han t giai nhiet.
Khoi nguon sau khi a ve mach thi cong ,mach chay tot cung cap u
cho tai va khong b nong on ap .Khong co g kho trong khoi nguon cung
cap.Sau khi thi cong noi cac chan nguon can thiet ra Jump.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:88 1-2002
3,Ket qua thi cong khoi cam bien:
au cam bien lay t au micro cua may radio .No co cau tao t
mang than co tr khang khoang 1200 om va cam bien rat nhay.Sau khi lay
c au do nay ,tien hanh cam breakboard e th sau khi o c tn hieu
cung dang song,tien hanh thi cong mach.Phan cam bie n co bien tr chnh
phan cc cho au do nham muc ch co c o li toi a.
Sau khi thi cong a o c dang song cua nhp tim theo yeu cau.
Sau ay la dang song qua cam bien:


2mv
-1mv




Thc chat la ta ang dung cam bien c qua ien.








GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:89 1-2002
4,Ket qua thi cong khoi phan kenh:
Khoi phan kenh sau khi thi cong chuyen kenh tot nhng b rung phm
nhan,dung tu thay oi dan cuoi cung cung c nh y muon chong rung
phm nhan to va khong co sai sot.Co mot LED 7 oan e hien th kenh hien
tai.Chon nguon cung cap la 12V .
Sau cung mach thong tn hieu tot,chuyen kenh ro rang khong gay
nhieu cho tn hieu.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:90 1-2002
5,Ket qua thi cong khoi khuech ai:
Khoi khuech ai c tnh toan co o li 100 lan, va tiep theo
khuech ai 10 lan.S d phai khuech ai hai tan la v khuech ai mot tan co
Av qua ln se gay meo nhieu hn.Sau khi kem qua mach loc thong day,loc
nhieu 50Hz o li con lai khoang 100 lan.(do phan loc la cac mach thu
ong nen suy gian tn hieu rat nhieu).
Mach khuech ai thi cong b8ang TL 082 s dung nguon oi +-5V
cung cap. ay khong can chnh opset v phan sau ta ch lay mc ngng
ma thoi.
Dang song sau khi qua mach loc va khuech ai:
150mv
-100mv
200mv
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:91 1-2002
6,Ket qua thi cong khoi trigger(lay ngng):
Thc chat nh a trnh bay hng cua e tai la ch lay c nhp tim
ma khong can dang song.Chnh v vay ta cho tn hieu nay qua mach lay
ngng ,au ra la mot xung vuong co tan so theo nhp tim.
Mach lay ngng nay co mot bien tr 50K om e chnh o nhay,ieu
nay phat sinh khi hoan thanh o th co mo t so ngi mach qua yeu khong
the lay c tn hieu .Ngha la tn hieu khong nh mong muon co o li
qua nho.Mc nhay thay oi t 50mV en 5V.
Sau khi chnh bien tr tat ca ai cung thu c tn hieu.
Ngoai ra con co mot diot xa xung am trc khi vao lay ngng,ieu
nay cung khong can thiet cho lam.
Dang song au ra la mot xung vuong theo nhp tim co mc nh la
+4.5V.Dang song nh sau:
au ra con co mot volt xa mc bao hoa am cua opamp.

150mv
-100mv
200mv
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:92 1-2002
7,Ket qua thi cong khoi ieu che am tan:
Khoi nay th khong can thiet cho lam nhng muc ch la e tn hieu
ra la mot day xung.Dung han bien ta c day xung vuong co long nhng
xung vuong nho co tan so 3000Hz,lam cho bo ieu che on nh hn(tranh
qua tai di tan qua xa khi cho phep bang thong thu FM).
Thc te tn hieu thu c nghe bang loa co tnh de chu hn( phan
giai ieu che thu).
Dung mot LM555 dao ong 3000Hz( cai trc) va cho tn hieu vao
ieu khien chan so 4(reset).Ta c yeu cau nay .
au ra la mot day xung vuong theo nhp tim trong xung vuong nay lai co
long cac xung vuong nho co tan so 3000Hz nh tren.
Dang song ra c han bien trc khi vao mach ieu che phat song
FM:
4.5v
400
dao
ong
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:93 1-2002
8,Khoi ieu che cao tan va khuech ai cao tan:
Chon phng thc ieu che AM trong FM ,dao ong noi la dao ong
Colipt(cach nay n gian nhat).Chon f=90Mhz khong trung vi ai nao
trong day tan FM cua nc ta,thc te lam c v ta co cuon cam chnh
c L.
Sau khi thi cong va can chnh mach chay tot dung cop o va chnh
ung 90Mhz nh mong muon.
Tn hieu trc khi vao ieu che co loc va can chnh mc, tranh qua
tai cho bo ieu che .V ch co hai mc di tan mot la di tan khi khong co
tn hieu (nhieu) hai la di tan khi co tn hieu am tan vao.
Sau khi can chnh mach chay tot,dung may thu radio co tn hieu thu
nhng bat gap nhieu trong moi trng thu .
Phan tiep theo dung mot khuech ai em va mot cong suat cuon cam
phoi hp a ra anten gi song i.
Sau cung con co mot tu chnh thay oi,muc ch tao phoi hp
anten.Khi can xong co nh bang mot tu pi.
Dang song a ieu che nh sau:

90Mhz+ di
tan
90Mhz+ditan khong ang
ke


Hnh nay ch co cach tng trng ma thoi.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:94 1-2002
9,Tong quan mach phat:
Mach phat co mot so van e gap phai trong thi cong nhng cuoi cung
cung can chnh c va chay tot,u cong suat theo yeu cau cua thay.
Sau khi hoan chnh cho vao trong hop thiet e chong nhieu va gon
gan.Mat trc la bien tr chnh o nhay,cong tac nhan chuyen kenh
thu,en bao kenh thu,mat sau la day nguon va so kenh vao tng ng.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:95 1-2002
II:Ket qua thi cong bo thu(giai ieu che FM):
1, Ket qua thi cong khoi giai ieu che IF:
S o mach khoi thu va giai ieu che FM nay c lay ra t may
radio cua Tosiba.Ch viec ve mach lai t s o nguyen ly theo tai lieu.
Sau khi thi cong mach thu tn hieu rat tot ke ca cac ai phat cua
thanh pho,mach co en bao tn hieu va bien tr chnh thien ap cho
Varicaptor dung thay oi tan so bo loc thu.
Chon IF la 10.7Mhz ung chuan FM t tu loc gom 10.7Mhz ban tren
th trng.
Sau cung tn hieu ra la am tan lap lai dang song cua au phat.
Khi co tn hieu nghe te te con khi khong co nghe re(nho )cua nhieu thu.
Chon nguon cung cap la 8V cho ca mach.
Sau cung khi can chnh hoan chnh cac van e lien quan,ket thuc va
khoa tan so bo thu lai.Tuy nhien dung bien tr tinh chnh tan so bo thu
phong khi o di tan bo phat qua ln.
Tn hieu sau khi phuc hoi nh sau:





4.5v
400
dao
ong
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:96 1-2002
That ra e t lam mot may thu FM khong la van e de dang chnh v vay
ngay t ban au em chon phng phap thi cong mach lai t s o nguyen ly
cua mot mach co san trong may radio.Chnh v ieu nay nen co mot so tnh
toan trong khoi giai ieu che xem ra khong phu hp va chnh em cung cha
tm hieu het chc nang cua IC tren.ay la mot iem yeu cua em.
Tat ca cac linh kien la loai thng muc ch mhat tao ,v du
tu la tu pi bnh thng, tr la loai thng sai so 10%,Cuon cam th t
quan loi va can chnh
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:97 1-2002
2,Ket qua thi cong mach loc thu va sa dang tn hieu:
Cac dang song tren la l tng thc te co rat nhieu nhieu va tn hieu
lay c trc tiep khong nh y muon chung ta.Mot lan na lap lai mach loc
va mach sa dang nh khoi phat .Qua trnh nay de dang hn.Sau khi qua
mach loc khuech ai va lay ngng tn hieu ra nh mong muon va nen
nhieu rat tot.Nhieu c nen nh loc va nh vao mach lay ngng.Tn hieu
ra la mot day xung vuong co the giao tiep cho vi x ly .
Chon mach loc la bac 1 (that ra ta khong can nen cao lam).
Sau khi loc nhieu xong se chuyen giao cho khuech ai cong suat e
nghe bang loa.Phan lam mach khuech ai khong e cap ay.
Bo thu xem nh hoan chnh.
***Tao mot dao ong chuan dung test:
That ra ieu nay khong can thiet v mot mach test nay ch bang mot
lenh n gian trong MCU.Nhng no la that va nh vay sinh ong hn,de
kiem tra mach hn.Va no cung chnh la phan chnh e test mach thc te khi
bo thu cha thi cong xong.Chon dao ong chuan la ung 1Hz(60 nhp tren
phut).
Bo dao ong lam t LM555 cung cung cap nguon la +5v.au ra co
mc la 4.5V de dang lam interrup cho MCU.
Ca hai dao ong chuan va tn hieu thu qua cong tac chuyen oi e
vao interrup0 cua MCU.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:98 1-2002
III:Ket qua thi cong khoi MCU va hien th:
1,Khoi MCU:
Bay gi moi van e a qua de dang,a co tn hieu ro rang co the
giao tiep bang interrup cua MCU.
Phan cng cho MCU th a qua de dang v khong co mot cai g kho
khan t s o nguyen ly en thi cong mach.Khoi MCU ch giao tiep ra
ngoai 3 LED 7 oan ma thoi.
Ban au test mach co khong chay,nhng o la do loi cua phan mem
sau nhieu lan sa phan mem th mach chay tot ,ung yeu cau e bai.oi
khi cung co hien th sai nhng van e nay la do nhieu gay ra.
Sau khi co gang triet nhieu mach chay tot hn nhng van oi khi b
sai,cach khac phuc la chong nhieu bang phan mem.
Cuoi cung th mach cung hoan thanh.Nhp tim hien thi o c cua
ngi bnh thng bien thien t 50 en 70 nhp tren mot phut.
Sau khi thi cong mach chay tot nhan xung chuan va hien th ro rang.
Khoi MCU xem nh hoan thanh.
2,Ket qua thi cong khoi hien th led:
Khoi hien th LED a thiet ke va thi cong phan cng mach chay on
nh LED sang ung(khong qua sang va cung khong qua toi). Sau khi thi
cong mach chay ung vi chng trnh phan mem trong MCU.
Cach thc hien th LED la giai ma trc tiep t phan mem cua MCU
dung phng phap tra bang e lay ma so .V the phan cng rat n gian.
3,Tong quan thi cong khoi nhan tn hieu va hien th:
Sau khi khoi thu a hoan tat (nhan tn hieu va hien th tot) ca khoi
thu va MCU cho vao mot hop thiet co vo boc,e gon gan va chong nhieu
tot hn.Mat trc co en bao tn hieu thu,bien tr tinh chnh tan so thu,nut
nhan e test mach(chuyen xung chuan va xung thu c),en nguon,en
bao co tn hieu ai phat.Va ba LED7 oan e hien th ket qua o c.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:99 1-2002
4,anh gia cac sai so trong phep o va hien th:
Trong phep o tn hieu nhp tim cua may nay.Neu ta nghe bang loa
hay nhn bang en bao th xem nh sai so la khong co,v tn hieu phat va
thu th hoan toan la tn hieu analog.Du cho co bien dang tn hieu ra sao th
sao cung mot nhp ap van la mot tn hieu am thanh hay tn hieu chp en.
Sai so a ra khi a tn hieu nay vao mach so e x l ket qua va
hien th.
a,Nguyen nhan gay ra sai so:
Chu yeu la do nhan sai va trnh tnh toan trong phan mem gay ra cac
van e nay.
Hn na hien tai ta ang o trong 5giay ma phai qui oi ra mot phut.
Ngha la ta ang dung mot phng phap noi suy logic.
Do chong nhieu phan mem ma ta phai triet cac xung nhieu va qui oi
ket qua lan trc.Ngha la ta ang dung thuat d oan logic.
Cuoi cung do trnh nhan chia phai lam tron so .Ngha la ta ang dung
phep qui tron hu han.
Hien tai nhp tim o b sai so.Theo phep sai so t trnh nhan chia
cong don va lay trung bnh,qui oi sai so thc te cua mach ang la 5%.Nhp
tim vi sai so nay th cao nhng hien tai van chap nhan c v ngi ta
cung ch phong oan nhp tim trong mot khoang nao o.
b,Hng khac phuc:
That ra e giam sai so nay can khac phuc ca phan cng lan phan
mem.Van e nay th khong kho lam.Nhng trong gii han e tai va thi
gian cho phep,em ch giam mc toi thieu ma thoi.
Cu the:
Tat ca cac trnh nhan chia ,tnh toan ay len 16 bt e chong tran.
Co gang triet nhieu va tnh toan mach trigger chnh xac hn.
Cuoi cung th sai so co giam nhng van khong ang ke cho lam.
Hien tai sai so khoang 4 en 5 %.



HOAN THANH NGAY 7-THANG 01 NAM 2002

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:100 1-2002















CHNG VI:
HNG M RONG E TAI
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:101 1-2002
1,Cac han che cua e tai:
e tai nay qua n gian t khau lay tn hieu en khau hien th,mach
th b nhieu rat cao,va khong the ap dung rong rai c.Ve nguyen ly th
ung nhng khi thi cong th co nhieu sa oi.
Thiet b cam bien qua n s va lnh kien cho mach thuoc loai re
tien,khong chnh xac va gay nhieu.
Nh vay han che cua e tai nay la khong tm c cam bien ien
cho nhp tim ma ban chat la chuyen tn hieu t c sang ien,xet ve ban chat
tn hieu th qua trnh nay a gay ra mot meo dang rat ln cho tn hieu.
Cac linh kien dung chu yeu loai thong thng,chnh ieu nay gay
nhieu cho mach.
Bo nan nguon theo cach nay th can nhieu 50 Hz rat cao.
Bo phan trigger a chuyen tai sai lech hoan toan dang tn hieu
nguyen thuy thu c t cam bien va khuech ai.
Cach ieu che nay qua n s gay di tan ln va khong chnh xac, tan
so trung tam khong on nh.
Bo thu lai mot lan na sa tn hieu sai lech hoan toan.
That ra do muc ch cuoi cung la tm c mc tn hieu theo nhp tim
dung cho interrup ma co cac thay oi nh tren.
2,Hng sa nguyen ly mach va cach m rong:
e co mot may o hoan chnh lay ,ieu trc tien la phai lay that
chnh xac t tn hieu nhp tim,no quyet nh khau au tien.Va phai chong
nhieu that tot.Phai s dung linh kien chnh xac chnh opset toi thieu th mi
mong lam c ieu nay v ta biet cam bien do ng ien(hay ien ap)t nhp
ap rat nho.oi khi chnh nhieu cua con ngi lai ln hn tn hieu nay.
Cam bien lay dang song phai la cam bien ien.Cau tao cam bien
phai t mieng kim loai va ap vao da ,phan cc that chnh xac va phai
chong nhieu that tot t day dan tn hieu cam bien en may o.
Nh vay theo hng nay.Theo mach cu the trong luan van nay th
trc tien la phai thay lai cam bien va thay tat ca linh kien khuech ai
bang linh kien tot co mc can chnh opset tuyet oi nho nhat va ien tr
phai la tr chnh xac,bien tr phai la bien tr tinh chnh,tu ien phai la tu
keo.
Phai bo qua mach trigger v chnh no a lam mat dang tn hieu thu
c t cam bien.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:102 1-2002
khoi thu ,sau khi giai ieu che phuc hoi. Muon xem tren bang giay
th phai co mach chuyen oi tn hieu ien nay thanh tn hieu c.ieu khien
goc kim quet bang giay chang han hay ieu khien lc t cu a nam cham
ien.
e xem c dang song nay can phai co bien oi AD chnh xac,toc
o cao ,phai so hoa va x l tn hieu so nay.Neu muon hien th len en
CRT th phai long vao tn hieu quet doc quet ngang.Neu muon giao tiep
qua may tnh (qua card ISA,PCI chang han) th phai co card giao tiep va
phai co phan mem lap trnh x ly so lieu thu c(V du nh Pascal, C++,
Delphi ) con muon truyen i xa th phai co modem va cong thu phat noi
tiep.
e tai nay ch dng lai ay.Mong co ai o lam luan van se lay
c tn hieu ien t nhp tim va x ly truyen thong tot hn th co the hoan
thien hn giao tiep va nh luon so lieu dang song tn hieu.Neu co x ly
song cong th co the ieu khien ca khoi nhan tn hieu mot cach hoan hao
e thu cung nhieu dang song,nhieu ao trnh khac nhau trong c the.Va co
the truyen i xa e cho cac bac s gioi ni cach xa xem c ket qua va
chuan oan benh ly mot cach chnh xac,co quyet nh nhanh chong khi co
s co xay ra.







GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:103 1-2002

















MUC LUC:
CHI TIET AT 89C51 VA CAC IC
KHAC
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:104 1-2002
I:Vi ieu khien 8951
1/ Gii thieu ho MCS51:
MCS51 la mot ho IC vi ieu khien (Microcontroller ) do hang Intel san
xuat. Cac IC tieu bieu cho ho MCS51 la 8051 va 8031. ac biet, vi ieu
khien 8951 c san xuat gan ay mang cac ac iem sau:

4 Kbytes EEPROM.
128 bytes RAM.
4 ports I/O (Input/Output).
2 bo nh thi (timer) 16 bits.
Giao tiep noi tiep.
64 Kbytes khong gian bo nh chng trnh m rong.
64 Kbytes khong gian bo nh d lieu m rong.
Mot bo x l luan l (thao tac tren cac bit n).
210 bits c a ch hoa.
Bo nhan chia 4 s.















2/ S lc ve cac chan cua 8951:

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:105 1-2002
C 8951 co tat ca 40 chan co chc nang nh cac ng xuat nhap. Trong
o co 24 chan co cong dung kep, moi ng co the hoat ong nh ng
xuat nhap hoac nh ng ieu khien hoac la thanh phan cua bus d lieu
va bus a ch.


2.1/ He thong giao tiep port:
a/ Port 0:
Port 0 la mot port hai chc nang tren cac chan 32 39. Trong cac thiet
ke c nho (khong dung bo nh m rong) no co chc nang nh cac ng
I/O. oi vi cac thiet ke ln vi bo nh m rong, no c hp kenh gia
bus d lieu va byte thap cua bus a ch.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:106 1-2002


b/ Port 1:
Port 1 la mot port I/O tren cac chan 1 8. Cac chan c k hieu:
P1.0 ; P1.1 ; P1.2 co the dung cho giao tiep vi cac thiet b ngoai neu
can. Port 1 khong co chc nang khac, v vay chung ch c dung cho
giao tiep vi cac thiet b ngoai.

c/ Port 2:
Port 2 la mot port cong dung kep tren cac chan 21 28 c dung nh
cac ng xuat nhap hoac la byte cao cua bus a ch oi vi cac thiet ke
dung bo nh m rong.

d/ Port 3:
Port 3 la mot port cong dung kep tren cac chan 10 17. Cac chan cua
port nay co nhieu chc nang, cac cong dung chuyen oi co lien he vi cac
ac tnh ac biet cua 8951 nh bang sau:

B
i
t
Ten Chc nang chuyen oi
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
RXD
TXD
INT0\
INT1\
T0
T1
WR\
RD\
D lieu nhan cho port noi tiep
D lieu phat cho port noi tiep
Ngat 0 ben ngoai
Ngat 1 ben ngoai
Ngo vao cua Timer/counter 0
Ngo vao cua Timer/counter 1
Xung ghi bo nh d lieu ngoai
Xung oc bo nh d lieu ngoai

2.2/ Cac tn hieu ieu khien:
C 8951 co 4 tn hieu ieu khien:
a/ PSEN\ (Program Store Enable):
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:107 1-2002
PSEN\ la tn hieu ra tren chan 29. No la tn hieu ieu khien cho phep
bo nh chng trnh m rong, PSEN\ thng c noi en chan OE
(Output Enable) cua mot EPROM e cho phep oc cac byte ma lenh.
PSEN\ se mc thap trong thi gian lay lenh. Cac ma nh phan cua
chng trnh c oc t EPROM qua bus d lieu va c chot vao thanh
ghi lenh cua 8951 e giai ma lenh. Neu thi hanh chng trnh trong ROM
noi (8951) th PSEN\ se mc thu ong (mc cao).

b/ ALE (Address Latch Enable):
Tn hieu ra ALE tren chan 30 tng hp vi cac thiet b lam viec vi
cac vi x l 8085, 8088, 8086.
C 8951 dung ALE mot cach tng t cho viec giai kenh cac bus a
ch va d lieu.
Khi port 0 c dung trong che o chuyen oi: va la bus d lieu va
la byte thap cua bus a ch, ALE la tn hieu e chot byte thap a ch
vao mot thanh ghi ben ngoai trong na au chu k bo nh. Sau o, cac
ng port 0 dung e xuat nhap d lieu trong na sau cua chu k bo nh.
Cac xung tn hieu ALE co toc o bang 1/6 lan tan so dao ong tren
chip va co the c dung lam nguon xung nhp cho cac phan khac cua he
thong. Neu xung nhp tren 8951 la 12 Mhz th ALE co tan so 2 Mhz. Ch
ngoai tr khi thi hanh lenh MOVX, mot xung ALE se b mat. Trong
trng hp la 8051 th chan nay cung c lam ngo va o cho xung lap
trnh cho EPROM trong chip.

c/ EA\ (External Access):
Tn hieu vao EA\ tren chan 31 thng c mac len mc cao (+5v)
hoac mc thap (GND). Neu mc cao, 8951 thi hanh chng trnh t
ROM noi trong khoang a ch thap (4K). Neu mc thap, chng trnh
ch c thi hanh t bo nh m rong.
Khi dung 8031, EA\ luon c noi mc thap v 8031 khong co bo nh
chng trnh tren chip. Neu EA\ c noi mc thap th bo nh chng
trnh ben trong 8951 se b cam va chng trnh ch c thi hanh t
EPROM m rong.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:108 1-2002
Ngi ta con dung EA\ lam chan cap ien ap 21V khi lap trnh cho
EEPROM trong 8051.

d/ RST (Reset):
Ngo vao RST tren chan 9 la ngo reset cua 8951. Khi tn hieu nay c
a len mc cao (trong t nhat 2 chu k may), cac thanh ghi ben trong
8951 c tai nhng gia tr thch hp e khi ong he thong.
e/ Cac ngo vao bo dao ong tren chip:
Nh a thay trong cac hnh tren, 8951 co mot bo dao ong tren chip. No
thng c noi vi mot thach anh gia hai chan 18 va 19. Cac tu gi
cung can thiet nh a ve. Tan so thach anh thong thng la 12 Mhz.

f/ Cac chan nguon:
8951 hoat ong vi nguon n +5V. Vcc c no i vao chan 40 va Vss
(GND) c noi vao chan 20.

3/ To chc bo nh:
3.1/ Khao sat to chc bo nh 8951:
C 8951 co bo nh c to chc theo cau truc Harvard : co nhng
vung bo nh rieng biet cho chng trnh va d lieu.
Nh a noi tren, ca chng trnh va d lieu co the ben trong (8951);
du vay chung co the c m rong bang cac thanh phan ngoai len en
toi a 64 Kbytes bo nh chng trnh va 64 Kbytes bo nh d lieu.
Bo nh ben trong bao gom ROM (8951) va RAM tren chip bao gom
nhieu thanh phan: Phan lu tr a dung, phan lu tr a ch hoa tng bit,
cac bank thanh ghi va cac thanh ghi chc nang ac biet.

FFFF
Bo nh
chng trnh
FFFF
Bo nh
d lieu
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:109 1-2002
FF




00










0000

c chon
qua PSEN\








0000

c chon
qua WR\
va RD\



Bo nh tren chip Bo nh m rong

Tom tat cac vung bo nh cua 8951.
Hai ac tnh can lu y la:
Cac thanh ghi va cac port xuat nhap a c xep trong bo nh va co
the c truy xuat trc tiep giong nh cac a ch bo nh khac.
Ngan xep ben trong RAM noi nho hn so vi RAM ngoai so vi bo x
l khac.
3.2/ Chi tiet ve bo nh RAM tren chip:
Nh se thay trong hnh sau, RAM ben trong 8951 c phan chia thanh
cac bank thanh ghi (00H 1FH), RAM a ch hoa bit (20H 2FH), RAM
a dung (30H 7FH) va cac thanh ghi chc nang ac biet trong khoang
(80H FFH).
RAM a dung:
Mac du tren hnh cho thay 80 bytes RAM a dung chiem cac a ch t
30H 7FH, 32 bytes di cung t 00H 1FH cung co the c dung vi
muc ch tng t (mac du cac a ch nay a co muc ch khac).

a ch a ch
byte a ch bit byte a ch bit
7F
RAM a dung
FF
F0 F7 F6 F5 F4 F3 F2 F1 F0 B

E0 E7 E6 E5 E4 E3 E2 E1 E0 ACC

D0 D7 D6 D5 D4 D3 D2 _ D0 PSW

30 B8 _ _ _ BC BB BA B9 B8 IP
2F 7F 7E 7D 7C 7B 7A 79 78
2E 77 76 75 74 73 72 71 70 B0 B7 B6 B5 B4 B3 B2 B1 B0 P3
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:110 1-2002
2D 6F 6E 6D 6C 6B 6A 69 68
2C 67 66 65 64 63 62 61 60 A8 AF _ _ AC AB AA A9 A8 IE
2B 5F 5E 5D 5C 5B 5A 59 58
2A 57 56 55 54 53 52 51 50 A0 A7 A6 A5 A4 A3 A2 A1 A0 P2
29 4F 4E 4D 4C 4B 4A 49 48
28 47 46 45 44 43 42 41 40 99 khong c a ch hoa bit SBUF
27 3F 3E 3D 3C 3B 3A 39 38 98 9F 9E 9D 9C 9B 9A 99 98 SCON
26 37 36 35 34 33 32 31 30
25 2F 2E 2D 2C 2B 2A 29 28 90 97 96 95 94 93 92 91 90 P1
24 27 26 25 24 23 22 21 20
23 1F 1E 1D 1C 1B 1A 19 18 8D khong c a ch hoa bit TH1
22 17 16 15 14 13 12 11 10 8C khong c a ch hoa bit TH0
21 0F 0E 0D 0C 0B 0A 09 08 8B khong c a ch hoa bit TL1
20 07 06 05 04 03 02 01 00 8A khong c a ch hoa bit TL0
1F BANK 3

89 khong c a ch hoa bit TMOD
18 88 8F 8E 8D 8C 8B 8A 89 88 TCON
17 BANK 2 87 khong c a ch hoa bit PCON
10
0F BANK 1 83 khong c a ch hoa bit DPH
08 82 khong c a ch hoa bit DPL
07 BANK 0
( Mac nh cho R0 R7 )
81 khong c a ch hoa bit SP
00 80 87 86 85 84 83 82 81 80 P0

RAM CAC THANH GHI CHC NANG AC BIET

Tom tat bo nh d lieu tren chip

Moi a ch trong vung RAM a dung eu co the c truy xuat t do
dung cach anh a ch trc tiep hoac gian tiep. V du, e oc noi dung
a ch 5FH cua RAM noi vao thanh ghi tch luy, lenh sau se c dung:
MOV A, 5FH
Lenh nay di chuyen 1 byte d lieu dung cach anh a ch trc tiep e
xac nh a ch nguon (5FH). ch nhan d lieu c ngam xac nh
trong ma lenh la thanh ghi tch luy A.
RAM ben trong cung co the c truy xuat dung cach anh a ch gian
tiep qua R0 hay R1. V du, hai lenh sau thi hanh cu ng nhiem vu nh lenh
n tren:
MOV R0, #5FH
MOV A, @R0
Lenh au dung a ch tc thi e di chuyen gia tr 5FH vao thanh ghi
R0, va lenh th hai dung a ch gian tiep e di chuyen d lieu c tro
bi R0 vao thanh ghi tch luy.
RAM a ch hoa tng bit:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:111 1-2002
C 8951 cha 210 bits c a ch hoa, trong o 128 bits la cac a ch byte
20H en 2FH, va phan con lai la trong cac thanh ghi chc nang ac biet.
Y tng truy xuat tng bit rieng re bang phan mem la mot ac tnh tien
li cua vi ieu khien noi chung. Cac bit co the c at, xoa, AND, OR,
vi mot lenh n. Trong khi o, a so cac vi x l oi hoi mot chuoi
lenh oc sa ghi e at c hieu qua tng t. Hn na, cac port
I/O cung c a ch hoa tng bit lam n gian phan mem xuat nhap
tng bit.
Co 128 bits c a ch hoa a dung cac byte 20H en 2FH. Cac a
ch nay c truy xuat nh cac byte hoac nh cac bit phu thuoc vao lenh
c dung. V du, e at bit 67H, ta dung lenh sau:
SET 67H
Chu y rang a ch bit 67H la bit co trong so ln nhat (MSB) a
ch byte 2CH. Lenh tren se khong tac ong en cac bit khac a ch
nay. Cac vi x l se phai thi hanh nhiem vu tng t nh sau:
MOV A, 2CH ; oc ca byte
ORL A, #10000000B ; set MSB
MOV 2CH, A ; ghi lai ca byte
Cac bank thanh ghi:
32 bytes thap nhat cua bo nh noi la danh cho cac bank thanh ghi. Bo
lenh cua 8951 ho tr 8 thanh ghi (R0 R7) va theo mac nh (sau khi
reset he thong) cac thanh ghi nay cac a ch 00H 07H. Lenh sau ay
se oc noi dung a ch 05H vao thanh ghi tch luy :
MOV A, R5
ay la lenh mot byte dung a ch thanh ghi. Tat nhien, thao tac tng
t co the c thi hanh bang lenh 2 bytes dung a ch trc tiep nam
trong byte th hai:
MOV A, 05H
Cac lenh dung cac thanh ghi R0 en R7 th ngan hn va nhanh hn cac
lenh tng ng nhng dung a ch trc tiep. Cac gia tr d lieu c
dung thng xuyen nen dung mot trong cac thanh ghi nay.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:112 1-2002
Bank thanh ghi tch cc co the c chuyen oi bang cach thay oi
cac bit chon bank thanh ghi trong t trang thai chng trnh (PSW). Gia s
rang bank thanh ghi 3 c tch cc, lenh sau se ghi noi dung cua thanh ghi
tch luy vao a ch 18H:
MOV R0, A
Y tng dung cac bank thanh ghi cho phep chuyen hng chng
trnh nhanh va hieu qua (tng phan rieng re cua phan mem se co mot bo
thanh ghi rieng khong phu thuoc vao cac phan khac).
4/ Cac thanh ghi chc nang ac biet:
Cac thanh ghi noi cua 8951 c truy xuat ngam nh bi bo lenh. V
du lenh INC A se tang noi dung cua thanh ghi tch luy A len 1. Tac
ong nay c ngam nh trong ma lenh.
Cac thanh ghi trong 8951 c nh dang nh mot phan cua RAM tren
chip. V vay moi thanh ghi se co mot a ch (ngoai tr thanh ghi em
chng trnh va thanh ghi lenh v cac thanh ghi nay hiem khi b tac ong
trc tiep, nen khong li loc g khi at chung vao trong RAM tren chip).
o la l do e 8951 co nhieu thanh ghi nh vay. Cung nh R0 en R7, co
21 thanh ghi chc nang ac biet (SFR: Special Function Register) vung
tren cua RAM noi, t a ch 80H en FFH. Chu y rang hau het 128 a
ch t 80H en FFH khong c nh ngha. Ch co 21 a ch SFR la
c nh ngha.
Ngoai tr thanh ghi tch luy A co the c truy xuat ngam nh a noi,
a so cac SFR c truy xuat dung a ch trc tiep. Chu y rang mot vai
SFR co the c a ch hoa bit hoac byte. Ngi thiet ke phai than
trong khi truy xuat bit va byte. V du lenh sau:
SETB 0E0H
Lenh nay se set bit 0 trong thanh ghi tch luy, cac bit khac khong oi.
Ta thay rang E0H ong thi la a ch byte cua ca thanh ghi tch luy va
la a ch bit cua bit co trong so nho nhat trong thanh ghi tch luy. V lenh
SETB ch tac ong tren bit, nen ch co a ch bit la co hieu qua.
a/ T trang thai chng trnh:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:113 1-2002
T trang thai chng trnh (PSW: Program Status Word) a ch D0H
cha cac bit trang thai nh bang tom tat sau:

Bit K hieu a ch Y ngha
PSW.7 CY D7H C nh
PSW.6 AC D6H C nh phu
PSW.5 F0 D5H C 0
PSW.4 RS1 D4H Bit 1 chon bank thanh ghi
PSW.3 RS0 D3H Bit 0 chon bank thanh ghi
00 = bank 0 ( a ch 00H 07H )
01 = bank 1 ( a ch 08H 0FH )
10 = bank 2 ( a ch 10H 17H )
11 = bank 3 ( a ch 18H 1FH )
PSW.2 OV D2H C tran
PSW.1 _ D1H D tr
PSW.0 P D0H C parity chan

- C nh:
C nh (CY) co cong dung kep. Thong thng no c dung cho cac
lenh toan hoc: no se c set neu co mot so nh sinh ra bi phep cong
hoac co mot so mn bi phep tr. V du, neu thanh ghi tch luy cha
FFH, th lenh sau:
ADD A, #1
se tra ve thanh ghi tch luy ket qua 00H va set c nh trong PSWK.
C nh cung co the xem nh mot thanh ghi 1 bit cho cac lenh luan l thi hanh
tren bit. V du, lenh sau se AND bit 25H vi c nh va at ket qua tr vao c nh:
AND C, 25H
- C nh phu:
Khi cong cac so BCD, c nh phu (AC) c set neu ket qua cua 4 bit
thap trong khoang 0AH en 0FH. Neu cac gia tr c cong la so BCD
th sau lenh cong can co DA A (hieu chnh thap phan thanh ghi tch luy)
e ieu chnh ket qua cho phu hp.
- C 0:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:114 1-2002
C 0 (F0) la 1 bit c a dung danh cho cac ng dung cua ngi dung.
- Cac bit chon bank thanh ghi :
Cac bit chon bank thanh ghi (RS0 va RS1) xac nh bank thanh ghi nao
c tch cc. Chung c xoa sau khi reset he thong va c thay oi
bang phan mem neu can. V du, 3 lenh sau cho phep bank thanh ghi 3 va
di chuyen noi dung cua thanh ghi R7 (a ch byte 1FH) en thanh ghi
tch luy:
SETB RS1
SETB RS0
MOV A, R7
Khi chng trnh c hp dch, cac a ch bit ung c thay the cho
cac k hieu RS1 va RS0.
Vay, lenh SETB RS1 se giong nh lenh SETB 0D4H.
- C tran:
C tran (OV) c set sau mot lenh cong hoac tr neu co phep toan
b tran. Khi cac so co dau c cong hoac tr vi nhau, phan mem co the
kiem tra bit nay e xac nh xem ket qua co nam trong tam xac nh
khong. Khi cac so khong dau c cong, bit OV co the c bo qua. Cac
ket qua ln hn +127 hoac nho hn 128 se set bit OV.
V du, phep cong sau b tran va bit OV c set :
Hex 0F Thap phan 15
+ +
7F 127

8E 142
Ket qua la mot so co dau 8EH c xem nh 14, khong phai la mot
ket qua ung (142), v vay bit OV c set.

b/ Thanh ghi B:
Thanh ghi B a ch F0H c dung vi thanh ghi tch luy A cho cac
phep toan nhan va chia.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:115 1-2002
Lenh MUL AB se nhan cac gia tr khong dau 8 bit trong A va B roi tra
ve ket qua 16 bit trong A (byte thap) va B (byte cao).
Lenh DIV AB se chia A cho B roi tra ve ket qua nguyen trong A va
phan d trong B.
Thanh ghi B cung co the c xem nh thanh ghi em a dung. No
c a ch hoa tng bit bang cac a ch bit F0H en F7H.
c/ Con tro ngan xep:
Con tro ngan xep (SP) la mot thanh ghi 8 bit a ch 81H. No cha a
ch cua byte d lieu hien hanh tren nh cua ngan xep. Cac lenh tren
ngan xep bao gom cac thao tac cat d lieu vao ngan xep va lay d lieu
ra khoi ngan xep. Lenh cat d lieu vao ngan xep se lam tang SP trc
khi cat d lieu, va lenh lay d lieu ra khoi ngan xep se oc d lieu va
giam SP.
Ngan xep cua 8951 c gi trong RAM noi va c gii han cac a
ch co the truy xuat bang a ch gian tiep. Chung la 128 bytes au cua
8951.
e khi ong lai SP vi ngan xep bat au tai 60H, cac lenh sau ay
c dung:
MOV SP, #5FH
Tren 8951 ngan xep b gii han 32 bytes v a ch cao nhat cua RAM
tren chip la 7FH. S d dung gia tr 5FH v SP se tang len 60H trc khi cat
byte d lieu au tien.
Ngi thiet ke co the chon khong phai khi ong lai con tro ngan
xep ma e no lay gia tr mac nh khi reset he thong. Gia tr mac nh o la
07H va ket qua la ngan au tien e cat d lieu co a ch la 08H.
Neu phan mem ng dung khong khi ong lai SP, th bank thanh ghi 1
(co the ca 2 va 3) se khong dung c v vung RAM nay a c dung
lam ngan xep.
Ngan xep c truy xuat trc tiep bang lenh PUSH va POP e lu tr
tam thi va lay lai d lieu, hoac c truy xuat ngam bang cac lenh goi
chng trnh con (ACALL, LCALL) va cac lenh tr ve (RET, RETI) e
cat va lay lai bo em chng trnh.

d/ Con tro d lieu:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:116 1-2002
Con tro d lieu (DPTR) e truy xuat bo nh ngoai la mot thanh ghi
16 bit a ch 82H (DPL: byte thap) va 83H (DPH: byte cao).
Ba lenh sau se ghi 55H vao RAM ngoai a ch 1000H:
MOV A, #55H
MOV DPTR, #1000H
MOVX @DPTR, A
Lenh au tien dung a ch tc thi e tai d lieu 55H vao thanh ghi
tch luy. Lenh th hai cung dung a ch tc th i, lan nay e tai d lieu
16 bits 1000H vao con tro d lieu. Lenh th ba dung a ch gian tiep e
di chuyen d lieu trong A (55H) en RAM ngoai a ch c cha
trong DPTR (1000H).

e/ Cac thanh ghi port xuat nhap:
Cac port cua 8951 bao gom Port 0 a ch 80H, Port 1 a ch 90H,
Port 2 a ch A0H va Port 3 a ch B0H.
Tat ca cac port eu c a ch hoa tng bit. ieu o cung cap mot
kha nang giao tiep thuan li.
V du, neu mot motor c noi qua mot cuon day co transistor lai en
bit 7 cua Port 1, no co the c bat va tat bang mot lenh n:
SETB P1.7 ; bat motor
CLR P1.7 ; tat motor
Cac lenh tren dung dau cham e xac nh mot bit trong mot byte.
Trnh hp dch se thi hanh s chuyen oi can thiet, v vay hai lenh sau ay
la nh nhau:
CLR P1.7
CLR 97H
Trong mot v du khac, xem xet giao tiep en mot thiet b vi mot bit
trang thai goi la BUSY, c set khi thiet b ang ban va c xoa khi
thiet b a san sang. Neu BUSY c noi ti P1.5, vong lap sau se c
dung e ch thiet b tr lai trang thai san sang:
WAIT : JB P1.5, WAIT
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:117 1-2002
Lenh nay co ngha la neu bit P1.5 c set th nhay ti nhan
WAIT.
Noi cach khac nhay tr lai va kiem tra lan na.

f/ Cac thanh ghi timer:
C 8951 cha hai bo nh thi/em 16 bits c dung cho viec nh
thi hoac em s kien.
Timer 0 a ch 8AH (TL0: byte thap) va 8CH (TH0 : byte cao).
Timer 1 a ch 8BH (TL1: byte thap) va 8DH (TH1 : byte cao).
Viec van hanh timer c set bi thanh ghi Timer Mode (TMOD)
a ch 89H va thanh ghi ieu khien timer (TCON) a ch 88H.
Ch co TCON c a ch tng bit.

g/ Cac thanh ghi port noi tiep:
C8951 cha mot port noi tiep tren chip danh cho viec trao oi thong
tin vi cac thiet b noi tiep nh may tnh, modem hoac cho viec giao tiep
vi cac IC khac co giao tiep noi tiep (cac bo chuyen oi A/D, cac thanh
ghi dch ).
Mot thanh ghi goi la bo em d lieu noi tiep (SBUF) a ch 99H se
gi ca hai d lieu truyen va nhan.
Khi truyen d lieu th ghi len SBUF, khi nhan d lieu th oc SBUF.
Cac mode van hanh khac nhau c lap trnh qua thanh ghi ieu
khien port noi tiep (SCON) (c a ch hoa tng bit) a ch 98H.

h/ Cac thanh ghi ngat:
C 8951 co cau truc 5 nguon ngat (2 mc u tien).
Cac ngat b cam sau khi reset he thong va se c cho phep bang viec
ghi thanh ghi cho phep ngat (IE) a ch A8H.
Ca hai thanh ghi c a ch hoa tng bit.


GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:118 1-2002
i/ Thanh ghi ieu khien cong suat:
Thanh ghi ieu khien cong suat (PCON) a ch 87H cha nhieu bit
ieu khien. Chung c tom tat trong bang sau:

Bit K hieu Y ngha
7 SMOD Bit gap oi toc o baud, neu c set th toc o baud se tang gap oi trong cac
mode1, 2 va 3 cua port noi tiep.
6 _ Khong nh ngha
5 _ Khong nh ngha
4 _ Khong nh ngha
3 GF1 Bit c a dung 1
2 GF0 Bit c a dung 0
1 PD Giam cong suat, c set e kch hoat mode giam cong suat, ch thoat khi
reset.
0 IDL Mode ch, set e kch hoat mode ch, ch thoat khi co ngat hoac reset he thong.

5/ Bo nh ngoai:
C 8951 co kha nang m rong bo nh len en 64K bo nh chng trnh
va 64K bo nh d lieu ngoai. Do o, co the dung them ROM va RAM
ben ngoai neu can.
Khi dung bo nh ngoai, Port 0 khong con la mot port I/O thuan tuy na.
No c hp kenh gia bus a ch (A0 A7) va bus d lieu (D0 D7)
vi tn hieu ALE e chot byte thap cua a ch khi bat au moi chu k bo
nh. Port 2 thong thng c dung cho byte cao cua bus a ch.
Trong na au cua moi chu k bo nh, byte thap cua a ch c cap
trong Port 0 va c chot bang xung ALE. Mot IC chot 74HC373 (hoac
tng ng) se gi byte a ch thap trong phan con lai cua chu k bo
nh. Trong na sau cua chu k bo nh Port 0 c dung nh bus d lieu
va c oc hoac ghi tuy theo lenh.

a/ Truy xuat bo nh chng trnh ngoai:
Bo nh chng trnh ngoai la mot IC ROM c cho phep bi tn hieu
PSEN\.
Hnh sau mo ta cach noi mot EPROM vao 8951:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:119 1-2002
Giao tiep gia 8951 va EPROM.

Mot chu k may cua 8951 co 12 chu k xung nhp. Neu bo dao ong tren
chip c lai bi mot thach anh 12 Mhz th mot chu k may keo dai 1 s.
Trong mot chu k may, se co hai xung ALE va hai byte c oc t bo
nh chng trnh (neu lenh hien hanh la lenh 2 bytes th byte th hai se
c loai bo). Gian o thi gian cua mot lan lay lenh c ve hnh sau:

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:120 1-2002
Gian o thi gian oc bo nh chng trnh ngoai.

b/ Truy xuat bo nh d lieu ngoai:
Giao tiep gia 8951 va RAM.
Bo nh d lieu ngoai la mot bo nh RAM c cho phep ghi/oc bang
cac tn hieu WR\ va RD\ (cac chan P3.6 va P3.7 thay oi chc nang). Ch
co mot cach truy xuat bo nh d lieu ngoai la vi lenh MOVX dung con tro
d lieu (DPTR) 16 bits hoac R0 va R1 xem nh thanh ghi a ch.
Ket noi bus a ch va bus d lieu gia RAM va 8951 cung giong nh
EPROM va do o cung co the len en 64 Kbytes bo nh RAM.
Ngoai ra, chan RD\ cua 8951 c noi ti chan cho phep xuat (OE\) cua
RAM va chan WR\ c noi ti chan ghi (WR\) cua RAM.
Gian o thi gian cho lenh oc d lieu ngoai c ve tren hnh sau oi vi
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:121 1-2002
lenh MOVX A, @DPTR:

Gian o thi gian cua lenh MOVX.

Gian o thi gian cho lenh ghi (MOVX @DPTR, A) cung tng t ch
khac ng WR\ se thay vao ng RD\ va d lieu c xuat ra tren chan
Port 0 (RD\ van gi mc cao).
c/ Giai ma a ch:
Neu co nhieu EPROM va/hoac nhieu RAM c giao tiep vi 8951, th
can phai giai ma a ch.
Mach giai ma cung tng t nh cac he vi x l khac. V du, neu dung
nhieu EPROM va RAM 8Kbytes th bus a ch can phai c giai ma e
xac nh IC nh nao c chon.

Ngi ta thng dung IC giai ma 74HC138 vi cac ngo ra c noi ti cac
ngo vao chon chip (CS) tren cac IC nh. Hnh sau ve mot he thong vi
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:122 1-2002
nhieu EPROM 8K 2764 va RAM 8K 6264:

Giai ma a ch.
d/ Xep chong bo nh chng trnh va d lieu ben ngoai:
V bo nh chng trnh la ROM, nen nay sinh mot van e bat tien khi phat
trien phan mem cho 8051/8031. oi vi 8951 a cai tien bang cach thay
the bang EEPROM, hoac dung mot cach e khac phuc nhc iem tren la
xep chong cac vung nh chng trnh va d lieu.
Mot IC RAM co the cha ca chng trnh va d lieu bang cach noi ng
OE\ cua RAM vao mot mach logic AND cua PSEN\ va RD\.
Mach tren hnh sau cho phep mot IC RAM c dung lam bo nh chng
trnh va d lieu:
Vay mot chng trnh co the c tai vao RAM (bang cach ghi no nh bo
nh d lieu) va thi hanh (bang cach truy xuat no nh bo nh chng trnh).
6/ Lenh Reset:
C8951 c reset bang cach gi chan RST mc cao t nhat trong hai
chu k may va tra no ve mc thap.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:123 1-2002

Mach reset he thong.
RST co the c kch bang tay dung mot nut bam hoac co the c kch
khi cap ien dung mot mach R-C.
Trang thai cua tat ca cac thanh ghi trong 8951 sau khi Reset he thong
c tom tat trong bang sau:

Thanh ghi Noi dung
em chng trnh 0000 H
Tch luy 00 H
B 00 H
PSW 00 H
SP 07 H
DPTR 0000 H
Port 0 3 FF H
IP XXX00000 B
IE 0XX00000 B
Cac thanh ghi nh thi 00 H
SCON 00 H
SBUF 00 H
PCON ( HMOS ) 0XXXXXXX B
PCON ( CMOS ) 0XXX0000 B

Quan trong nhat trong cac thanh ghi tren la thanh ghi em chng trnh,
no c at lai 0000H.
Khi RST tr lai mc thap, viec thi hanh chng trnh luon bat au a
ch au tien trong bo nh chng trnh: a ch 0000H.
Noi dung cua RAM tren chip khong b thay oi bi lenh Reset.
II/ TAP LENH CUA 8951 :
Tap lenh 8951 co 255 lenh gom 139 lenh 1 byte, 92 lenh 2 byte va 24 lenh
3 byte.
1/ Cac che o anh a ch:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:124 1-2002
a/ a ch thanh ghi:
C8951 co bon bank thanh ghi, moi bank co 8 thanh ghi anh so t R0
en R7. Tai moi thi iem ch co mot bank thanh ghi c tch cc.
Ma lenh n n n

a ch thanh ghi
Muon chon bank thanh ghi nao ta ch can gan cac bt nh phan thch hp
vao RS1 (PSW.4) va RS0 (PSW.3) trong thanh ghi trang thai chng trnh
(PSW).
Ngoai ra, mot so thanh ghi ac biet nh thanh ghi tch luy, thanh ghi con
tro d lieu cung c xac nh trong cac lenh tren nen khong can bit a
ch.
Trong cac lenh nay thanh ghi tch luy c k hieu la A, con tro d lieu
la DPTR, thanh ghi em chng trnh la PC, c nh la C, cap thanh
ghi tch luy la AB.
b/ a ch trc tiep:
Trong che o nay, cac thanh ghi ben trong 8951 c anh a ch trc
tiep bang 8 bits a ch nam trong byte th hai cua ma lenh.

Ma lenh a ch trc tiep

a ch trc tiep.

Du vay, trnh hp dch cho phep goi ten cac thanh ghi chc nang ac biet
(co a ch trc tiep t 80H en FFH).
V du, P0 cho Port 0, TMOD cho thanh ghi che o timer,
c/ a ch gian tiep:
R0 va R1 c dung e cha a ch tam o nh ma lenh tac ong en.
Ngi ta qui c dung dau @ trc R0 hoac R1.

Ma lenh i

GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:125 1-2002
a ch gian tiep.
d/ a ch tc thi:
Ngi ta dung dau # trc cac toan hang tc thi. Cac toan hang o co
the la mot hang so, mot k so hay mot bieu thc toan hoc Trnh hp dch
se t ong tnh toan va thay the d lieu vao ma lenh.

Ma lenh D lieu tc thi

a ch tc thi.


e/ a ch tng oi:
a ch tng oi c dung trong cac lenh nhay.
C8951 dung gia tr 8 bit co dau e cong them vao thanh ghi em chng
trnh (PC).
Tam nhay cua lenh nay trong khoang t 128 en 127 o nh. Trc khi
cong, thanh ghi PC se tang en a ch theo sau lenh nhay roi tnh toan a
ch offset can thiet e nhay en a ch yeu cau.
Nh vay, a ch mi la a ch tng oi so vi lenh ke tiep ch khong
phai ban than lenh nhay. Thng lenh nay co lien quan en nhan c
nh ngha trc.

Ma lenh Offset tng oi

a ch tng oi.
f/ a ch tuyet oi :
a ch tuyet oi ch dung trc cac lenh ACALL va AJIMP.
Cac lenh 2 byte nay dung e re nhanh vao mot trang 2Kbyte cua bo nh
chng trnh bang cach cap 11 bit a ch thap (A0-A10) e xac nh a ch
ch trong trang ma. Con 5 bit cao cua a ch ch chnh la 5 bit hien hanh
trong thanh ghi em chng trnh.
V vay, a ch cua lenh theo sau lenh re nhanh va a ch ch cua lenh re
nhanh can phai cung trang ma 2Kbyte (co cung 5 bits a ch cao).
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:126 1-2002

A15 A11 A10 A0



Xac nh trang ma. Xac nh a ch trong trang ma.


A10-A8 Ma lenh Offset tng oi

a ch tuyet oi.
g/ a ch dai :
a ch dai ch dung cho lenh LCALL va LJIMP. Cac lenh nay chiem 3
byte va dung 2 byte sau (byte 2 va byte 3) e nh a ch ch cua lenh (16
bit). u iem cua lenh nay la co the s dung trong toan bo vung nh 64
Kbyte.
Tuy nhien, lenh nay chiem nhieu byte va le thuoc vao v tr vung nh.

Ma lenh ` A15 - A8 A7 A0

a ch dai.
h/ a ch tham chieu:
a ch tham chieu dung mot thanh ghi c ban (hoac thanh ghi em
chng trnh PC hoac thanh ghi con tro d lieu DPTR) va a ch offset
(trong thanh ghi tch luy A) e tao a ch c tac ong cho cac lenh JMP
hoac MOVC.
Cac bang nhay va bang tm kiem de dang c tao ra e s dung a ch
tham chieu.
a ch c ban Offset
PC hoac DPTR + ACC = a ch can truy xuat

a ch tham chieu.
2/ Cac nhom lenh cua 8951:
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:127 1-2002
Tap lenh cua 8951 c chia lam 5 nhom:
So hoc
Luan l
Chuyen d lieu
Chuyen ieu khien
Cac ch dan thiet lap lenh:
Rn : Thanh ghi R0 en R7 cua bank thanh ghi c chon.
data : 8 bit a ch vung d lieu ben trong. No co the la vung RAM d lieu
trong (0-127) hoac cac thanh ghi chc nang ac biet.
@Ri : 8 bit vung RAM d lieu trong (0-255) c anh a ch gian tiep
qua
thanh ghi R0 hoac R1.
#data : Hang 8 bit cha trong cau lenh.
#data16 : Hang 16 bit cha trong cau lenh.
addr16 : 16 bit a ch ch c dung trong lenh LCALL va LJMP.
addr11 : 11 bit a ch ch c dung trong lenh ACALL va AJMP.
rel : Byte offset 8 bit co dau c dung trong lenh SJUMP va nhng
lenh
nhay co ieu kien.
bit : Bit c nh a ch trc tiep trong RAM d lieu noi hoac cac
thanh
ghi chc nang ac biet.
A/ Nhom lenh x l so hoc:
ADD A, Rn (1 byte, 1 chu k may) : Cong noi dung thanh ghi Rn vao
thanh
ghi A.
ADD A, data (2, 1) : Cong trc tiep 1 byte vao thanh ghi A.
AAD A, @Ri (1, 1) : Cong gian tiep noi dung RAM cha tai a ch
c
khai bao trong Ri vao thanh ghi A.
ADD A, #data (2, 1) : Cong d lieu tc thi vao A.
ADDC A, Rn (1, 1) : Cong thanh ghi va c nh vao A.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:128 1-2002
ADDC A, data (2, 1) : Cong trc tiep byte d lieu va c nh vao
A.
ADDC A, @Ri (1, 1) : Cong gian tiep noi dung RAM va c nh
vao A.
ADDC A, #data (2, 1) : Cong d lieu tc thi va c nh vao A.
SUBB A, Rn (1, 1) : Tr noi dung thanh ghi A cho noi dung thanh ghi
Rn va c nh.
SUBB A, data (2, 1) : Tr trc tiep A cho mot so va c nh.
SUBB A, @Ri (1, 1) : Tr gian tiep A cho mot so va
c nh.
SUBB A, #data (2, 1) : Tr noi dung A cho mot so tc
thi va c nh.
INC A (1, 1) : Tang noi dung thanh ghi A len 1.
INC Rn (1, 1) : Tang noi dung thanh ghi Rn len 1.
INC data (2, 1) : Tang d lieu trc tiep len 1.
INC @Ri (1, 1) : Tang gian tiep noi dung vung RAM
len 1.
DEC A (1, 1) : Giam noi dung thanh ghi A xuong 1.
DEC Rn (1, 1) : Giam noi dung thanh ghi Rn xuong
1.
DEC data (2, 1) : Giam d lieu trc tiep xuong 1.
DEC @Ri (1, 1) : Giam gian tiep noi dung vung RAM
xuong 1.
INC DPTR (1, 2) : Tang noi dung con tro d lieu
len 1.
MUL AB (1, 4) : Nhan noi dung thanh ghi A vi noi
dung thanh ghi B.
DIV AB (1, 4) : Chia noi dung thanh ghi A cho noi
dung thanh ghi B.
DA A (1,1) : Hieu chnh thap phan thanh ghi A.
b/ Nhom lenh luan l :
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:129 1-2002
ANL A, Rn (1, 1) : AND noi dung thanh ghi A vi
noi dung thanh ghi Rn.
ANL A, data (2, 1) : AND noi dung thanh ghi A vi
d lieu trc tiep.
ANL A, @Ri (1, 1) : AND noi dung thanh ghi A vi
d lieu gian tiep trong
RAM.
ANL A, #data (2, 1) : AND noi dung thanh ghi vi
d lieu tc thi.
ANL data, A (2, 1) : AND mot d lieu trc tiep vi
A.
ANL data, #data(3, 2) : AND mot d lieu trc tiep vi
d lieu tc thi.
ANL C, bit (2, 2) : AND c nh vi mot bit trc tiep.
ANL C, /bit (2, 2) : AND c nh vi bu cua mot
bit trc tiep.
ORL A, Rn (1, 1) : OR thanh ghi A vi thanh ghi
Rn.
ORL A, data (2, 1) : OR thanh ghi A vi mot d
lieu trc tiep.
ORL A, @Ri (1, 1) : OR thanh ghi A vi mot d
lieu gian tiep.
ORL A, #data (2, 1) : OR thanh ghi A vi mot d
lieu tc thi.
ORL data, A (2, 1) : OR mot d lieu trc tiep vi
thanh ghi A.
ORL data, #data(3, 2) : OR mot d lieu trc tiep vi
mot d lieu tc thi.
ORL C, bit (2, 2) : OR c nh vi mot bit trc tiep.
ORL C, /bit (2, 2) : OR c nh vi bu cua mot bit
trc tiep.
XRL A, Rn (1, 1) : XOR thanh ghi A vi thanh ghi
Rn.
XRL A, data (2, 1) : XOR thanh ghi A vi mot d
lieu trc tiep.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:130 1-2002
XRL A, @Ri (1, 1) : XOR thanh ghi A vi mot d
lieu gian tiep.
XRL A, #data (2, 1) : XOR thanh ghi A vi mot d
lieu tc thi.
XRL data, A (2, 1) : XOR mot d lieu trc tiep vi
thanh ghi A.
XRL data, #data(3, 2) : XOR mot d lieu trc tiep vi
mot d lieu tc thi.
SETB C (1, 1) : at c nh.
SETB bit (2, 1) : at mot bit trc tiep.
CLR A (1, 1) : Xoa thanh ghi A.
CLR C (1, 1) : Xoa c nh.
CPL A (1, 1) : Bu noi dung thanh ghi A.
CPL C (1, 1) : Bu c nh.
CPL bit (2, 1) : Bu mot bit trc tiep.
RL A (1, 1) : Quay trai noi dung thanh ghi A.
RLC A (1, 1) : Quay trai noi dung thanh ghi A qua
c nh.
RR A (1, 1) : Quay phai noi dung thanh ghi A.
RRC A (1, 1) : Quay phai noi dung thanh ghi A qua
c nh.
SWAP A (1, 1) : Quay trai noi dung thanh ghi A 1
nibble (1/2 byte).
c/ Nhom lenh chuyen d lieu:
MOV A, Rn (1, 1) : Chuyen noi dung thanh ghi Rn vao thanh ghi
A.
MOV A, data (2, 1) : Chuyen d lieu trc tiep vao thanh ghi A.
MOV A, @Ri (1, 1) : Chuyen d lieu gian tiep vao thanh ghi A.
MOV A, #data (2, 1) : Chuyen d lieu tc thi vao thanh ghi A.
MOV Rn, A (1, 1) : Chuyen noi dung thanh ghi A vao thanh ghi
Rn.
MOV Rn, data (2, 2) : Chuyen d lieu trc tiep vao thanh ghi Rn.
MOV Rn, #data (2, 1) : Chuyen d lieu tc thi vao thanh ghi Rn.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:131 1-2002
MOV data, A (2, 1) : Chuyen noi dung thanh ghi A vao mot d
lieu
trc tiep.
MOV data, Rn (2, 2) : Chuyen noi dung thanh ghi Rn vao mot d
lieu
trc tiep.
MOV data, data (3, 2) : Chuyen mot d lieu trc tiep vao mot d lieu
trc tiep.
MOV data, @Ri (2, 2) : Chuyen mot d lieu gian tiep vao mot d
lieu
trc tiep.
MOV data, #data (3, 2) : Chuyen mot d lieu tc thi vao mot
d lieu
trc tiep.
MOV @Ri, A (1, 1) : Chuyen noi dung thanh ghi A vao mot d
lieu
gian tiep.
MOV @Ri, data (2, 2) : Chuyen mot d lieu trc tiep vao mot d lieu
gian tiep.
MOV @Ri, #data (2, 1) : Chuyen mot d lieu tc thi vao mot
d lieu
gian tiep.
MOV DPTR, #data16 (3, 2): Chuyen mot hang 16 bit vao thanh ghi
con tro
d lieu.
MOV C, bit (2, 1) : Chuyen mot bit trc tiep vao c nh.
MOV bit, C (2, 2) : Chuyen c nh vao mot bit trc tiep.
MOVC A, @A+DPTR (1, 2) : Chuyen byte bo nh chng trnh co a ch
la
@A + DPTR vao thanh ghi A.
MOVC A, @A + PC(1, 2) : Chuyen byte bo nh chng trnh co
a ch la
@A + PC vao thanh ghi A.
MOVX A, @Ri (1, 2) : Chuyen d lieu ngoai (8 bit a ch) vao
thanh ghi A.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:132 1-2002
MOVX A, @DPTR (1, 2) : Chuyen d lieu ngoai (16 bit a ch)
vao thanh ghi A.
MOVX @Ri, A (1, 2) : Chuyen noi dung A ra d lieu ngoai (8 bit a
ch).
MOVX @DPTR, A (1, 2) : Chuyen noi dung A ra d lieu ngoai
(16 bit a ch).
PUSH data (2, 2) : Chuyen d lieu trc tiep vao ngan xep va
tang SP.
POP data (2, 2) : Lay d lieu trc tiep ra khoi ngan xep va
giam SP.
XCH A, Rn (1, 1) : Trao oi d lieu gia thanh ghi Rn va thanh
ghi A.
XCH A, data (2, 1) : Trao oi gia thanh ghi A va mot d lieu trc
tiep.
XCH A, @Ri (1, 1) : Trao oi gia thanh ghi A va mot d lieu
gian tiep.
XCHD A, @Ri (1, 1) : Trao oi gia nibble thap (LSN) cua
cua thanh ghi A va LSN cua d lieu gian
tiep.
d/ Nhom lenh chuyen quyen ieu khien :
ACALL addr11 (2, 2) : Goi chng trnh con dung a ch tuyet
oi.
LCALL addr16 (3, 2) : Goi chng trnh con dung a ch dai.
RET (1, 2) : Tr ve t lenh goi chng trnh con.
RETI (1, 2) : Tr ve t lenh goi ngat.
AJMP addr11 (2, 2) : Nhay tuyet oi.
LJMP addr16 (3, 2) : Nhay dai.
SJMP rel (2, 2) : Nhay ngan.
JMP @A + DPTR (1, 2) : Nhay gian tiep t con tro d lieu.
JZ rel (2, 2) : Nhay en A bang 0.
JNZ rel (2, 2) : Nhay en A khong bang 0.
JC rel (2, 2) : Nhay en c nh c at.
GVHD: TS HUYNH THU Luan Van Tot Nghiep
SVTH:Lng Ho Minh Hai MSSV:49700395 Trang:133 1-2002
JNC rel (2, 2) : Nhay neu c nh khong c at.
JB bit, rel (3, 2) : Nhay tng oi neu bit trc tiep c at.
JNB bit, rel (3, 2) : Nhay tng oi neu bit trc tiep khong c at.
JBC bit, rel (3, 2) : Nhay tng oi neu bit trc tiep c at,
roi xoa bit.
CJNE A, data, rel (3, 2) : So sanh d lieu trc tiep vi A va nhay
neu
khong bang.
CJNE A, #data, rel (3, 2) : So sanh d lieu tc thi vi A va nhay neu
khong bang.
CJNE Rn, #data, rel (3, 2) : So sanh d lieu tc thi vi noi dung
thanh
ghi Rn va nhay neu khong bang.
CJNE @Ri, #data, rel (3, 2) : So sanh d lieu tc thi vi d lieu
gian tiep
va nhay neu khong bang.
DJNZ Rn, rel (2, 2) : Giam thanh ghi Rn va nhay neu khong
bang.
DJNZ data, rel (3, 2) : Giam d lieu trc tiep va nhay neu khong bang.