You are on page 1of 62

o an tot nghiep

Gvhd: Nguyen Phng Quang

PHAN I: M AU
I. LI GII THIEU: Ngay nay, trc khi bc vao mot hieu sach, ban co the biet c hieu sach o ban cac loai sach g, co loai sach ma mnh can mua khong nh vao bang en quang bao rat bat mat at trc ca hieu. Hoac khi vao san bay ban biet c gi giac cac chuyen bay, cac thong bao ngan cua phi trng, cung nh vao quang bao. oi khi i ngoai ng thanh pho luc ve em, ban se thay c cac bang quang bao ln hn vi cac hnh anh c ong c nh li Coca Cola ang sui bot, cac logo san pham xuat hien dan dan theo nhieu kieu (tran t di len, t tren xuong, lan dan t trai qua phai, t phai qua trai, ) Nh vay quang bao ngay nay a c a vao s dung rat nhieu lnh vc khac nhau nh: gii thieu san pham, thong bao tin tc (thay cho cac ban tin bang giay) Vi ng dung rong rai nh vay, ta hay th tm hieu xem mot mach quang bao gom nhng g, nguyen ly hoat ong cua no ra sao, qua e tai Thiet ke va thi cong mach quang bao dung EPROM. II. GII HAN E TAI: Nh a gii thieu tren, quang bao co the hien th c cac hnh anh c ong ch khong goi gon trong viec hien th cac ch. Tuy nhien, do ieu kien co han nen e tai ch gii han viec hien th cac ch chay, chp tat vi mau cua ch c thay oi theo y cua ngi viet chng trnh.

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

PHAN II: GII THIEU VE MACH QUANG BAO VA CAC IC CO LIEN QUAN EN MACH
CHNG 1 : GII THIEU MACH QUANG BAO
Co nhieu cach e lam mot mach quang bao: dung IC ri, dung EPROM, dung vi x ly hoac dung may vi tnh e ieu khien mach. Neu dung IC ri th ta s dung cac IC giai a hp (Demultiplexer) ket hp vi cac Diode e lam thanh mach ROM (kieu ROM nay c goi la Made Home). Chng trnh cho loai ROM nay c tao ra bang cach sap xep v tr cac Diode trong ma tran, moi khi can thay oi chng trnh th phai thay oi lai v tr cac Diode nay (thay oi ve phan cng). Dung lng bo nh kieu nay thay oi theo kch thc mach, kch thc cang ln th dung lng cang ln (v khi tang dung lng th phai them IC giai a hp, them cac Diode nen kch thc cua mach tang len). Neu muon u bo nh e chay mot mach quang bao bnh thng th kch thc mach phai rat ln nen gia thanh se len cao, o phc tap tang len. Do o, dang ROM nay khong ap ng c yeu cau cua mach quang bao nay. Khi thay cac IC ri tren bang EPROM th kch thc mach va gia thanh se giam ang ke. Kch thc cua EPROM hau nh khong tang theo dung lng bo nh cua no. Ngoai ra, khi muon thay oi chng trnh hien th th ta ch viec viet chng trnh mi (thay oi ve phan mem) nap vao EPROM hoac thay EPROM cu bang mot EPROM mi co cha chng trnh can thay oi. Viec thay oi chng trnh kieu nay thc hien n gian hn rat nhieu so vi cach dung IC ri tren. ac biet, khi co yeu cau hien th hnh anh th viec s dung EPROM e ieu khien la hp ly nhat, no n gian hn nhieu so vi viec dung vi x ly hoac may vi tnh e ieu khien. ieu nay c giai thch nh sau: do vi x ly va may vi tnh muon giao tiep vi ben ngoai eu phai thong qua chng trnh va cac IC ngoai vi con EPROM th giao tiep trc tiep va khong can chng trnh ieu khien no. V phai dung chng trnh nen tn hieu ieu khien a ra ngoai tuan t, khong c lien tuc nh EPROM nen khi muon hien th hnh anh th se gap nhieu kho khan (do hien th hnh anh th can quet ca hang lan cot, va v tn hieu ieu khien xuat hien tuan t nen se kho ong bo gia quet hang va cot, t o se gay kho khan cho viec hien th hnh anh tren bang en). Khi vi x ly tham gia vao th mach quang bao se co c nhieu chc nang hn, tien li hn nhng cung at tien hn. Vi kit vi x ly ieu khien quang bao ta co the thay oi chng trnh hien th mot cach de dang bang cach nhap chng trnh mi

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

vao RAM (thay oi chng trnh ngay tren kit, khong can phai thao IC nh ra em nap chng trnh nh EPROM). Do vi x ly co nhieu chc nang nen viec oi mau cho bang en cung c thc hien mot cach de dang. Tuy nhien, khi s dung vi x ly e lam mach quang bao th gia thanh cua mach lai tang len nhieu so vi khi s dung EPROM v kit vi x ly can phai co EPROM lu chng trnh ieu khien cho vi x ly, cac IC ngoai vi (giao tiep ban phm, hien th,), cac RAM e nh chng trnh, cac phm nhap d lieu (do co phm nen kch thc mach tang len nhieu) Ngoai ra, do vi x ly phai gi d lieu ra IC ngoai vi (thng la 8255A) roi mi ieu khien viec hien th tren bang en nen khi can hien th hnh anh th cach dung vi x ly se phc tap hn nhieu so vi khi dung EPROM (nh a giai thch tren). Ngoai ra, mach quang bao con co the c ieu khien bang may vi tnh. Tuy nhien, khi dung may tnh e ieu khien quang bao th rat at tien, chiem dien tch ln ma chat lng hien th cung khong hn so vi khi dung EPROM. Qua cac phng an c neu ra tren th cach s dung EPROM c chon v ap ng c yeu cau cua mot mach quang bao bnh thng, gia thanh lai re hn va mach ien n gian hn so vi khi dung kit vi x ly hoac dung may vi tnh, viec thay oi chng trnh cung de dang hn nhieu so vi viec can thiep vao phan cng nh cach dung cac IC ri. Di ay la s o khoi cua mot mach quang bao dung EPROM vi mau cua ch thay oi c tuy theo chng trnh nap vao EPROM.

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

S O KHOI MACH QUANG BAO DUNG EPROM


DAO ONG TAO A CH GIAI MA HIEN TH (EPROM) EM NGO RA (HANG) THUC CONG SUAT (HANG) BANG EN (MA TRAN LED)

IEU KHIEN MAU THUC CONG SUAT COT (I) THUC CONG SUATCOT (II)

GIAI MA A CH

CHOT D LIEU (I)

EM NGO RA COT (I)

CHOT D LIEU (II)

EM NGO RA COT (II)

NGUON

Svth: Vng Kien Hng

o an tot nghiep
* CHC NANG CAC KHOI -

Gvhd: Nguyen Phng Quang

Dao ong tao a ch: tao ra xung vuong a vao bo em e tao a ch cho bo giai ma hien th (EPROM) ong thi a cac xung ieu khien en bo giai ma a ch. Giai ma a ch: nhan xung ieu khien t bo dao ong tao a ch, t o a ra tn hieu cho phep cot LED nao tren bang en (ma tran LED) c phep sang. Tai moi thi iem ch a ra mot xung cho phep duy nhat va ch co mot cot LED tng ng vi v tr xung o c phep sang. Tn hieu cho phep nay c a en hai bo chot d lieu. Cac bo chot d lieu (I), (II): nhan d lieu ngo vao t bo giai ma a ch, nhan tn hieu cho phep t bo giai ma mau. Hai bo chot nay co ngo vao ieu khien ao nhau nen tai moi thi iem ch co mot bo chot c phep xuat d lieu. Quy nh: bo chot (I) ng vi cac cot LED xanh, bo chot (II) ng vi cac cot LED o. Cac bo em ngo ra (cot, hang): cach li tai va cac mach trc no. Bo em cung co tac dung lam tang dong ien ngo ra. Cac bo thuc cong suat (cot, hang): khuech ai dong ien, bao am cung cap u dong ien cho cac mach pha sau no va khong lam qua dong cua cac mach pha trc no. Giai ma hien th (EPROM): nhan a ch t bo dao ong tao a ch, a d lieu ra e hien th tren bang en ong thi a tn hieu ieu khien en bo ieu khien mau. Bo ieu khien mau: nhan tn hieu t EPROM va t o a ra tn hieu cho phep bo chot nao lam viec, bo chot nao ngng lam viec. Bang en (ma tran LED): nhan ong thi hai tn hieu t cac bo thuc hang va cot e t o cho phep LED nao tren bang c phep sang, LED nao khong c phep sang. Khoi nguon: bao am cung cap u dong cho toan bo mach nhng ban than no khong b qua dong.

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 2 : GII THIEU CAC IC SO LIEN QUAN EN MACH IEN


I. IC 4060: IC 4060 la mot bo em/bo chia (Counter/Divider) nh phan khong ong bo vi 14 tang Flip-Flop. Mach dao ong cua no gom 3 chan c noi ra ngoai la: RS, RTC, CTC; tat ca cac ngo ra (10 ngo ra t O3~O9, O11~O13) eu c em san t ben trong trc khi a ra ngoai. Quan trong hn het la chan Master Reset (MR) dung e cam mach dao ong lam viec va reset mach em. Khi chan MR mc logic cao, no se reset mach em lam tat ca cac ngo ra cua bo em eu mc logic thap, viec reset nay hoan toan oc lap vi cac ngo vao khac (bat chap trang thai logic cac ngo vao con lai). IC 4060 co s o chan va s o chc nang nh sau: 10 RTC 11 RS 12 MR CP CD 9 CTC

14 STAGE BINARY COUNTER


O3 O4 O5 O6 O7 O8 O9 O11 O12 O13 2 3

7 5 4 6 14 13 15 1 S O CHC NANG CUA IC 4060 16 15 14 13 12 11 10 9 VDD O9 O7 O8 MR RS RTC C TC

4060
O11 O12 O13 O5 O4 O6 O3 VSS 1 2 3 4 5 6 7 8 S O CHAN IC 4060

Chc nang cac chan nh sau: VDD, VSS: cung cap nguon cho IC ( mach nay VDD c noi en +5V, VSS noi en 0V). MR: master reset, dung khoa mach dao ong ben trong IC va reset cac bo em. Khi chan nay tac ong th tat ca cac ngo ra cua IC eu b keo ve mc logic thap. RS: clock input/oscillator pin, chan nay co hai chc nang: khi dung mach dao ong t ben ngoai IC th no co nhiem vu nhan xung, khi dung mach dao ong ben trong IC th no la mot thanh phan cua mach dao ong (ket hp vi cac chan RTC, CTC).

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

RTC: oscillator pin, chan tao dao ong (ket hp vi cac chan khac). Khi dung mach dao ong R-C th mot au ien tr c noi vi chan nay. CTC: external capacitor connection, chan tao dao ong (ket hp vi cac chan khac). Khi IC 4060 dao ong vi mach R-C (dung dao ong ben trong IC) th chan nay c noi vi mot au cua tu ien. O3 - O9, O11 - O13: counter outputs, cac ngo ra cua IC. Cac ngo ra nay khong lien tuc ma b nhay cap hai lan: ngo ra au tien cua no la O3 ch khong phai O0 (nhay bo 3 tang Flip-Flop au tien, khong a cac tang nay ra ngoai), ngo ra t O9 roi en O11 (khong co chan O10 ). S o mo ta hoat ong ben trong cua 4060 c ve nh sau:

RS

FF1
CP O

FF4

FF10

FF12

FF14

CD

MR

O3

O9

O11

O13

Do xung Ck khi lay ra ngo ra au tien (O3) cua IC 4060 th a c chia qua 3 tang Flip-Flop mot cach t ong nen gian o thi gian ay ch ve bat au khi co xung Ck th 3 tac ong vao IC. Gian o thi gian cua IC 4060 nh sau: Ck MR O3 O4

O12 O13

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

Cau truc cac phan t trong mach dao ong cua 4060 cho phep thiet ke mach dao ong hoac lam viec vi tu-ien tr (mach dao ong R-C) hoac lam viec vi thach anh. Ngoai ra, ta cung co the thay the mach dao ong ben trong bang mot tn hieu xung ong ho t ben ngoai a vao chan RS, khi dung xung Ck t ben ngoai th bo em se hoat ong khi co canh xuong cua xung tac ong. * Mach dao ong cua 4060 khi dung tu-ien tr c rap nh sau:
M R \

1
C R

2
R t

3 V
C t

R t i < < R R . C < < R

t . C

Giai thch nguyen ly hoat ong: ay la loai mach dao ong cua CMOS. Mach ch dao ong c khi chan MR mc cao (ch ung vi hnh ve nay, cac hnh tren th chan MR tac ong mc cao). Neu chan MR mc thap th ngo ra cua cong NAND se b khoa chet mc logic [1] nen mach khong dao ong c. Khi chan MR mc logic [1] th cong NAND se hoat ong nh mot cong NOT. Ta nhan thay trang thai logic tai iem 2 va 3 luon luon ngc nhau (ngo vao va ra cua cong NOT). Tan so dao ong cua mach nay phu thuoc vao tr so cua tu va ien tr. Bay gi, gia s ngo vao 1 mc logic [0] th ngo ra 2 cua cong NAND (ong thi la ngo vao cua cong NOT) mc logic [1], ngo ra 3 cua cong NOT se mc logic [0]. Luc nay tu Ct se nap ien qua Rt theo ng nh sau: dong ien t cc dng cua nguon ngo ra cong NAND Rt Ct vao cong NOT cc am cua nguon. Khi tu Ct nap en gia tr > VT mot chut (VT : ien the ma tai o trang thai logic chuyen t thap len cao) th ngo vao cua cong NAND se chuyen len mc logic [1], ngo ra cua no se thanh mc logic [0] va lam cho ngo ra cua cong NOT tr thanh mc logic [1]. Do co s thay oi mc logic tai hai iem 2 va 3 nen tu Ct se xa ien (cung qua ien tr Rt). Khi Ct xa th ien the tai ngo vao cong NAND (V1) giam dan, khi V1 giam en gia tr < VT mot chut th ngo ra cong NAND se chuyen len trang thai logic [1] va ngo ra cong NOT se ve lai mc logic [0]. Luc nay trang thai logic tai cac iem 1, 2, 3 lai tr ve trang thai ban au va tu Ct lai tiep tuc nap ien, bat au lai qua trnh nap-xa ke tiep. Va c nh the tiep tuc mai mai, ta se co c mach dao ong tao xung vuong vi tan so phu thuoc gia tr Rt, Ct va c tnh theo cong thc sau:

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

1 f= Rt.Ct 2,3. vi : Ct 100pF 10K Rt 1M * Mach dao ong 4060 dung thach anh c rap nh sau:

Mach nay co tan so dao ong la tan so rieng cua thach anh, ien tr R2 dung gii han dong ien qua IC. Tu bien dung C1 dung loc bt tan so cong hng hng cua thach anh (do thach anh va co dao ong cong hng noi tiep, va co cong hng song song) II.IC 4040: IC 4040 la bo em nh phan khong ong bo gom 12 tang Flip-Flop, ca 12 ngo ra nay (O0~O11) eu a c em trc khi a ra ngoai. Chan MR (Master Reset) tac ong mc cao, khi MR tac ong th toan bo cac ngo ra cua IC b keo xuong mc thap bat chap trang thai cua chan CP luc o. IC 4040 thng c dung lam bo chia tan so, c s dung trong cac mach lam tre hoac e ieu khien s hoat ong cua cac bo em khac. IC 4040 co s o chan va s o cau tao ben trong nh sau: 10 CP\ T 11 MR

12 STAGE COUNTER
CD O0 O1 O2 O3 O4 O5 O6 O7 O8 O9 O10 O11 9 7 6 5 3 2 4 13 12 14 15 1 S 16 15 14 13 12 11 10 4040 O NOI BO CUA IC 9 VDD O10 O9 O7 O8 MR CP\ O0

Svth: Vng Kien Hng


1 2 3

4040
8 4 5 6 7

O11 O5 O4 O6 O3 O2 O1 VSS

o an tot nghiep

Gvhd: Nguyen Phng Quang

S O CHAN IC 4040 Chc nang cac chan cua IC 4060 nh sau: VDD, VSS: hai chan cap nguon cua IC. VDD noi vi nguon dng, VSS noi vi nguon am. mach nay VDD c noi en +5V, VSS c noi vi mass (0V). CP: clock input, chan nhan xung cua IC. e IC hoat ong c th phai co xung a vao no (v bo em thc chat la cac bo chia tan so nen bat buoc phai co tan so ngo vao mi lay c tan so can chia ngo ra). IC 4040 hoat ong vi canh xuong cua xung tac ong: khi xung a vao IC chuyen t trang thai logic cao ve trang thai logic thap th bo em se em len mot xung (hoac tan so ngo ra c chia oi them mot lan na). MR: master reset input, chan nay dung e reset IC, tac ong mc cao. Khi chan MR c a len mc logic cao th IC 4040 b reset lam toan bo cac ngo ra cua no b keo xuong mc logic thap. O0 ~ O11: parallel outputs, cac ngo ra song song cua IC. Khong nh IC 4060, cac ngo ra cua IC 4040 c lay ra mot cach lien tuc (khong nhay cap), ieu nay se tao ieu kien thuan li cho ngi thiet ke mach khi s dung no. IC 4040 co s o mo ta hoat ong ben trong nh sau:
O FF1 CP O CD FF2 FF12

CP MR Ck MR

O0

O1

O11

S O MO TA HOAT ONG BEN TRONG CUA IC 4040 IC 4040 co gian o thi gian nh sau: O0 O1

Svth: Vng Kien Hng


O10 O11

10

o an tot nghiep

Gvhd: Nguyen Phng Quang

III. IC 74164: * Gii thieu IC 74164: IC 74164 la mot thanh ghi dch 8 bit vao noi tiep-ra song song (Serial-in Parallel-out), lam viec c tan so cao nh s dung Diode Schottky ben trong. D lieu noi tiep c nhap vao thong qua cong AND 2 ngo vao, viec nhap nay ong bo vi canh len xung Ck. Chan Clear (Clr) tac ong khong ong bo vi xung Ck, khi chan nay tac ong th thanh ghi dch se b xoa, tat ca cac ngo ra cua no se b keo xuong mc thap. Ve mat giao tiep vi cac IC khac th IC 74164 c che tao e tng thch hoan toan vi cac IC thuoc ho TTL (cua hang Motorola). IC 74164 co s o chan, s o noi bo nh sau: 14 13 12 11 10 9 8 VCC QH QG QF QE Clr Clk

74164
A 1 B 2 QA QB QC QD GND 3 4 5 6 7

S O CHAN IC 74164 Chc nang cac chan cua IC 74164 nh sau: VCC, GND: dung cap nguon cho IC hoat ong. VCC c noi en cc dng cua nguon (+5V do la IC ho TTL), GND c noi en cc am cua nguon (0V). oi vi cac IC so thuoc ho TTL th oi hoi phai co nguon cung cap chnh xac (5V 5%). A, B: ngo vao d lieu noi tiep cua IC 74164, ay la hai ngo vao cua mot cong AND 2 ngo vao. D lieu muon en c Flip-Flop au tien e bat au qua trnh ghi dch th phai qua cong AND 2 ngo vao nay.

Svth: Vng Kien Hng

11

o an tot nghiep

Gvhd: Nguyen Phng Quang

Clk: chan nhan xung clock (tac ong canh len). D lieu hai ngo vao A, B c a en ngo ra (ong thi d lieu cac ngo ra con lai dch phai mot bit) ong bo vi xung a vao chan nay. ieu nay co ngha la IC se thc hien viec ghi dch moi khi co canh len xung clock tac ong. Clr: chan reset IC, chan nay tac ong mc thap. Khi chan Clr mc logic cao th IC c phep hoat ong bnh thng (ghi dch), nhng khi chan nay c a xuong mc logic thap th IC b reset ngay lap tc: tat ca cac ngo ra cua no eu b keo xuong mc logic thap. Viec reset nay khong ong bo vi xung clock a vao IC, ngha la bat ky trang thai nao cua xung clock (du ang mc logic cao hay thap hoac ang chuyen trang thai) ta eu thc hien c viec reset IC bang cach ha chan Clr nay xuong mc thap. QA ~ QH : cac ngo ra song song cua IC. Cac ngo nay co the c lay ra cung luc hoac tng ngo tuy vao yeu cau cua ngi s dung. S o noi bo cua IC 74164 nh sau: A B D CD Clk Clr QA QB QH Q D CD Q D CD Q

S O MO TA HOAT ONG BEN TRONG CUA IC 74164 IC 74164 co bang cac trang thai hoat ong nh sau: OPERATING MODE Reset (Clear) Shift INPUTS Clr L H H H H l l h h l A B x x l QA L L L L H OUTPUTS QB QH LL qA - qG qA - qG qA - qG qA - qG 12

Svth: Vng Kien Hng

o an tot nghiep
h h L (l): LOW Voltage Levels. H(h): HIGH Voltage Levels. x: Dont Care.

Gvhd: Nguyen Phng Quang

qn: bieu th cho trang thai logic tai ngo ra th n cua IC (n: A ~ H). * Nguyen tac hoat ong cua IC 74164: Nguyen tac hoat ong cua IC c giai thch nh sau: khi co canh len xung Ck au tien tac ong vao chan Clk th d lieu ngo vao (A, B) se c dch en ngo ra au tien QA, trang thai logic cua tat ca cac ngo ra khac khong thay oi. Khi xung Ck th hai tac ong th d lieu t ngo ra au tien QA se dch en ngo ra th hai QB, d lieu t ngo vao c dch en ngo ra au tien, trang thai logic cua tat ca cac ngo ra con lai khong oi. C tng t nh the cho en khi xung th 8 tac ong th d lieu au tien a c dch en ngo ra cuoi cung QH. D lieu ngo vao dch en ngo ra QA, d lieu t QA dch sang QB, Nh vay d lieu a vao noi tiep a c lay ra song song ca 8 ngo ra sau 8 xung Ck tac ong. Khi co xung th 9 tac ong th d lieu t ngo vao se c chuyen en ngo ra au tien, trang thai logic cac ngo ra khac se c dch phai mot bit (nh hnh ve), trang thai logic ngo ra cuoi cung se t ong bien mat. IV. IC 74138: * Gii thieu IC 74138: IC 74138 la loai IC dung giai ma/giai a hp (Decoder/Demultiplexer) lam viec c vi tan so cao, no ac biet thch hp khi dung lam bo giai ma a ch tac ong vao chan chon IC (Chip Select) cua cac IC nh lng cc. IC 74138 co s o chan nh sau:

14 16 15 12 11 10 9 VCC O0\ O1\ 13 2\ O3\ O4\ O5\ O6\ O A0 A1 A2 E1\ E2\ E3 O7\GND 1 2 3 4 5 6 7 8 S O CHAN IC 74138 Chc nang cac chan cua IC 74138:

74138

Svth: Vng Kien Hng

13

o an tot nghiep

Gvhd: Nguyen Phng Quang

VCC, GND: dung cap nguon cho IC hoat ong. VCC c noi en cc dng cua nguon (+5V do la IC ho TTL), GND c noi en cc am cua nguon (0V). A0, A1, A2: cac ngo vao chon trang thai ngo ra (co the coi nh ay la cac ng a ch cua IC 74138). To hp trang thai logic cua 3 ngo vao nay ta se c 8 trang thai logic khac nhau 8 ngo ra cua IC (23 = 8). E1, E2, E3: 3 ngo vao ieu khien IC. IC ch c phep hoat ong bnh thng khi ca 3 chan nay eu mc logic cho phep IC hoat ong (cu the la E1, E2 mc logic thap, E3 mc logic cao). Ch can 1 trong 3 chan nay mc logic khong phu hp th IC se b cam ngay lap tc (tat ca cac ngo ra eu mc logic cao) bat chap trang thai cac ngo vao con lai. O0 O7: cac ngo ra cua IC. Tuy thuoc vao trang thai cua cac ng a ch ma ta co trang thai ngo ra tng ng. Khi IC ang hoat ong bnh thng (ca 3 chan ieu khien eu mc logic cho phep) th tai mot thi iem nhat nh ch co mot ngo ra duy nhat c mc logic thap, tat ca cac ngo con lai eu phai mc logic cao.

IC 74138 co s o mo ta hoat ong ben trong nh sau: A2 A1 A0 E1\ E2\ E3

Bang trang thai cuaO 74138: IC O7 O6 O5 O3 4 INPUTS

O2

O1

O0

OUTPUTS 14

Svth: Vng Kien Hng

o an tot nghiep
E1 \ H X X L L L L L L L L E2 \ x H x L L L L L L L L E3 X x L H H H H H H H H A0 x x x L H L H L H L H A1 x x x L L H H L L H H A2 x x x L L L L H H H H O0\ H H H L H H H H H H H O1\ H H H H L H H H H H H

Gvhd: Nguyen Phng Quang


O2\ H H H H H L H H H H H O3\ H H H H H H L H H H H O4\ H H H H H H H L H H H O5\ H H H H H H H H L H H O6\ H H H H H H H H H L H O7\ H H H H H H H H H H L

H: HIGH Voltage Level. L: LOW Voltage Level. x: Dont care. * Nguyen tac hoat ong cua IC 74138: Da vao bang trang thai ta thay: ch can 1 trong 3 chan cho phep (E1, E2, E3) trang thai cam (khong cho phep IC hoat ong) th tat ca cac ngo ra cua IC 74138 eu mc logic cao bat chap trang thai logic cua cac chan a ch (A0, A1, A2). Chang han nh khi chan E1 mc logic cao th tat ca cac ngo ra cua IC eu mc logic cao, bat chap trang thai cua cac chan con lai nh: E2, E3, A0, A1, A2. Ta nhan thay khi ca 3 ng a ch eu mc logic thap 00h (vi ieu kien la cac ngo vao ieu khien eu phai mc logic thch hp e IC hoat ong) th ch co duy nhat mot ngo ra au tien la mc logic thap, tat ca cac ngo ra con lai eu mc logic cao. Khi a ch a vao IC tang len mot (01h) th mc logic thap nay c chuyen en ngo ra th hai va cung ch co duy nhat ngo ra nay mc logic thap. Khi a ch a vao IC la 08h th mc logic thap se ngo ra cuoi cung (O7). Nh vay, mc logic thap ngo ra se di chuyen tng ng vi a ch a vao IC. V. IC 74373: * Gii thieu IC 74373:

Svth: Vng Kien Hng

15

o an tot nghiep

Gvhd: Nguyen Phng Quang

IC 74373 gom 8 mach chot la cac Flip-Flop cung vi 8 bo em ngo ra 3 trang thai. IC nay co hai chan ieu khien: mot chan cho phep nhap d lieu vao IC, chan con lai quyet nh viec xuat d lieu cua IC, ca hai chan nay lam viec oc lap vi nhau. Trang thai logic ngo vao va ngo ra cua IC khong ao nhau. IC 74373 co s o chan nh sau:

20 19 18 17 16 15 14 13 12 11 VCC O8 D8 D7 O7 O6 D6 D5 O5 LE OE\ O1 D1 D2 O2 O3 D3 D4 O4 GND 1 2 3 4 5 6 7 8 9 10 S O CHAN IC 74373 Chc nang cac chan cua IC nh sau: VCC, GND: tng t nh cac IC tren, hai chan nay cung dung e cap nguon nuoi cho IC, VCC cung noi vi +5V, GND c noi mass. LE: latch enable, chan cho phep chot d lieu. Khi chan nay mc logic cao th d lieu mi c phep nhap vao IC, khi no mc logic thap th d lieu mi khong c phep nhap vao va d lieu cu (a c a vao trc o) van con ngo ra cua no. OE: output enable, chan cho phep xuat d lieu. Khi chan nay mc logic thap th d lieu ngo ra cua Flip-Flop (ben trong IC) c a ra ngoai. Ngc lai, khi chan nay mc logic cao th d lieu khong c phep a ra ngoai va tat ca ca ngo ra eu trang thai tong tr cao. D1 D8: data inputs, cac ngo vao cua IC. D lieu c a vao IC thong qua cac ngo nay. O1 O8: outputs, cac ngo ra tng ng vi cac ngo vao tren. Cu the la ngo ra O1 tng ng vi ngo vao D1, O2 tng ng vi D2, O8 tng ng vi D8. D2 IC 74373 co s D1 noi bo nh sau: o D
LATCH ENABLE LE

74373

D8 D O G O

D G O G

OUTPUT ENABLE

OE Svth: Vng Kien Hng

O1

O2

16 O8

S O MO TA HOAT ONG BEN TRONG CUA IC 74373

o an tot nghiep

Gvhd: Nguyen Phng Quang

Bang cac trang thai hoat ong cua IC 74373: OUTPUT ENABLE (OE) L L L H H: HIGH Voltage Level. L: LOW Voltage Level. Z: High Impedence (tong tr cao). X: Immaterial (khong quan trong). Dn: ngo vao th n cua IC. On: ngo ra th n (tng ng ngo vao th n) . * Nguyen tac hoat ong cua IC 74373: Da vao bang trang thai ta nhan thay d lieu mi ch c phep truyen qua IC khi ca hai chan ieu khien (LE va OE) mc logic thch hp: LE mc logic cao, OE mc logic thap. Khi ca hai chan ieu khien trang thai nay th d lieu ngo vao se c a vao ben trong IC (truyen qua cac Flip-Flop) va a thang ra ngoai thong qua cac cong em ngo ra 3 trang thai. Khi chan OE mc logic thap (cho phep) ma chan LE cung mc logic thap (cam) th d lieu ngo ra cua IC la d lieu cu (va mi c truyen qua IC). Luc nay d lieu mi ngo vao se khong c phep nhap vao IC. Ngc lai, khi chan OE mc logic cao th ngo ra cua IC se trang thai tong tr cao, bat chap trang thai logic cua cac ngo vao con lai. Mac du ngo ra trang thai tong tr cao nhng d lieu ngo vao (neu co) van c phep a vao IC (a en ngo ra cua cac Flip-Flop ben trong IC). D lieu nay se c phep truyen en ngo ra khi chan OE ve lai mc logic thap. LATCH ENABLE (LE) H H L X H L X X H L Q0 Z

Dn

On

Svth: Vng Kien Hng

17

o an tot nghiep

Gvhd: Nguyen Phng Quang

Khi ca hai chan ieu khien eu trang thai cam (chan OE mc logic cao, chan LE mc logic thap) th ngo ra se trang thai tong tr cao va ngo vao se khong c phep nhap d lieu mi vao. Nh vay, trang thai nay th IC hoan toan khong giao tiep vi bat ky linh kien nao khac ca ngo vao va ngo ra. VI. IC 74573: IC 74573 cung la mot bo chot d lieu 8 bit giong nh IC 74373. No cung co hai chan ieu khien viec chot va xuat d lieu, mc logic cho phep cua cac chan ieu khien nay cung giong nh IC 74373. Ngoai ra, IC 74573 con co chc nang cac chan, bang trang thai, nguyen ly hoat ong eu giong vi IC 74373, ch co s o chan la khac. Viec thiet ke cac IC nh vay nham ap ng c cac nhu cau rat a dang cua ngi tieu dung, giup viec s dung cac IC c linh hoat hn trong nhieu ng dung khac nhau. IC 74573 co s o chan nh sau: 20 19 18 17 16 15 14 13 12 11 VCC O1 O2 O3 O4 O5 O6 O7 O8 LE

74573
OE\ D1 D2 D3 D4 D5 D6 D7 D8 GND 1 2 3 4 5 6 7 8 9 10 S O CHAN IC 74573

VII. IC 74241: * Gii thieu ve IC 74241: IC 74241 gom 8 bo em/thuc d lieu ben trong vi ngo ra 3 trang thai. Cac ng nay c chia lam hai nhom, moi nhom co mot chan ieu khien rieng. Hai nhom nay lam viec oc lap vi nhau, cac chan ieu khien cung khong gay anh hng g en nhau. Noi ro hn la khi mot nhom co chan ieu khien ang trang thai cho phep truyen d lieu, nhom con lai co chan ieu khien trang thai cam (khong cho phep truyen d lieu) th ch co nhom th hai la khong c phep truyen d lieu, con nhom th nhat c phep truyen t do. Hai chan ieu khien nay co trang thai logic luc cho phep ao nhau nen khi hai chan co cung trang thai logic th ch co duy nhat mot nhom la c phep truyen d lieu, nhom con lai se co ngo ra tong tr cao. 20 19 18 17 16 15 14 13 12 11 IC 74241 co s o chan nh sau: VCC 2G 1Y1 2A4 1Y2 2A31Y3 2A2 1Y4 2A1

Svth: Vng Kien Hng


1 2 3

74241
4 5 6 7 8 9 10

18

1G 1A1 2Y4 1A2 2Y3 1A3 2Y2 1A4 2Y1 GND

o an tot nghiep

Gvhd: Nguyen Phng Quang

S O CHAN IC 74241 Chc nang cac chan: VCC, GND: ay la hai chan cap nguon cho IC. VCC noi en +5V, GND noi vi mass (0V). Do la IC so thuoc ho TTL nen nguon cung cap can phai co o on nh tot th IC mi lam viec tot c (VCC 5%). 1G: chan ieu khien cua nhom 1. Nh a gii thieu tren th IC nay c chia lam hai nhom, ay la mot nhom cua no. Chan nay se cho phep cac phan t trong nhom cua no (nhom 1) c phep hay khong c phep truyen d lieu. No tac ong mc logic thap, co ngha la khi chan nay mc logic thap th d lieu mi c phep truyen qua, ngc lai khi no mc logic cao th d lieu khong c phep truyen qua va ngo ra se trang thai tong tr cao. 2G: chan ieu khien cua nhom 2. Cung tng t nh chan 1G, chan nay ieu khien viec truyen d lieu cua cac phan t thuoc nhom 2. Mc logic cho phep truyen d lieu cua chan nay khac vi chan tren, no tac ong mc logic cao: d lieu ch c phep truyen qua khi no mc logic cao, ngo ra se trang thai tong tr cao khi no mc logic thap. 1A1 1A4: cac ngo vao cua nhom 1. 2A1 2A4: cac ngo vao cua nhom 2. 1Y1 1Y4: cac ngo ra cua nhom 1. 2Y1 2Y4: cac ngo ra cua nhom 2. IC 74241 co s o noi bo nh sau: 1A1 2A1 1A2 2A2 1A3 2A3 1A4 2A4

1G 2G 1Y1 2Y1 1Y2 2Y2 1Y3 2Y3 1Y4 2Y4

S O MO TA Svth: Vng Kien HngHOAT ONG BEN TRONG CUA IC 74241 19

o an tot nghiep

Gvhd: Nguyen Phng Quang

Bang cac trang thai hoat ong cua IC 74241: INPUTS 1G L L H D L H X L H Z OUTPUTS 2G H H L INPUTS D L H X L H Z OUTPUTS

H: HIGH Voltage Level. L: LOW Voltage Level. X: Immaterial. Z: HIGH Impedence. * Nguyen tac hoat ong cua IC 74241: Da vao bang cac trang thai hoat ong cua IC ta nhan thay trang thai hoat ong cua no c chia lam hai nhom rieng biet, moi nhom c ieu khien bi mot chan ieu khien cua rieng no. Do hai chan ieu khien co trang thai logic khi cho phep la ao nhau nen ay ch xet nguyen tac hoat ong cua mot nhom, cach hoat ong cua nhom con lai cung c giai thch tng t. Xet nguyen tac hoat ong cua nhom 1, nhom nay c ieu khien bi chan 1G. Chan ieu khien cua nhom nay tac ong mc logic thap, ngha la d lieu ch c phep truyen qua khi no ang mc logic thap. Khi chan ieu khien mc logic cao th no se lam cho ca 4 ngo ra cua nhom 1 trang thai tong tr cao, bat chap trang thai logic cac ngo vao. VIII. IC 7404: 7404 la loai IC cong thuoc ho TTL, ben trong no gom 6 cong ao. Khi so lng cong c s dung t hn 6 th cac cong khong s dung ta nen noi no len +VCC hay noi xuong mass qua mot ien tr khoang vai tram en 1K e cac cong khong s dung nay khong gay nhieu en qua trnh lam viec cua cac cong khac. IC 7404 can nguon13 12chuan10 ( 10%). 14 nuoi 11 5V 9 8 IC 7404 co s o chan nh sau: VCC

Svth: Vng Kien Hng


1 2 3

7404
GND 4 5 6 7

20

o an tot nghiep

Gvhd: Nguyen Phng Quang

S O CHAN IC 7404 e viec s dung IC c tot hn th ta nen xem bang cac thong so cua IC 7404 do nha san xuat cung cap. KY HIEU VCC TA IOH IOL THAP NHAT 4.5 0 IEN HNH 5.0 25 CAO NHAT 5.5 70 -1.0 20 N V O V
o

mA mA

Giai thch cac ch viet tat bang tren VCC: nguon cung cap cho IC. TA: gii han nhiet o cua moi trng lam viec cho IC (IC con hoat ong c khi nhiet o moi trng lam viec con trong gii han cho phep, cu the la t 0oC 70oC). IOH: dong ngo ra cua IC khi ngo ra mc logic cao. Khi ngo ra cua IC mc logic cao th co dong ien t IC o ra e cung cap cho tai, dong nay co gia tr thap. IOL: dong ngo ra cua IC khi ngo ra mc logic thap. Khi ngo ra cua IC mc logic thap th co dong ien t ngoai o vao IC (t tai hoac +VCC en ngo vao IC roi xuong mass), dong nay co gia tr cao.

Svth: Vng Kien Hng

21

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 3: GII THIEU VE EPROM


I. GII THIEU TONG QUAT VE CAC IC NH: EPROM la mot loai trong ho cac IC nh. No co the lap trnh c va xoa c rat nhieu lan. Trc khi biet cach s dung EPROM th ta cung nen xem qua mot chut ve y ngha cua ten goi cung nh qua trnh phat trien cua no. Bo nh ban dan c che tao au tien co ten goi la ROM (ROM: Read Only Memory co ngha la bo nh ch oc). Vi ROM, ta ch co the oc d lieu ra ch khong the viet d lieu mi vao no bat c khi nao ta muon. ROM co cach truy xuat d lieu nh sau: CAC NGO VAO IEU KHIEN

MA SO VAO

ROM

MA SO RA ROM nhan ma so vao (cac ng a ch) va cho ma so ra tng ng (d lieu can truy xuat) khi c cac ngo vao ieu khien cho phep. Do khong the ghi d kien mi vao nen ROM ch c san xuat hang loat so lng ln va ghi cung mot chng trnh co o pho dung cao (chng trnh c s dung trong nhieu ng dung thc te vi so lng ln). e ap ng cho cac nhu cau rieng biet hay cac yeu cau co o pho dung khong cao (s dung vi so lng t), ROM thao chng c a c che tao (PROM: Programable ROM ngha la ROM co the lap trnh c). Tuy nhien, vi PROM th ngi s dung ch ghi chng trnh c co mot lan, neu ghi sai hay muon oi chng trnh khac th phai thay PROM mi. e khac phuc thieu sot nay, EPROM a c che tao. EPROM (Erasable PROM: ROM co the lap trnh c va xoa c). EPROM co hai loai la UV-EPROM (Ultra Violet EPROM: EPROM xoa bang tia cc tm) va E-EPROM (Electrically EPROM: EPROM xoa bang xung ien). Do UV-EPROM c s dung rong rai hn EEPROM nen khi noi en EPROM th thng la noi en UV-EPROM. EPROM c xoa bang cach roi tia cc tm vi bc song va cng o thch hp trong khoang thi gian ma nha san xuat quy nh vao ca so xoa tren lng EPROM. Viec xoa E-EPROM c thc hien bang cac xung ien nen se de dang, nhanh chong va chnh xac hn khi xoa EPROM. Tuy nhien, e xoa c

Svth: Vng Kien Hng

22

o an tot nghiep

Gvhd: Nguyen Phng Quang

E-EPROM th can phai co cac mach xoa rieng biet cho tng loai E-EPROM, va mach xoa nay phai hoat ong tot, neu khong se lam cho E-EPROM hoat ong khong bnh thng (khong nh mach xoa EPROM, co the xoa c nhieu loai EPROM trong cung mot luc va ch can s dung cung mot mach xoa va neu mach xoa co b hong th ta ch khong xoa c EPROM ch khong anh hng g ti s hoat ong cua no sau nay). Thi gian gan ay co xuat hien them loai IC nh mi: bo nh Flash (co ngi goi la Flash ROM). Nguyen ly hoat ong cua bo nh Flash cung giong nh E-EPROM, ch co ien the xoa thap hn va toc o lam viec cua no nhanh hn so vi EEPROM. Bo nh Flash nay thng c s dung thay the cho cac o a mem va cng trong cac may tnh xach tay (Notebook). Bo nh Flash co the hoat ong gan mem deo nh RAM nhng lai khong b mat d lieu khi b mat ien. Cac EPROM thng c ky hieu bat au bang 27xxx, vi x la cac so ch dung lng cua EPROM va tnh bang Kbit. Chang han nh EPROM 2708 co dung lng bo nh la 8 Kbit (tng ng 1 Kbyte do EPROM 2708 co bus d lieu dai 8 bit), EPROM 2764 co dung lng la 64 Kbit (8 Kbyte), EPROM 27256 co dung lng la 256 Kbit (32 Kbyte) II. CACH TRUY XUAT D LIEU CUA EPROM: Cac EPROM eu co cach truy xuat d lieu nh sau: DATA OUTPUTS

OE\ CE\ PGM\

OUTPUT CONTROL

OUTPUT BUFFER Y GATING

Y DECODER

ADDRESS INPUTS
X DECODER

MATRIX MEMORY

Nguyen ly hoat ong cua EPROM khi che o oc d lieu nh sau (giai thch da vao hnh ve tren): a ch at vao EPROM se c giai ma thanh cac a ch hang va a ch cot rieng biet ben trong no (do ma tran nh c to chc theo cach chon trung phung) nh cac mach X DECODER va Y DECODER. D lieu ng vi a ch nay se c a en bo em ngo ra (OUTPUT BUFFER) va ch c phep xuat ra khi c s cho phep cua bo ieu khien xuat d lieu (OUTPUT CONTROL). Do o cac chan OE, CE phai mc logic thap (0V);

Svth: Vng Kien Hng

23

o an tot nghiep

Gvhd: Nguyen Phng Quang

cac chan PGM, VPP phai mc logic cao (VCC) khi EPROM ang che o oc d lieu. To chc ma tran nh theo cach chon trung phung: a ch cua mot te bao nh c quy nh bi a ch hang va a ch cot, ch co nhng te bao nh ma a ch hang va a ch cot eu mc logic cao th mi c chon e a d lieu ra ngoai. e hieu ro hn ve cach to chc ma tran nh theo cach chon trung phung, ta hay xem hnh ve sau:

GIAI MA Y ( GIAI MA COT ) 1 TRONG N

GIAI MA X (GIAI MA HANG) 1 TRONG M

ng bit

EM Cac ng t Y (cot) nh (1 bit) t X (hang) Te bao Cac ng NGO RA TO CHC MA TRAN NH THEO CACH CHON TRUNG D lieu ra PHUNG Ta nhan thay trong hnh ve tren th te bao nh ch co mot bit. Khi muon so lng bit ngo ra tang len th so lng bit trong mot te bao nh phai tang len theo, va luc nay so lng ng bit cung phai tang len tng ng, keo theo so cong em ngo ra cung phai tang len theo. Chang han nh EPROM 2764 co 8 bit ngo ra th te bao nh cua no phai la 8 bit, 8 bit nay c a en 8 ng bit rieng biet, moi ng bit cung c noi en mot bo em ngo ra rieng biet. III. KHAO SAT VAI EPROM THONG DUNG:

Svth: Vng Kien Hng

24

o an tot nghiep
1. EPROM 2732:

Gvhd: Nguyen Phng Quang

EPROM 2732 la mot IC nh co dung lng 4 Kbyte, gom 12 ng a ch, 24 chan. Cac chan c sap xep nh sau:

Svth: Vng Kien Hng

25

o an tot nghiep
24 23 22

Gvhd: Nguyen Phng Quang


21 20 19 18 17 16 15 14 13 OE/VPP A10 CE D7 D6 D5 D4 D3

VCC A8 A9 A11

2732
1 2 3 5 A7 A6 1 A5 A4 A3 A2 A1 A0 D0 D1 D2 GND 2 S O CHAN EPROM 2732 11 12 3 4 5 6 7 8 9 10

EPROM 2732 co bang trang thai hoat ong nh sau: Pi ns MODE Read Standby Program Program Verify Program Inhibit VIL VIH VIL VIL VIH VIL Dont Care VPP VIL VPP +5V +5V +5V +5V +5V CE (18) OE/VPP (20) VCC (24) Outputs (9 ~11, 13 ~17) Dout High Z Din Dout High Z

Chc nang cac chan: VCC, GND: la hai chan cap nguon cho EPROM, VCC noi vi +5V, GND noi mass (0V). Nguon nuoi cho EPROM can co o on nh cao. Khi cap nguon th phai luon luon ung cc tnh, khong c phep sai. CE: chip enable, chan chon IC. Ch trang thai ch va cam nap trnh th chan nay mi mc logic cao, cac trang thai con lai th no phai mc logic thap. Khi CE c a len mc logic cao th cac ngo ra cua EPROM se trang thai tong tr cao, bat chap trang thai logic cac ngo vao con lai. OE/VPP: chan nay co hai chc nang la cho phep xuat d lieu va ieu khien nap trnh. Khi EPROM ang oc d lieu th chan nay phai mc logic thap, con khi nap chng trnh th chan nay phai mc logic cao (VPP, gia tr VPP nay c nha san xuat quy nh). A0 ~ A11: cac ng a ch cua EPROM, khi nap chng trnh hoac truy xuat d lieu th eu can cac ng a ch nay. Khi

Svth: Vng Kien Hng

26

o an tot nghiep

Gvhd: Nguyen Phng Quang

ap a ch o nh can truy xuat hoac can nap chng trnh vao th cac bo giai ma hang va giai ma cot ben trong EPROM se chon lay te bao nh ung a ch can truy xuat hoac nap trnh e t o d lieu c lay ra (luc truy xuat) hoac nap vao (khi nap trnh). D0 ~ D7: cac ng d lieu cua EPROM. Khi EPROM ang nap trnh th no co nhiem vu a d lieu vao ben trong EPROM, con khi ang oc th no lai lay d lieu t ben trong EPROM a ra ngoai. Do khi trang thai ch th cac ng d lieu nay se trang thai tong tr cao nen ta co the mac song song cac ngo ra cua nhieu EPROM lai vi nhau c, ieu nay rat thiet thc vi nhng ng dung can nhieu bo nh. 2. EPROM 2764: EPROM 2764 co dung lng nh ln gap oi EPROM 2732 (8 Kbyte), no co tat ca la 28 chan. Trong o co 13 chan c dung lam ng a ch, 8 chan lam ng d lieu, cac chan con lai dung cap nguon va ieu khien. EPROM 2764 co s o chan nh sau: 28 27 26 25 24 23 22 21 20 19 18 17 16 15 VCC PGM\ NC A8 A9 A11 OE A CE D D6 D5 D4 D3 10 7

1 2 3 5

2764
2 3 S O 6 7 8 9 10 11 12 13 14 4 5 CHAN EPROM 2764

VPP A A7 A6 A5 A4 A3 A2 A1 A0 D D D2 GND 12 1 0 1

EPROM 2764 co bang trang thai nh sau: Mode Pins Read Standby Program Program Verify Program Inhibit CE OE PGM (27) VIH X VIL VIH X VPP (11) VCC VCC VPP VPP VPP VCC (28) VCC VCC VCC VCC VCC Outputs (11~13, 15~19) Dout High Z Din Dout High Z

(20) (22) VIL VIH VIL VIL VIH VIL X X VIL X

Svth: Vng Kien Hng

27

o an tot nghiep

Gvhd: Nguyen Phng Quang

Chc nang cac chan cua EPROM: VCC, GND: cap nguon cho EPROM, +5V cho VCC, GND noi mass. CE: chan chon IC. Cung giong nh EPROM 2732, chan nay ch mc logic cao khi trang thai ch hoac cam nap trnh. Khi EPROM cac trang thai con lai th chan nay mc logic thap. OE: chan cho phep xuat d lieu ra ngoai. Khi trang thai oc hoac kiem chng trnh ( ca hai trang thai nay EPROM eu xuat d lieu) th chan OE phai mc logic thap. cac trang thai con lai cua EPROM th mc logic cua chan nay khong quan trong (mc logic thap hay cao eu khong anh hng en qua trnh lam viec cua EPROM). PGM: chan ieu khien viec nap trnh cua EPROM. Khi EPROM ang oc d lieu th PGM mc logic cao (VCC). Khi ang nap chng trnh th PGM c ha xuong mc thap trong khoang thi gian 50 ms. Moi lan co xung nay th d lieu c a vao o nh co a ch tng ng vi a ch ang at vao EPROM. VPP: trang thai oc (Read) hoac ch (Standby) th VPP = VCC, khi trang thai nap chng trnh (Program), kiem chng trnh (Program Verify) hoac cam nap chng trnh (Program Inhibit) th VPP = VPP, gia tr VPP nay tuy thuoc tng loai EPROM va c nha san xuat cung cap. A0 ~ A12: cac ng a ch cua EPROM. Luc nap trnh cung nh truy xuat d lieu eu can a ch cho EPROM. Chnh nh cac ng a ch nay ma d lieu ben trong EPROM c to chc mot cach co trat t, giup cho viec truy xuat d lieu nay c thc hien mot cach de dang. D0 ~ D7: cac ng d lieu cua EPROM, nhan d lieu a vao EPROM khi nap chng trnh va a d lieu ra khi EPROM trang thai oc. NC: No internal Conection, chan nay c e trong (khong noi vi bat ky chan nao khac). 3. EPROM 27128: EPROM 27128 co dung lng nh la 16 Kbyte, so lng chan cung nh cach bo tr cac chan giong het nh EPROM 2764, ch co chan NC cua EPROM 2764 c thay bang chan A13 (ng a ch cuoi cung) cua EPROM 27128. EPROM 27128 co s o chan nh sau: 28 27 26 25 24 23 22 21 20 19 18 17 16 15 VCC PGM\ A13 A8 A9 A11 OE\ A CE\ D D6 D5 D4 D3
10 7

27128
1 2 3 5

Svth: Vng Kien Hng A A A A A A A VPP A A7 6 D2 GND 28 0 D0 D1 5 4 3 2 1 12


1 2 3 4 5 6 7 8 9 10 11 12 13 14

o an tot nghiep

Gvhd: Nguyen Phng Quang

S O CHAN EPROM 27128 Bang trang thai, chc nang cac chan, cach truy xuat d lieu cung nh nap trnh cua EPROM 27128 eu giong vi EPROM 2764.

Svth: Vng Kien Hng

29

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 4: GII THIEU CAC LINH KIEN IEN T IEU KHIEN CONG SUAT LN
Do e tai nay la mach quang bao nen cac ng dung cua nhng linh kien ien t cong suat ln tren c gii thieu ay ch xoay quanh van e hien th cac bang en. e ap ng cho cac yeu cau ve hien th ln nh cac bang quang bao at quang trng th can phai dung en cac thiet b ien t cong suat ln. Co nhieu loai linh kien co the dung c nh : SCR, cac loai opto (bo ghep quang), Solid State Relay I. DIODE CHNH LU CO IEU KHIEN SCR: SCR (Silicon Control Rectifier) co cau truc 4 lp P-N-P-N c che tao t Silic. SCR co 3 cc c ky hieu nh sau: A (Anode), K (Cathode), G (Gate: cong). SCR thng c dung trong mach khong che ieu khien, chu c cong suat ln, dong ien ln cung nh lam viec c nhiet o cao. A G K IAK G A P N P N K

IH

Ig2 >Ig1 I = 0 g VAK0

VAK

ac tuyen Volt-Ampe cua SCR VAK0: ien ap cat thuan. IH: dong ien duy tr. IAK: dong ien qua SCR. VAK: ien ap at tren hai cc SCR. Thong qua cc G e ieu khien tac dung chnh lu cua SCR. Che o lam viec cua SCR co the phan ra 3 trng hp sau:

Svth: Vng Kien Hng

30

o an tot nghiep
1. Phan cc ngc:

Gvhd: Nguyen Phng Quang

Anode am so vi Cathode, SCR ngat ien theo chieu ngc va ch co dong ien ra rat nho chay qua v co hai mat tiep giap eu b phan cc ngc. 2. Phan cc thuan: Anode dng so vi Cathode nhng khong co tn hieu ieu khien cc G, SCR ngat ien theo chieu thuan va co tac dung nh mot ien tr ln, va ch co dong ien ro rat nho chay qua v co mot mat tiep giap b phan cc ngc. Tuy nhien, khi ien ap at tren SCR at en gia tr ien ap cat thuan (VAK0) th SCR se t ong dan ien mac du khong co dong ien kch Ig. 3. Phan cc thuan ong thi co tn hieu ieu khien cc G: Neu co mot xung phan cc thuan tac ong vao gia cc G va Cathode trong khi Anode dng so vi Cathode th SCR dan ien. Thi gian chuyen t ngat sang dan nhanh (c micro giay). Dong ien chay qua SCR ch b han che bi ien tr mach ngoai do ien tr trong cua SCR rat nho (sut ap tren A K ch khoang 1V). Xung dong ien tac dung vao cc G (Ig) cang ln th ien ap phan cc dng cho A-K can thiet e m thong SCR cang nho, tc SCR cang de m thong. ieu quan trong la khi tn hieu kch tren cc G a mat th SCR van con dan ien bang dong duy tr. SCR ch b ngat hoan toan khi dong qua SCR (IAK) thap hn gia tr dong duy tr (thng co gia tr khoang vai % gia tr cua dong thuan cc ai). Trong nhng mach cung cap bang ien xoay chieu (AC) th SCR se t ngat thi iem ien ap = 0V, keo dai suot ban ky am va ch co kha nang dan lai ban ky dng neu co tn hieu ieu khien ong bo a vao cc G. Nh vay no co tac dung nh mot Diode chnh lu. II. BO GHEP QUANG (Opto-Couplers): e gia mach ieu khien va tai c cach li hoan toan ve ien th ngi ta thng dung bo ghep quang e thuc cong suat do bo ghep quang co ien the cach li gia s cap va th cap rat ln (hang KV). Co rat nhieu loai linh kien ghep quang nh: opto-transistor (phan t ieu khien cong suat la Transistor), opto-triac, opto-SCR Tuy theo yeu cau va chc nang cua mach ma ta co the la chon bo ghep quang thch hp. ay ch gii thieu c ban ve c che hoat ong cua loai opto-transistor, cac loai khac cung co cach hoat ong tng t.

Svth: Vng Kien Hng

31

o an tot nghiep

Gvhd: Nguyen Phng Quang

Phan phat ay la mot LED phat hong ngoai, phan thu la mot Phototransistor. au tien, tn hieu ien ieu khien a en c phan phat trong bo ghep quang va bien thanh tn hieu anh sang, sau o tn hieu anh sang nay c phan nhan bien lai thanh tn hieu ien e ieu khien tai. Tn hieu anh sang nay thay the cho dong ieu khien Transistor (IB). III. SOLID STATE RELAY (R-LE BAN DAN): R-le ban dan la loai linh kien ban dan hoat ong c vi tn hieu ien xoay chieu. Loai linh kien nay thng c che tao vi cong suat ln (dong tai co the chu c len en hang chuc Ampe hoac co the ln hn). Linh kien nay dc ket noi nh sau e lam mach ieu khien: Tai xoay chieu + ieu khien Solid State Relay Ta nhan thay rang mach tren, tai xoay chieu c ieu khien bang nguon mot chieu (hoac tn hieu mot chieu) thong qua linh kien Solid State Relay. Loai R-le nay lam viec tan so cao tot hn rat nhieu so vi loai R-le dung cuon day ieu khien. Ta co the s dung loai R-le ban dan nay thay the cac opto e thuc cho cac bang en co cong suat ln.

Svth: Vng Kien Hng

32

o an tot nghiep

Gvhd: Nguyen Phng Quang

PHAN III: THIET KE VA THI CONG


CHNG 1: BO NGUON VA MACH AUTO RESET
I. BO NGUON: Trong mot mach ien t th bo nguon la quan trong nhat, no quyet nh s hoat ong hay ngng hoat ong cua mach. Mot bo nguon khong tot se lam cho mach hoat ong khong on nh va se lam hong linh kien mot cach nhanh chong (ieu nay rat thng xay ra oi vi nhng mach ien t khong c on ap tot ma phai hoat ong nhng vung co li ien khong on nh). oi vi cac IC so thuoc ho TTL th ieu nay luon luon ung. V vay mot bo nguon on ap tot th rat can thiet cho cac mach ien t (thng la cac mach dung IC so). Nhng trc khi i vao thiet ke bo nguon on ap, ta hay tm hieu s bo ve chc nang cung nh nguyen tac hoat ong chung cua cac mach nguon on ap DC. Chc nang cua moi on ap DC la bien oi ien ap vao DC cha on nh thanh ien ap ra DC on nh va gia tr ien ap nay phai ung vi gia tr khi tnh toan ly thuyet. ien ap ra nay phai c duy tr lien tuc va khong c thay oi khi ien ap ngo vao hoac dong tai thay oi ( mot gii han cho phep cua mach). e thc hien c viec nay th mot mach on ap thng gom co cac phan sau ay: ien ap vao PHAN T IEU KHIEN CONG SUAT ien ap ra

ien ap hoi tiep

PHAN T LAY MAU R KHUECH AI SAI BIET PHAN T CHUAN VREF E F S O KHOI CUA MOT ON AP C BAN - Phan t chuan (REF: Reference): cung cap mot mc ien ap on nh biet trc (VREF). Phan t lay mau:lay ien ap ngo ra e lam mau. Phan t khuech ai sai biet: so sanh mau ien ap ra vi mc chuan va tao ra tn hieu sai biet.

Svth: Vng Kien Hng

33

o an tot nghiep
-

Gvhd: Nguyen Phng Quang

Phan t ieu khien cong suat:bien oi ien ap vao than muc ien ap ra mong muon khi ieu kien tai thay oi. Khoi nay c ieu khien bang tn hieu sai biet t bo khuech ai sai biet a en.

Co 2 loai on ap c ban la: on ap lien tuc va on ap xung. On ap lien tuc c chia ra lam hai loai na la on ap noi tiep va on ap song song. Tuy mach ien that s cua cac loai on ap nay khac nhau nhng ve c ban eu phai co u ca bon thanh phan trong s o khoi tren. Sau ay la cac s o khoi cua cac loai on ap c ban tren. * S o khoi cua mach on ap noi tiep: RS VI REF R1 VO

R2 Ten goi on ap noi tiep la do phan t ieu khien mac noi tiep vi tai (phan t ieu khien thng la mot Transistor co chc nang nh mot bien tr, ay ky hieu la RS). Nguyen ly hoat ong cua mach nh sau: gia s ien ap ngo vao b sut ap th tai thi iem tc thi (ngay luc va sut ap) ien ap ngo ra cung b sut theo. ien ap sut nay (ien ap mau) c phan anh en bo khuech ai sai biet nh cap ien tr lay mau R1, R2. Khoi khuech ai sai biet se so sanh ien ap mau nay vi ien ap chuan t khoi REF (Reference) a en va se a ra tn hieu ieu khien en cc B cua Transistor, ieu chnh lai ien ap phan cc cua no (cu the la lam Transistor dan manh hn). Giai thch tng t cho trng hp tang ap ngo vao. * S o khoi cua mach on ap song song: VI REF RSHUNT R1 R2 34 RS VO

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

Ten goi on ap song song cung do phan t ieu khien mac song song vi tai. Nguyen ly hoat ong cua mach cung c giai thch tng t nh mach on ap noi tiep. S thay oi ien ap vao se lam ien ap ngo ra cung thay oi theo tai thi iem tc thi, cap ien tr lay mau R1, R2 se truyen s thay oi nay ve bo khuech ai sai biet. Bo khuech ai sai biet cung so sanh ien ap chuan vi ien ap mau nay va se a ra tn hieu ieu khien tng ng lam cho ien ap ra on nh tr lai. * S o khoi cua mach on ap xung: VI VO R1 OSC REF On ap xung dung mot khoa tch cc e lam phan t ieu khien. Khoa nay c dung e ngat ien ap vao theo mot chu ky lam viec thay oi theo cac yeu cau cua tai. Mot bo loc (thng la loc LC) dung lay trung bnh ien ap hien dien ngo vao cua no va a ien ap o en tai ra. Do Transistor ieu khien hoac m (dan bao hoa) hoac tat nen cong suat tieu tan phan t ieu khien se toi thieu. V le o, on ap xung hu hieu hn on ap noi tiep hoac song song. Do nguyen nhan nay, on ap xung ac biet thch hp cho cac ng dung co sai biet ien ap vao ra ln hay cac yeu cau dong tai ln. S bien oi chu ky nhiem vu thng at c bang cach duy tr mot tan sokhong oi va thay oi thi gian tat m. Phng phap nay c goi la bien ieu o rong xung (PWM: Pulse Width Modulation). Mot ky thuat khac la duy tr thi gian m khong oi va thay oi thi gian tat (thay oi tan so). Tat ca cac loai on ap tren eu co the rap c t cac linh kien ri nh Transistor, Op-Amp, hoac t cac mach tch hp san. Tuy nhien, e mach ien n gian nen ay dung IC on ap (cac mach on ap c tch hp san). Co nhieu loai IC on ap, trong o loai IC on ap 3 chan thng c s dung rong rai v chung nho va ch can mot so t linh kien ben ngoai. IC on ap 3 chan ac biet co li cho R2

Svth: Vng Kien Hng

35

o an tot nghiep

Gvhd: Nguyen Phng Quang

viec thiet ke cac bo nguon nho on nh hay cac on ap tren cac card. IC on ap 3 chan loai co ien ap ra co nh (khong ieu chnh c) co hai loai la on ap dng va on ap am. Co nhieu ho IC on ap nhng ay ta ch xet en ho 78xx tng ng vi IC on ap dng, hai so sau ch ien ap ra co nh cua no, cu the la 7805: on ap dng co ien ap ngo ra la 5V, 7812: co ien ap ra la 12V. Tuy theo dong ien ngo ra, ngi ta them ch e ch, th du: 78Lxx: dong ien ra danh nh la 100mA. 78xx: dong ien ra danh nh la 1A. 78Hxx: dong ien ra danh nh la 5A. Chu y: 78L62: on ap 6,2V. Sau ay la mot mach on ap co ien ap ngo ra co nh 5V s dung IC on ap 7805 (on ap dng co ien ap ngo ra la 5V, dong ien ngo ra en 1A).

VI 0,33 F

7805 3

VO 0,1F

7805 132 S O CHAN IC 7805

Cac tu 0,33 F va 0,1 F dung chong nhieu va cai thien ap ng qua o cua on ap. Cac tu nay at cang gan chan IC cang tot. Phan t tieu thu cong suat chu yeu cua mach nay la bang en (cac IC so cung tieu thu cong suat nhng khong ang ke), do dung phng phap quet nen tai moi thi iem ch co mot cot LED c phep sang. Theo tnh toan, neu ca 7 LED trong cot cung sang th dong ien tc thi khoang 2,7A nhng dong trung bnh ch khoang hn 80mA. (theo nh ket qua tnh toan cua phan thiet ke mach thuc cong suat). IC on ap 7805 chu c dong ngo ra en 1A nen bao am cung cap u dong cho toan mach ma ban than no khong b qua dong. Tuy nhien, ta cung can gan tan nhiet cho IC e no hoat ong ieu kien tot nhat. II. MACH AUTO RESET: Mach Auto Reset thng dung e xac nh trang thai au tien cua mach ngay khi va cap nguon e mach luon hoat ong ung nh yeu cau thiet ke. Co hai loai mach Auto Reset la reset mc cao va mc thap (tuy vao mc logic

Svth: Vng Kien Hng

36

o an tot nghiep

Gvhd: Nguyen Phng Quang

chan reset cua cac IC. IC 4060 va 4040 s dung trong mach eu co chan reset tac ong mc logic cao nen ay ch giai thch nguyen tac hoat ong cua mach Auto Reset mc cao. Nguyen tac hoat ong cua mach Auto Reset mc thap cung tng t nen khong can thiet phai giai thch lai. Sau ay la hai dang mach Auto Reset thng gap (mot mach tac ong mc cao, mach con lai tac ong mc thap):

Svth: Vng Kien Hng

37

o an tot nghiep

Gvhd: Nguyen Phng Quang

C D

R D a en chan Reset cua IC C S

R a en chan Reset cua IC

Mach Auto Reset tac ong mc thap Mach Auto Reset tac ong mc cao Giai thch va tnh toan cac thong so (ch vi mach Auto Reset tac ong mc cao): khi va cap nguon, ien ap tren tu = 0V nen ngo ra a en chan reset mc cao, tac ong lam cac IC khong hoat ong c. Sau o ien ap tren tu tang len va chan reset cua IC c a xuong mc thap, IC c phep hoat ong. Hoac khi mach ang hoat ong, ta nhan nut S lam tu phong het ien (do b noi tat), luc nay ap tren tu = 0V nen ngo ra cua no tac ong tiep lam IC ngng hoat ong. IC ch hoat ong tr lai khi nut nhan S c tha ra va tu nap en mot gia tr nao o e chan reset cua IC khong con b tac ong. Tnh toan cac thong so cua mach: do nguon cung cap cho toan mach la 5V nen cac IC thuoc ho CMOS se hieu mc logic cao khi ien ap cac chan ngo vao la 3,5V, mc thap la 1V. Do o, e IC thoat khoi trang thai reset (mc cao) th ien ap chan reset (ien ap tren R) phai 1V. Ta co: VCC = 5V = VC + VR = VC + 1V VC = 4V. mat khac ta co phng trnh nap cua tu la: VC = VCC(1-e-t/ ) = 4V. vi t: thi gian e tu nap ay (at en gia tr VC 4V). = RC: thi hang nap cua tu. e-t/

=1 4/5 = 0,2 t/ = 1,6

chon t = 10 ms = 6,25 ms chon C = 4,7 F R = 1,33K , chon R = 1,2K Tnh lai thi gian nap ay cua tu vi R =1,2K = RC = 1,2.103.4,7.10-6 = 5,64 ms t = 1,6.5,64 9 ms. Vay sau khi va cap ien hoac nut nhan S va thoi tac ong trong mot khoang thi gian la 9 ms th IC mi c phep hoat ong.

Svth: Vng Kien Hng

38

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 2: BO DAO ONG TAO A CH


e EPROM hoat ong c th can phai co a ch cung cap cho no. Viec nay c thc hien bang cac IC em chuyen dung hoac cac mach em c rap t nhng Flip-Flop ri. Cac mach em can c cung cap xung ong ho ngo vao. Viec tao xung ong ho co the tao c bang nhieu cach: dung Transistor rap mach dao ong a hai; cac mach dao ong TTL, CMOS da vao ac tnh nap-xa cua tu hoac TTL, CMOS ket hp vi thach anh lam mach dao ong; dung cac IC chuyen dung tao dao ong nh 555, 556 Ngoai ra con co loai IC ac biet vi hai chc nang la tao xung va em c tch hp vao trong cung mot vo, IC 4060 thuoc loai nay. Do nhiem vu cua khoi nay la tao a ch cho EPROM nen neu dung cac mach dao ong ri (khong co bo em) nh: dao ong a hai, TTL, CMOS, 555 th phai ton them cac IC em va do o mach se phc tap hn, gia thanh cao hn. Neu dung IC 4060 th ch vi mot IC ta rap c ca mach dao ong lan mach em, do o mach se n gian hn, gia thanh se thap hn. S o nguyen ly hoat ong cua bo em dung IC 4060 va IC 4040 c ve nh sau:

a en A0~A4 EPROM

a en A5~A13 EPROM

Giai thch nguyen ly hoat ong cua mach: IC 4060 ket hp vi thach anh lam thanh mach dao ong co tan so 36 KHz (bang tan so dao ong rieng cua thach anh). Theo s o tren th tan so tai mach dao ong phai qua 12 (hoac 13 tuy ngi s dung quy nh) tang Flip-Flop chia tan mi tao ra mot xung kch vao 4040 va lam tang a ch cua EPROM len 1. Mach dao ong co tan so 36 KHz th sau khi qua 12 tang chia (chia cho 212 lan) se co tan so la 36KHz/212 9Hz (sau khoang

Svth: Vng Kien Hng

39

o an tot nghiep

Gvhd: Nguyen Phng Quang

thi gian t = 1/9 0,1s th ch se dch i mot cot). Neu SW c gat qua v tr 13 tang chia th tan so di chuyen cua cac ch la 36KHz/213 4,4 Hz (tc sau 0,2 s th ch se dch i mot cot). Vi toc o di chuyen nh tren th se khong qua nhanh (co u thi gian e ngi xem oc c ch) nhng cung khong qua cham e co the gay cam giac nham chan ni ngi xem.

Svth: Vng Kien Hng

40

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 3: BO QUET COT


Viec quet cot cua bang en c thc hien bi bo giai ma a ch. Bang en co bao nhieu cot th can bay nhieu ng ieu khien t bo giai ma a ch a en. Tai moi thi iem nhat nh th bo giai ma a ch ch a ra duy nhat mot tn hieu cho phep tren cac ng ieu khien va ch co nhng en thuoc cot nay mi c phep hoat ong (en sang) cac en nhng cot con lai th khong c phep hoat ong (en toi). e thc hien viec nay ta co the dung cac IC nh: 74164, 74138. Sau ay la mach quet cot dung IC 74164: MACH QUET COT DUNG IC 74164
13 12 11 10 6 5 4 3 13 12 11 10 6 5 4 3

T A0 EPROM en
VCC

Giai thch nguyen ly hoat ong: ngay khi va uc cap nguon, mach Auto Set se lam ngo ra Q cua D Flip-Flop mc logic [1], tat ca cac ngo ra cua cac IC 74164 eu mc logic [0]. Mc logic [1] tai ngo ra Q cua IC 4013 c a en ngo vao A, B cua IC 74164 au tien. Khi co xung Ck xuat hien th mc logic [1] nay se c dch en ngo ra au tien QA cua IC 74164 au tien. ong thi luc nay mc logic [0] ngo ra gan cuoi QG cua IC 74164 cuoi cung se c truyen qua Flip-Flop e en ngo ra Q cua no va a en ngo vao A, B cua IC 74164 au tien. T luc nay tr i, tai ngo ra cua cac IC 74164 se co mot mc logic [1] di chuyen moi khi co xung ong ho tac ong (ch co duy nhat mot mc logic [1], tat ca cac ngo ra con lai eu mc logic [0]). Khi mc logic [1] nay di chuyen en ngo ra QG cua IC 74164 cuoi cung th khi co xung Ck tiep theo tac ong, mc logic [1] nay se c a en hai ngo vao A, B cua IC 74164 au tien (thong qua D Flip-Flop), ong thi no cung c dch en ngo ra cuoi cung cua bo quet cot QH. Xung Ck tiep theo tac ong: mc logic [1] tai A, B se c a vao QA cua IC 74164 au tien,

Svth: Vng Kien Hng

QH QG QF QE QD QC QB QA
74164

QH QG QF QE QD QC QB QA
74164 VCC

CLR

CLR

CLK

CLK

B A 2 1

B A

9 4
2

2 1

R
3 5

4013 CLK 1

S 6

41

o an tot nghiep

Gvhd: Nguyen Phng Quang

mc logic [1] tai QH cua IC 74164 cuoi cung se t ong bien mat. Nh vay, vi mach ien nh tren ta se c mot mach quet cot vi mc logic [1] di chuyen (quet bang mc cao). Tuy nhien do IC 74164 co tn hieu cho phep mc cao nen dong ngo ra thap (0,4mA). Ngc lai, IC 74138 co tn hieu cho phep mc thap nen co dong ngo ra ln (dong ien t ngoai o vao IC, 8mA). Nh vay, dung IC 74138 e quet cot th ta c li hn nhieu ve cong suat so vi khi dung IC 74164 e quet cot. Do o e tai nay dung IC 74138 e lam mach quet cot. Do bang en co 30 cot nen ta dung bon IC 74138 e thc hien viec quet cot va them mot IC 74138 na e ieu khien cac IC nay hoat ong ung nh yeu cau thiet ke (tai moi thi iem ch a ra mot tn hieu cho phep duy nhat). V moi IC 74138 co 8 ngo ra nen ta c tong cong 32 ngo ra, nhieu hn 2 ng so vi 30 cot cua bang en, do o phai bo bt hai ng cua cac IC 74138. Ngi viet e tai quy nh bo hai ng au tien cua bo quet cot. Bo giai ma a ch dung IC 74138 co s o nguyen ly hoat ong nh sau:

A4 A3

T A0 en A2

Giai thch nguyen ly hoat ong cua mach: IC 74138 (I) co nhiem vu ieu khien 4 IC 74138 con lai. Do ieu khien bon IC nen no ch can dung hai ng a ch e tao tn hieu ieu khien (22 = 4 trang thai) ng a ch con lai c noi mass e mach hoat ong on nh. Ba ng a ch cua bon IC quet cot c dung het e giai ma ra c 32 ng. Tai thi iem au tien khi va cap nguon, mach Auto Reset cua bo tao a ch se lam cho cac ng a ch eu mc logic [0]. Khi o IC 74138 (I) se cho phep IC 74138 (II) (IC au tien cua bo quet cot) hoat ong, da vao bang trang thai cua IC 74138 ta biet c trang thai logic cac ngo ra cua cac IC nay. Ta nhan thay ch co 1 ngo ra au tien cua IC

Svth: Vng Kien Hng

42

o an tot nghiep

Gvhd: Nguyen Phng Quang

74138 (II) la mc logic [0], tac ca cac ngo con lai eu mc logic [1] nen ch co 1 cot en ng vi ngo ra nay c phep hoat ong (sang). Khi xung ke tiep tac ong, a ch tang len 1, bay gi ch co ngo ra th 2 cua IC 74138 (II) mc logic [0], tat ca cac ngo con lai cua bo quet cot eu mc logic [1]. Tng t nh tren, bay gi cung ch co cot th 2 cua bang en (ng vi ngo ra th 2 cua IC 74138 (II) mi c phat sang. C tiep tuc nh the, khi en xung th 9 tac ong th ch co IC 74138 (III) mi c phep hoat ong, cac IC con lai trang thai cam. Va tai thi iem nay ch co ngo ra au tien cua IC 74138 (III) mc logic [0], cho phep cot en ng vi no c phep hoat ong. Nh vay, mc logic [0] c chuyen t IC 74138 (II) sang IC 74138 (III) mot cach lien tuc va nh vay viec quet cot cung c thc hien lien tuc. Khi xung th 32 tac ong th mc logic [0] c dch en ngo ra cuoi cung cua bo quet cot, cho phep cot en ng vi ngo ra nay hoat ong. Va khi xung th 33 tiep theo tac ong, IC 74138 (I) lai quay ve trang thai au tien, ch cho phep IC au tien trong bo quet cot hoat ong (IC 74138 (II)). Luc nay cac ng a ch at vao IC 74138 (II) eu mc logic [0] nen ngo ra au tien cua bo quet cot cung mc logic [0] va mach ien lai tr ve trang thai au tien giong nh khi va cap ien. Nh vay, mach giai ma a ch dung IC 74138 tren a hoat ong ung nh yeu cau khi thiet ke la tai moi thi iem nhat nh ch co mot tn hieu cho phep duy nhat va tn hieu nay c dch chuyen theo vong moi khi co xung ien tac ong. Dch chuyen theo vong: tn hieu cho phep c di chuyen t ngo ra au tien en ngo ra cuoi cung, sau o lai quay ve ngo ra au tien va bat au chu ky di chuyen mi.

Svth: Vng Kien Hng

43

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 4: BO CHOT D LIEU VA IEU KHIEN MAU


e chuyen oi mau tren bang en c de dang th viec s dung bo chot d lieu la can thiet. Co nhieu cach e chot d lieu nh dung D Flip-Flop, cac IC chot chuyen dung (74373, 74563, 74573, 74241,), cac bo em d lieu vi chan ieu khien (74125, 74126,). Tuy nhien, viec s dung cac IC chuyen dung th luon luon de dang va hieu qua hn so vi cach rap cac IC ri lai vi nhau e c mot mach to hp co chc nang tng t . Ngoai ra, cac IC chuyen dung con giup lam giam gia thanh cua mach, giam o phc tap cua mach in giup mach de dang at cac tieu chuan yeu cau ve ky thuat Phan sau ay se a ra hai mach chot d lieu s dung cac IC chuyen dung. 1. Mach chot d lieu dung IC 74241: * S o nguyen ly cua mach: en Cathode LED Cathode LED xanh en Cathode LED xanh en o en Cathode LED o

Tn hieu ieu khien t EPROM a en

* Giai thch nguyen ly hoat ong cua mach: Nh a gii thieu t trc, IC 74241 gom 8 bo chot d lieu vi ngo ra 3 trang thai. 8 bo chot nay c chia lam hai nhom, moi nhom co mot chan ieu khien rieng biet e ieu khien viec xuat d lieu cua no. Mc logic cho phep cua hai chan nay ao nhau.

Svth: Vng Kien Hng

44

o an tot nghiep

Gvhd: Nguyen Phng Quang

Da vao s o nguyen ly ta nhan thay cac ngo vao cua hai nhom trong IC 74241 c noi chung lai vi nhau, hai chan ieu khien cua hai nhom cung c noi chung lai. ieu nay co ngha la d lieu t IC 74138 a en (tn hieu quet cot) c cung cap ong thi cho ca hai nhom chot d lieu, va ch nhom nao co chan ieu khien mc logic phu hp vi mc logic cua tn hieu ieu khien mau t EPROM gi en mi c phep xuat d lieu. Theo cach ket noi nh tren th tai mot thi iem nhat nh th ch co duy nhat mot nhom c phep truyen d lieu, nhom con lai se co cac ngo ra trang thai tong tr cao. Khi tn hieu ieu khien mau t EPROM gi en mc logic thap th nhom chot d lieu th nhat se c phep hoat ong (truyen d lieu), nhom th hai se b cam (ngo ra trang thai tong tr cao bat chap trang thai ngo vao). Tn hieu t bo quet cot a en se qua bo chot th nhat e en Cathode cua LED xanh, cho phep cac LED nay sang. Ngc lai, khi tn hieu ieu khien mau mc logic cao th nhom th nhat se b cam, ch co nhom th hai la c phep hoat ong. Tn hieu quet cot t 74138 se qua nhom nay e i en Cathode cua LED o, cho phep cac LED nay sang. Nh vay, bo chot d lieu dung IC 74241 tren a thc hien c nhiem vu oi mau cho bang en mot cach de dang. Tuy nhien, do IC 74241 co s o chan phc tap (cac ngo vao va ngo ra cua IC nam xen ke nhau ca hai hang chan) nen se gay kho khan cho viec thiet ke mach in (cho mach ien cua o an nay). V vay o an nay se s dung IC 74573 e lam bo chot d lieu va ieu khien mau (IC 74573 co s o chan phu hp cho viec thiet ke mach in hn IC 74241: cac ngo vao va ngo ra cua IC nam hai hang chan rieng biet). Sau ay la s o nguyen ly cua mach chot d lieu va ieu khien mau dung IC 74573. 2. Mach chot d lieu dung IC 74573: * S o nguyen ly cua mach: en en Cathode LED xanh Cathode LED o

Svth: Vng Kien Hng

Tn hieu ieu khien mau t EPROM a en 45

o an tot nghiep

Gvhd: Nguyen Phng Quang

* Giai thch nguyen ly hoat ong cua mach: Cac ng d lieu ngo vao cua hai IC chot c mac song song vi nhau va noi en cac ngo ra cua IC 74138 (cac IC quet cot). Chan ieu khien xuat d lieu (CE) c noi vi mach ieu khien mau. Gia hai chan CE cua hai IC nay c noi qua mot cong NOT nen khi mot IC c phep xuat d lieu th ngo ra cua IC con lai se trang thai tong tr cao (high Z), trang thai nay se khong gay anh hng g en cac phan khac cua mach. Theo nguyen ly cua mach ien tren th ngo ra cua moi IC chot se c noi en Cathode cua hai LED co mau khac nhau. Viec ket noi nay c quy nh nh sau: khi tn hieu ieu khien t bo ieu khien mau gi en mc logic [0] th IC chot noi vi Cathode cua LED xanh (IC 74573(I)) c phep xuat d lieu, IC con lai (74573 (II)) co ngo ra trang thai tong tr cao. Ngc lai, khi tn hieu ieu khien mau mc logic [1] th ngo ra cua IC 74573 (I) se trang thai tong tr cao con IC 74573 (II) th c phep xuat d lieu va khi o tren bang en, LED o se c phep sang. Tom lai, khi tn hieu ieu khien mau mc logic [0] th bang en se hien th ch mau xanh va khi tn hieu nay mc logic [1] th bang en se hien th ch mau o.

Svth: Vng Kien Hng

46

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 5 : BO EM D LIEU
Bo em d lieu rat thng c s dung trong cac mach ien t, chang han nh bo em d lieu ngo ra cua EPROM. Tac dung cua bo em la e cach li cac mach ien ngo vao va ngo ra cua no, ngoai ra bo em cung co the lam tang dong ien ngo ra. Co nhieu loai IC em chuyen dung thuoc ca hai ho TTL va CMOS nh: 7406, 7407, 7416, 7417, (ho TTL), 4049, 4050, (ho CMOS). Ngoai ra cac IC cong cung co the dung lam bo em c. Trong e tai nay, bo em cot i lien ngay sau bo chot d lieu la IC 74573 thuoc ho TTL do o neu s dung cac IC em thuoc ho CMOS (4049, 4050) th phai tnh en viec giao tiep gia TTL-CMOS. V mc logic [1] ngo ra ho TTL thap hn mc logic [1] ngo vao ho CMOS nen e IC ho CMOS lam viec on nh th phai mac them cac ien tr hoi tiep nh sau:

RF

Do bang en co en 60 cot (30 cot LED xanh, 30 cot LED o) nen neu dung IC ho CMOS lam bo em cot th phai rap them 60 ien tr hoi tiep RF moi cot. ay la mot viec lam ton nhieu thi gian, cong sc va khong can thiet v trong thc te cung co nhieu IC em chuyen dung thuoc ho TTL (nh a gii thieu tren). Cac IC em chuyen dung thuoc ho TTL nh: 7406, 7407, 7416, 7417 eu co ngo ra cc thu e h (Open Collector). Ngo ra cc thu e h co dang nh sau (hnh 1):
V C C

u t p u t

Rkeo len O u t p u t

h n h

h n h

e IC cc thu e h hoat ong c bnh thng th thng phai mac them ien tr keo len nh hnh 2. ien tr keo len nay co tac dung nh ien ap ngo ra, tao ng dan cho Transistor ben trong IC. Do o, tuy tng loai IC ma ta co gia tr ien tr keo len khac nhau. Gia tr ien tr keo len nay c chon tuy thuoc vao cac yeu to sau: cong suat cua IC,

Svth: Vng Kien Hng

47

o an tot nghiep

Gvhd: Nguyen Phng Quang

so tang mac song song cac IC, he so fan-out. Gia tr ien tr keo len nay cung phai u ln e khong lam qua dong qua Transistor ben trong IC (dong chay vao IC khi ngo ra mc logic thap: IOL) va cung phai u be e khong lam cham i toc o lam viec cua IC. Neu s dung IC loai cc thu e h e thuc tai trc tiep th co the mac mach ien nh sau:
VCC

tai

hnh 3 Do tai mach nay la bang en (ma tran LED 5x7: mot ma tran LED th gom co 5 cot va 7 hang) nen neu dung IC em e keo tai trc tiep nh hnh 3 th tai moi ngo ra cua mot cong em se phai noi song song vi 7 LED, thong thng th mot IC co 6 cong em, nh vay tong tat ca cac LED mac song song vao IC la 7x6 = 42 LED. Mach quang bao nay s dung phng phap quet e hien th nen dong ien tc thi qua moi LED co the len en hang tram mA (trong mot so trng hp co the len en n v Ampe). Nh the tai mot thi iem tc thi neu co 7 LED cung sang th dong ien qua IC a len en vai Ampe. Neu gap trng hp ca 8 cot LED eu sang (trng hp nay xay ra khi bang en hien th hnh anh) th dong ien co gia tr ln (vai Ampe) se chay qua IC trong mot khoang thi gian dai va se dan en viec chet IC. Neu dung cach mac them ien tr keo len nh hnh 2 th phai rap them 60 ien tr keo len, viec lam nay cung phc tap tng t nh khi dung IC em ho CMOS. Chung ta con mot trng hp kha thi na la dung IC cong e lam bo em. Do sau bo em con co them mot phan thuc cong suat na nen khong can thiet dong ra phai ln. Bo em nay ch co nhiem vu cach li gia bo chot d lieu va phan thuc cong suat. Nh vay viec dung IC cong trong trng hp nay la phu hp nhat. IC 7404 c chon v: trong mot IC co en 6 cong NOT (so lng cong nhieu nhat so vi cac loai IC cong khac), ngo ra khong phai la loai cc thu e h, thuoc ho TTL nen khong 7 4 0 4 2 7 6 phai quan tam en viec 4 giao tiep gia TTL-CMOS.
1 0

Sau ay la vai s o ien hnh cho viec s dung bo em dung IC 7404. 7 4 0 4


2 2 2 2 5 4 1 3

9 8 7 6 5 4 3

A A A A A A A A A A A A A

0 1 2 3 4 5 6 7 8 9 1 1 1

O O O O O O O O

0 1 2 3 4 5 6 7

1 1 1 1 1 1 1 1

1 2 3 5 6 7 8 9

0 1 2

2 0 E Svth: Vng Kien CHng 2 2 2 7 O P 1 V E G M P P

48

7 4 0 4

o an tot nghiep

Gvhd: Nguyen Phng Quang

Svth: Vng Kien Hng

49

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 6: BO THUC CONG SUAT


I. GII THIEU BO THUC CONG SUAT: e bang en hien th c ro rang mot cau van ban, mot hnh anh, mot ky hieu th bat buoc cac LED trong bang phai sang u manh, viec nay c thc hien mot cach de dang khi dung cac Transistor hoat ong lp D (che o Switching, tat-bao hoa, ong -cat). Ngoai ra, ta cung co the dung cac IC chuyen dung e thuc cong suat nh:7416, 7417 (thuoc ho TTL) hoac 4049, 4050( ho CMOS). Cac IC nay ngay nay a c che tao vi dong ngo ra co the len en hang chuc mA (co the len en 50 mA), bao am keo noi hau het cac tai trong cac mach ien t so. Tuy nhien, neu dung cac IC e thuc cong suat th ta se co dong ngo ra co nh, khi muon dung tai co cong suat ln hn th ta kho sa oi lai mach thuc cong suat c. Va mot ieu na la theo tnh toan, dong ien mot cot LED co the len en gan 100mA, gia tr nay cao hn nhieu so vi dong ngo ra cc ai cua cac IC thuc nen mach ien thuoc o an nay th khong the dung cac IC e thuc trc tiep tai c. Con nhieu cach khac na e thuc tai nh dung SCR, triac, op-to, Solid State Relay Cac cach nay thng c dung cho cac tai co cong suat ln nh cac bang en quang trng. Do tai ay la bang en co cong suat khong ln lam nen ta ch can dung cac Transistor cong suat trung bnh la u e thuc sang no. Bang en can c thuc bi hai bo thuc hang va cot khac nhau mi sang c nen ay cung a ra hai bo thuc hang va thuc cot dung Transistor. 1. Bo thuc cong suat hang dung Transistor: D lieu t ngo ra EPROM muon hien th c th phai mc logic [1] (do e tai nay quy nh), sau khi qua cong em 7404 se b ao lai thanh mc logic[0]. Vi mc logic nay, e bo thuc cong suat hoat ong (Transistor dan bao hoa) th phai dung Transistor loai pnp, mach c rap nh sau:
V C C

7 4 0 4R B

RC p n p

Svth: Vng Kien Hng

50

o an tot nghiep

Gvhd: Nguyen Phng Quang

Giai thch nguyen ly hoat ong cua mach: khi cc B cua Transistor mc logic[0] th moi noi BE c phan cc thuan lam Transistor dan, luc nay ap ri tren CE se giam (ien ap tren chan C la VC se tang ve hng VCC) lam BC cung c phan cc thuan luon. Do BE, BC eu phan cc thuan nen Transistor se dan bao hoa va co dong u manh e cung cap cho LED. Khi d lieu ngo ra cua EPROM mc logic[0] (khong hien th tren bang en) th sau khi qua cong NOT (7404), d lieu nay se c chuyen thanh mc logic[1] lam BE, BC khong c phan cc thuan na nen Transistor se tat, ngng cung cap dong cho LED. Nh vay Transistor se dan bao hoa khi d lieu ngo ra EPROM mc logic[1], tat khi d lieu nay mc logic[0]. 2. Bo thuc cong suat cot: Do bo quet cot a tn hieu ieu khien cho phep mc logic[0], sau khi qua bo em 7404 se tr thanh mc logic[1], v vay Transistor loai npn c s dung e lam bo thuc cong suat cot, mach c rap nh sau:

7 4 0 4 R B

n p n

Giai thch nguyen ly hoat ong cua mach: khi tn hieu cho phep gi en ( mc logic[0]), qua IC 7404 se tr thanh mc logic[1], phan cc thuan BE cua Transistor lam Transistor nay dan. Luc nay, tng t trng hp tren, ap ri tren CE giam lam BC cung c phan cc thuan nen Transistor se chuyen en trang thai dan bao hoa, cung cap dong cho LED. Khi tn hieu cho phep mc logic[1], BE se khong c phan cc thuan na lam Transistor tat, ngng cap dong cho LED. Trong o an, mach thuc cong suat ngang va doc c ket noi lai vi nhau nh sau:
V C C

RC 7 4 0 4R
B

p n p

7 4 0 4 R B

n p n 51

Svth: Vng Kien Hng

o an tot nghiep

Gvhd: Nguyen Phng Quang

Giai thch nguyen ly hoat ong: theo hnh tren, LED ch c phep sang khi ca hai Transistor cung dan. e thoa man yeu cau nay th d lieu t EPROM gi ra phai mc logic[1], ong thi tn hieu t bo quet cot cung phai mc logic[0]. Luc nay, da vao hai cach ly giai tren cho bo thuc cong suat hang va cot, ca hai Transistor eu dan bao hoa nen co dong cung cap cho LED. II. TNH TOAN CHO BO THUC CONG SUAT:
VCC

RE 0V 7404 RBH T1

4V

7404

RBC

T2

IC 7404 co ap ngo ra mc cao 2,7V (chon = 5V). Do mach quet cot gom 32 cot, tai moi thi iem ch co mot cot c phep hien th nen thi gian hoat ong cua moi cot ch chiem 1/3 33% thi gian quet het 32 cot. Do o dong ien trung bnh qua moi LED cung ch chiem c 33% so vi dong ien tc thi qua no. Chon dong ien trung bnh qua LED la Itb = 10 mA khi o dong ien tc thi qua no la: Itt = 10mA 3% = 333 mA = Icbh

chon bh = 25 (chung cho T1 va T2) ieu kien e Transistor bao hoa: bh*IB Icbh IBH = IBC Icbh 333 = 25 = 13,3 mA

bh

do sut ap tren LED o (1,8V~2V) nho hn sut ap tren LED xanh (3V) nen e an toan va n gian, ta ch tnh toan oi vi LED o. Tnh RE : ta co Icbh*RE = 5V (0,2V + 2V + 0,2V)

Svth: Vng Kien Hng

52

o an tot nghiep

Gvhd: Nguyen Phng Quang

RE = 2,6V = 7,8 chon RE = 6,8 333mA vi RE = 6,8 Icbh = Itt2,6V = 6,8 Itb = 382 mA*3% 11,46 mA vi Icbh = 382 mA IBH382 25 = 15,28 mA 382 mA

Vay chon gia tr RE = 6,8 5V = Ta co IBH (dong ien qua RBH)Icbh * RE 0,6V 5V 2,6 0,6 1,8 RBH RBH RBH = 1,8 15,28 mA R 1,8V = 0,12 K BH 15,28 mA 1,812 RBH

chon RBH = 120 oi vi Transistor T2 : IBC (dong ien 5V RBC) = 4,4 V qua 0,6V RBC RBC 15,28 mA RBC 0,288 K chon RBC = 270 Xet trng hp ca 7 LED trong cung mot cot eu sang, ta ch tnh toan oi vi T2 7 LED =

7404

RBC

T2

Khi 7 LED cung sang th dong ien tc thi qua T2 la: 7 * 382 mA = 2,674 A 5V0,6V Tng t nh tren ta co IBC = RBC mA 4,4V mA RBC 107= 0,041 K chon RBC = 39 Icbh RBC 2,674A 25 = = 107

Svth: Vng Kien Hng

53

o an tot nghiep

Gvhd: Nguyen Phng Quang

Transistor thuc hang chon loai B562, thuc cot chon loai D468. Hai Transistor nay co dong IC en 1A nen bao am hoat ong tot mach nay.

Svth: Vng Kien Hng

54

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 7: BANG EN
I. GII THIEU VE MA TRAN LED: Do e tai la mach quang bao nen ta phai dung bang en e hien th (bang en s dung ay la ma tran LED). Co hai cach e co c mot ma tran LED: rap cac LED ri lai vi nhau hoac mua cac ma tran LED a c tch hp san vao trong mot vo. Khi rap cac LED ri lai thanh ma tran th gia thanh tuy co re nhng lai khong c tham my cho lam: o sang khong ong eu khi nhn cac goc nhn khac nhau, o sang gia cac LED cung khong giong nhau; va khong at c cac tieu chuan toi u ve ky thuat: mach ien phc tap v co qua nhieu chan a ra ngoai. Khi s dung ma tran LED c tch hp san th ta se khac phuc c tat ca cac khuyet iem ve tham my cung nh ky thuat cua ma tran dung LED ri: o sang ong eu cho tat ca cac LED (ieu nay ch co tnh chat tng oi nhng ta cung kho co the phan biet c s khac nhau nay bang mat thng), cac LED sang eu nh nhau moi goc nhn, at cac tieu chuan yeu cau ve ky thuat: do c tch hp vao trong cung mot vo nen cac ng mach ben trong LED c ve vi o chnh xac cao, so lng chan a ra ngoai t hn nhieu so vi ma tran dung LED ri. Va mot ieu na rat quan trong la khi can hien th hai mau tren bang en (nh yeu cau cua e tai nay) th ta kho co the thc hien c oi vi LED ri nhng vi ma tran LED tch hp th lai co san tren th trng, gia lai khong cao hn so vi ma tran LED mot mau la bao nhieu, gia tai thi iem hien nay (thang 2/2000): ma tran LED c trung mot mau o: 22 000, ma tran LED cung c nhng co hai mau xanho: 25 000. Ngoai ra, e hien th cac bang en ln th ta co the dung cac bong en tim nung rap lai thanh ma tran. Tuy nhien, do ieu kien kinh te va thi gian co han nen e tai nay ch dng lai mc hien th cac bang en c nho. Vi nhng u iem vt troi nh tren th ma tran LED tch hp c dung e thay the cho ma tran LED ri e tai nay la ieu hien nhien. e viec s dung ma tran LED c toi u th trc tien ta phai biet c ket cau ben trong cua no nh the nao (cach thc cac LED noi lai vi nhau), s o chan cua no ra sao. Phan sau ay se trnh bay ro ve nhng ieu nay. Do e tai s dung ma tran LED hai mau nen ay ch gii thieu ve loai ma tran LED nay. Sau ay la s o chan va cach ket noi ben trong cua no.

Svth: Vng Kien Hng

55

o an tot nghiep

Gvhd: Nguyen Phng Quang

K1 c a b d Kx3 Kx4 K5 Kx5

S O CHAN CUA MA TRAN LED HAI MAU XANH-O

Kx1 K K K f g K e h x2 2 3 Hnh tren la s o chan cua ma tran LED45x8 hai mau xanh-o va hai hnh anh thc te cua ma tran LED nhn t tren xuong. Trong thc te th ma tran LED co hai loai nh tren (co th t cac chan ao nhau tuy nhn cau tao ben ngoai giong het nhau) nen trc khi rap vao mach th can dung VOM kiem a tra trc. Cac khp noi bon canh cho phep ghep noi nhieu ma tran lai vi nhau, va ch co nhng ma tran co cung th t chan th mi hoat ong on nh c khi rap chung vao mach. b c d e f g

Svth: Vng Kien Hng


K1 Kx1

56

o an tot nghiep

Gvhd: Nguyen Phng Quang

Kn: Cathode cua cot LED o th n. Kxn: Cathode cua cot LED xanh th n. a, b,,h: Anode cuacac hang LED t hang th nhat en hang th tam. e tai nay ch hien th ch co c la 5x7 nhng mach in c thiet ke vi ma tran LED 5x8 e sau nay khi can hien th c ch ln hn th khong can thiet phai sa mach lai. II. BANG KIEU KY T: Viec the hien kieu ky t trong thc te co nhieu cach thc hien, tuy thuoc vao yeu cau, muc ch hien th. Khi can hien th tieng Anh (ch khong co dau) th co the dung ma tran loai 5x7, 5x8. Khi can hien th tieng Viet (ch co dau) th ta co the dung cac ma tran co o phan giai cao nh 8x12, 8x14 hoac cung co the dung hai loai ma tran tren cung c. e ch hien th c ep hn, e tai nay s dung kieu ch c 5x7, co dau va ch hien th cac ch thng (khong hien th cau van ban toan cac ch viet hoa). Hnh ve sau gii thieu kieu ch cung nh cach ma hoa ky t khi viet chng trnh nap vao EPROM. e e tai c ngan gon nen ay ch gii thieu cac ch c hien th tren bang en. 1E21212112 3F 04040438 1C 2022213C 1824242428

3C 043C 0438 1C 2122203C 023C04040438

4854545438

3C04040438

182526253C

3C 043C 0438

Svth: Vng Kien Hng

57

o an tot nghiep

Gvhd: Nguyen Phng Quang

3C 043C 0438 18 2424 2619043C

3229292926

1E2121211E

1E2121211E

1E2121211E

1E21212112

1E21212112 3C04040438

3F 04040438

01013F0101 3F 04040438003D023C04040438

Tren ay ch la cac ma hoa cua ch mau xanh tren bang en, e co cac ch mau o tren bang en th ta phai ma hoa cac ch lai bang cach them cac bit 1 hang th 8 cua ma tran (khong hien th bang en). V du nh khi muon hien th so 2000 mau o tren bang en th ta lam nh sau:

Svth: Vng Kien Hng

58

o an tot nghiep

Gvhd: Nguyen Phng Quang

B2A9A9A9A6 9EA1A1A19E

9EA1A1A19E

9EA1A1A19E

Cac o co dau cham en bieu th cho bit 1 cua d lieu t EPROM gi ra, cac o khong co cham bieu th cho bit 0.

Svth: Vng Kien Hng

59

o an tot nghiep

Gvhd: Nguyen Phng Quang

CHNG 8: NGUYEN LY HOAT ONG CUA MACH


Nguyen ly hoat ong cua mach c giai thch da vao s o nguyen ly phan phu luc. Do bang en s dung 6 ma tran LED 5x8 nen ta co tong cong 30 cot (5 cot x 6 LED = 30 cot). Ma mach ien nay hien th theo phng phap quet lap lai (quet lap lai: truy xuat mot so o nh nao o mot cach lien tuc, quet lap i lap lai nhieu lan vi tan so cao, sau mot thi gian c nh trc th se chuyen qua cac o nh mi va bat au lai qua trnh quet nh tren) nen ta lay 5 ng a ch au cua EPROM (quan ly c 32 o nh) e thc hien viec quet lap lai. e d lieu t EPROM a ra hien th c tren bang en theo mot trat t nhat nh (hien th ung ch hoac ung hnh anh) th d lieu gi ra nay phai c ong bo vi tn hieu quet cot. Khi d lieu t o nh au tien gi ra bang en th ch co cot en au tien la c phep sang (co s cho phep cua tn hieu quet cot), cac cot con lai khong c phep sang (khong co s cho phep cua tn hieu quet cot). Tng t nh the, khi d lieu t o nh th hai gi ra th ch co cot th hai cua bang en la c phep sang, cac cot con lai th khong. Qua trnh c tiep tuc cho en o nh cuoi cung th ch co cot cuoi cung cua bang en la c phep sang. Sau o EPROM quay ve truy xuat lai o nh au tien va qua trnh lai c the tiep dien. Viec quay ve nay c ieu khien bi hai IC 4060 va 4040. Nh vay, xet tai mot thi iem nhat nh th ch co mot cot LED c phep sang (LED nao trong cot c phep sang th do d lieu t EPROM gi en quyet nh). Nhng do quet vi tan so cao va nh vao s lu anh cua mat ma ta thay c cac ch mot cach lien tuc, khong b chp tat. Sau khi quet 32 o nh cua EPROM u lau (u thi gian e ngi xem co the oc c ch tren bang en) th EPROM se c chuyen sang quet 32 o nh ke tiep. D lieu 32 o nh nay khi hien th tren bang en se tao cho ta cam giac nh cac ch dch i mot cot (nh cach viet chng trnh cho EPROM). Qua trnh c the tiep tuc va ta se c cac ch di chuyen tren bang en. Viec oi mau cho bang en c thc hien bi cac IC chot ket hp vi tn hieu ieu khien t EPROM gi en. Theo hnh ve, khi tn hieu ieu khien t EPROM gi en mc logic thap th se cho phep cac IC 74573 th nhat (nam pha trai cua

Svth: Vng Kien Hng

60

o an tot nghiep

Gvhd: Nguyen Phng Quang

moi cap IC 74573, theo hnh ve) hoat ong, cam cac IC con lai hoat ong. Theo quy nh cua e tai nay th cac IC 74573 th nhat se quan ly cac cot LED xanh, cac IC con lai se quan ly cac cot LED o. Nen khi tn hieu ieu khien mc logic thap th ch tren bang se co mau xanh, ch se hien th mau o khi tn hieu gi ra ng ieu khien mc logic cao.

PHAN IV: TONG KET


I. U VA NHC IEM CUA MACH THI CONG: 1. u iem: Ch hien th ro rang, toc o di chuyen cua cac ch tren bang va phai. Mach hoat ong on nh trong thi gian dai (a kiem nghiem). Ch oi mau nh y o thiet ke.

2. Nhc iem: Do phai oi mau bang phan mem (chng trnh nap vao EPROM) nen khi khong can oi mau th phai sa chng trnh lai. II. HNG PHAT TRIEN CUA E TAI: Tang so lng ma tran LED ong thi thay bo quet cot cu bang EPROM (s dung phng phap quet) e hien th c hnh anh. Luc nay, d lieu hang va cot cua ma tran LED eu t EPROM a en. III. KET LUAN: e tai THIET KE MACH QUANG BAO DUNG EPROM a hoan thanh. e tai a trnh bay c nguyen tac hoat ong c ban cua mot mach quang bao dung EPROM, gii thieu ve cach s dung cung nh s o chan, s o noi bo cua cac IC so dung trong mach. e tai cung a ra c hai loai mach Auto Reset, mach nay dung e xac nh trang thai hoat ong au tien cua mach (ngay khi va cap ien); ieu nay rat can thiet khi dung cac IC em, cac Flip-Flop Cuoi cung em xin chan thanh cam n tat ca cac thay co cung cac ban sinh vien, nhng ngi a ong gop rat nhieu y kien, cong sc rat quy bau e giup em hoan thanh tot nhiem vu c giao. ac biet, em rat biet n thay Nguyen Phng Quang, du ieu kien sc khoe khong tot nhng thay a nhiet tnh hng dan, ch bao em nhng kinh nghiem cung kien thc thc te e e tai c hoan thanh mot cach nhanh chong.

Svth: Vng Kien Hng

61

o an tot nghiep

Gvhd: Nguyen Phng Quang

Tuy nhien, do ieu kien co han nen chac chan e tai khong tranh khoi nhieu sai sot, rat mong s ong gop y kien chan tnh cua thay co va cac ban sinh vien e e tai c hoan chnh hn.

Svth: Vng Kien Hng

62