You are on page 1of 19

n mn hc X

SVTH: H QUC VIT

NHIM V N MN HC
1.Tn ti:

THIT K NG H S
2. Cc s liu ban u:
ng h s hin th trn 6 led 7 on, khng chnh gi pht giy, sai s 10 giy trong 1 ngy.
Led hin th loi 712 mm.
3. Ni dung cc phn thuyt minh:
Kho st cc loi vi mch s dng trong ti gm s chn, s logic, bng trng thi, cc t
tnh in.
Cc loi led 7 on.
Thit k s khi, chc nng cc khi.
Thit k s mch dao ng, mch m giy, mch m pht, mch m gi.
V s mch ng h.
V s mch in, thi cng lp rp, kim tra v chy thc.
4. Cc hinh v th:
Bng v mch dao ng.
Bng v mch m giy.
Bng v mch m pht.
Bng v mch m gi.
6.Gio vin hng dn : Th.S NGUYN INH PHU
7.Ngy giao nhim v : 19-09-2010
8.Ngy hon thnh nhim v : 08-01-2011
Ngy thng nm 2011
Gio vin hng dn

GVC.THS.NGUYN NH PH

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

NHN XT CA GIO VIN HNG DN

eee
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
Gio vin hng dn

GVC.Th.S NGUYN INH PHU

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

LI CM N
eee
Sau khong thi gian 4 thng, vi s hng dn v ch bo tn tnh ca thy Th.S. Nguyn nh
Ph, ngy hm nay, ti tt nghip ca em hon thnh xong. t c kt qu nh hm nay, ngoi
s chm ch v mit mi ca bn thn em, em khng th no khng nhc n cng lao vch ra hng i
cho ti v hng dn tng yu cu ca ti m thy Th.S. Nguyn nh Ph truyn t cho em.
Cng v l do trn, thng qua y, em xin gi li cam n chn thnh nht ca em n gio vin hng dn
ca em l thy Th.S. Nguyn nh Ph, ngi c cng lao rt ln trong kt qu ca ti ca em ngy
hm nay.
Bn cnh , em cng xin gi li chn thnh cm n n cng ty Texas Instrument, to iu
kin v c hi cho em tip xc vi b KIT th nghim, cng nh lp din n trn trang web ca cng ty
nhm gii p cc thc mc khi lp trnh nhng ng dng cho sn phm ca cng ty, em c th lp trnh
thnh cng nhng ng dng lin quan n th h vi iu khin mi nht trn th gii, to nn tng vng
vng cho em c th tip xc v thao tc vi cc th h vi iu khin mi hn sau ny.
Cui cng, em cng khng qun nhc n nhng ng gp trong vic trao i kin, chia s nhng
kin thc cng nh kinh nghim ca cc bn cng nhm ti lp 061011 em hon tt hiu qu ti
ny.
Xin chn thnh cm n!
Ngi thc hin ti.

HUYNH VN TIN

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

MUC LUC
NI DUNG

TRANG

CHNG I: GII THIU LINH KIN, THIT K MCH.......................................5


I. Gii thiu vi mch HEF4071.....................................................................................6
II. Gii thiu vi mch HEF4071....................................................................................6
III. Gii thiu vi mch HEF4071...................................................................................6
IV. Gii thiu vi mch HEF4071..................................................................................6
V. Gii thiu vi mch HEF4071....................................................................................6
I. Thit k s khi.....................................................................................................6
II. Thit k s mch .................................................................................................6
Phn III: THI CNG MCH (NU C).......................................................................
I. V mch in ................................................................................................................6
II. Hn linh kin.............................................................................................................6
III. kim tra, chy thc..................................................................................................6
CHNG III: KT QU NGHIN CU -KT LUN- HNG PHT TRIN.
I. Kt qu nghin cu. ..............................................................................................117
II. Kt lun ................................................................................................................117
III. Hng pht trin..................................................................................................118

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

LIT K HNH V
Hnh
H.1: Board vi iu khin LM3S8962
H.2 Board mng CAN s dng vi iu khin LM3S2110.
H.3. S khi ca board vi iu khin LM3S8962
H.4. S khi ca board vi iu khin LM3S2110
H.5:Cu truc bn trong cua vi iu khin LM3S8962

LIT K BNG
Bng
1: M ta thanh ghi SysTick Control and Status Register
2: M ta thanh ghi SysTick Reload Value Register
3: M ta thanh ghi SysTick Current Value Register
4: Cac ngt trong LM3S8962
5: M ta thanh ghi Run-Mode Clock Configuration (RCC)

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

LI M U

Vi s pht trin khng ngng ca khoa hc k thut, c bit l ngnh in t ng


dng rt nhiu trong cng nghip. Trong lnh vc iu khin, t khi cng ngh ch to loi
vi mch lp trnh pht trin em n cc k thut iu khin hin i c nhiu u im
hn so vi vic s dng cc mch iu khin lp rp bng cc linh kin ri nh kch thc
nh, gi thnh r, lm vic tin cy, cng sut tiu th nh.
Ngy nay, trong lnh vc iu khin c ng dng rng ri trong cc thit
b, sn phm phc v cho nhu cu sinh hot hng ngy ca con ngi nh my git, ng
h bo gi ... gip cho i sng cu chng ta ngy cng hin i v tin nghi hn.
ti ng H S rt a dng v phong ph, c nhiu loi hnh khc nhau
da vo cng dng v phc tp. Do ti liu tham kho bng Ting Vit cn hn ch,
trnh c hn v kinh nghim trong thc t cn non km, nn ti chc chn cn nhiu
thiu st. V vy rt mong nhn c nhng kin ng gp, gip chn thnh ca cc
thy c cng nh ca cc bn sinh vin.

Ngi thc hin ti.

HUYNH VN TIN

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

Chng I
GII THIU CC LINH KIN, THIT K MCH
I. KHO ST VI MCH HEF4071:
Vi mch HEF4071 c 4 cng OR, thc hin hm logic OR c s logic, s chn nh hnh 1.

Hnh 1: S logic v so chn IC HEF4071.


II.
KHO ST VI MCH HEF4081:
Vi mch HEF4081 c 4 cng AND, thc hin hm logic AND c s logic, s chn nh hnh 2.

Hnh 2: S logic v so chn IC HEF4081.


III.
KHO ST VI MCH HEF4511:
Vi mch HEF4511 c chc nng gii m s BCD sang m 7 on iu khin led loi cathode chung
c s logic, s chn nh hnh 3.

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

Hnh 3: S logic v so chn IC HEF4511.


IC HEF4511 c 4 ng vo DDDCDBDA ni vi mch m BCD, c 7 ng ra OGOFOEODOCOBOA ni
vi led 7 on, c tn hiu cht EL tch cc mc thp, c tn hiu xa s 0, c tn hiu kim tra n 7 on
LT tch cc mc thp.
Chc nng ca cc chn c th hin qua bng trng thi
Bng 1: Bng s tht ca HEF4511

Gii thch bng trng thi: nhn vo BTT ta thy gii m hin th th tn hiu EL phi ni mc logic
0 (0V), tn hiu BI v LT phi ni mc 1 (5V). Cc trng thi cn li khng s dng.
Kt qu gii m hin th trn led 7 on nh hnh 4:

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT


Hnh 4: S thp phn hin th trn led 7 on.

IV.
KHO ST VI MCH HEF4060:
Vi mch HEF4060 c chc nng dao ng v chia tn s 14 bit c s logic, s chn nh hnh 5.

Hnh 5: S logic v so chn IC HEF4060.


IC ny c chc nng m hay chia tn 14 bit v c th to dao ng.
C 2 mch dao ng: mch dao ng RC xem hnh 6 v mch dao ng thch anh xem hnh 7.

Hnh 6: S mch dao ng RC dnhg IC HEF4060.

GVHD: GVC.Th.S Nguyn inh Phu

n mn hc X

SVTH: H QUC VIT

Hnh 7: S mch dao ng thch anh dnhg IC HEF4060.


V.
KHO ST VI MCH HEF4518:
Vi mch HEF4518 c chc nng m BCD v c 2 mch m tch hp bn trong c s logic, s
chn nh hnh 8.

Hnh 8: S logic v so chn IC HEF4518.


Bng 2: Bng s tht ca IC HEF4518:

GVHD: GVC.Th.S Nguyn inh Phu

10

n mn hc X

VI.

SVTH: H QUC VIT

KHO ST LED 7 ON:

B hin th c chc nng th hin s thp phn v linh kin s dng l led 7 on.
Cu to:
S chn
Bng m hin th cc s thp phn:
Led 7 on l ch th trong mi on l mt diode pht quang (Light Emiting Diode) c k hiu
ln lt l: a, b, c, d, e, f, g.
C hai loi n 7 on:
- Loi cathode chung, dng cho mch gii m c ng ra tc ng cao.
- Loi anode chung, dng cho mch gii m c ng ra tc ng thp.
S chn ca LED 7 on:

Hnh 9: S cu to ca led anode chung v cathode chung.

GVHD: GVC.Th.S Nguyn inh Phu

11

n mn hc X

SVTH: H QUC VIT

Chng II
THIT K S KHI, S MCH NG H S.
I. THIT K S KHI
Vi mch ng h s th s khi c thit k nh sau:

HIN TH GI

HIN TH PHT

HIN TH GIY

GII M GI

GII M PHT

GII M GIY

KHI M GI

KHI M PHT

KHI M GIY

KHI DAO NG
KHI NGUN
Hnh 11: S khi mch ng h s.
Chc nng tng khi:
Khi ngun: c chc nng cp ngun cho ton b mch hot ng.
Khi dao ng: c chc nng to xung c tn s 1Hz chnh xc cung cp cho mch m
thi gian v quyt nh chnh xc ca ng h.
Khi m giy: c chc nng m n v giy, chc giy t 00 n 59, sau khi kt thc 1 chu
k m th kch 1 xung cho mch m pht.
Khi gii m giy: c chc nng gii m s BCD n v giy, chc giy sang m 7 on.
Khi hin th giy: c chc hin th s thp phn ca giy.
Tng t cho khi m pht m t 00 n 59 v kt thc 1 chu k th kch xung m cho
hng gi.
Tng t cho khi m gi: ch m t 00 n 23 gi.
II. THIT K S MCH CHO CC KHI
Phn ny s thit k s mch in cho tng khi.

1. Khi dao ng to xung 1 Hz:


Chc nng l to xung 1 Hz chnh xc.
C nhiu mch dao ng:
Mch dao ng dng RC: gm c IC, in tr R v t in C
Mch dao ng dng tinh th thch anh: gm c IC, in tr R, t in C, thch anh
u im ca mch dao ng thch anh l tn s n nh, chnh xc nhng ch hot ng tn s cao,
mun c xung 1Hz th phi dng thm chia tn s.
u im ca mch dao ng RC l c th hot ng tn s thp nhng khuyt im th khng n
nh v tn s nn gy ra sai s.
m chnh xc v thi gian th mch dao ng s dng vi mch HEF4060 va to dao ng dng
thch anh va chia tn s.
S mch in nh sau:

GVHD: GVC.Th.S Nguyn inh Phu

12

n mn hc X

SVTH: H QUC VIT

Hnh 12: S mch dao ng dng IC HEF4060 v HEF40193.


Gii thch hot ng ca mch:
IC HEF4060 c chc nng to dao ng thch anh s dng thch anh c tn s 32768Hz. Tn hiu t
b dao ng c a qua cc mch chi tn s ta c tn s ca tng ng ra nh trong hnh, tn hiu c
tn s thp nht l 2Hz. c xung tn s 1Hz th phi dng thm mch chia 2, c th s dng Flip Flop
hot mch m, y s dng IC m HEF40193.
Kt qu ta c xung 1Hz.
2.Khi m giy:
Chc nng m n v giy v m chc giy, m n v giy t 0 n 9 v chc giy t 0 n 5,
hay kt hp li l m t 00 n 59. Xung m giy ly t mch dao ng, sau khi m xong 1 chu k th
phi to xung kch cho mch m pht, ng thi chu s tc ng ca mch reset h thng.
S khi ca mch m giy nh sau:
CK1Hz
RESET_ALL

KHI M GII M
HIN TH
GIY
CK_PHUT

Hnh 13: S khi mch m giy.


Mch m c thit k s dng IC m HEF4518 v mch gii m s dng IC HEF4511, led 7 on
s dng loi cathode chung, s mch ton b nh hnh 1-9.
Gii thch hot ng ca mch: xung ck 1hz ly t mch dao ng a n ng vo CK2 tch cc
cnh xung ca IC3A, ng vo CK1 tch cc cnh ln khng s dng nn ni mass, ng vo RES c ni
vi mch RESET_ALL ca ton b mch.
Ng ra BCD ca IC3A ni vi IC gii m HEF4511 iu khin led 7 on hin th s m.
Ng ra Q3 (XUNG_CHUC_GIAY) ca IC3A lm xung ck kch cho mch m hng chc giy IC3B
ni vi ng vo CK2.
Do hng chc giy ch m t 0 n 5 nn ly trng thi th 6 = 0110 lm trng thi reset IC3B: s
dng 2 tn hiu Q1 v Q2 ca IC3B qua cng AND v qua cng OR kt hp vi tn hiu reset ton mch
RESET_ALL.
Ng ra Q2 ca IC3B c dng l xung CK kch cho mch m pht.

GVHD: GVC.Th.S Nguyn inh Phu

13

n mn hc X

SVTH: H QUC VIT

Hnh 14: S mch m giy gii m hin th.


3. Khi m pht:
Chc nng m n v pht v m chc pht, m n v pht t 0 n 9 v chc pht t 0 n 5,
hay kt hp li l m t 00 n 59. Xung m pht ly t mch m giy CK_PHUT, sau khi m xong
1 chu k 60 pht th phi to xung kch cho mch m gi, ng thi chu s tc ng ca mch reset h
thng.
S khi ca mch m pht nh sau:
CK_PHUT
RESET_ALL

KHI M GII M
HIN TH
PHT
CK_GIO

Hnh 15: S khi mch m pht.


Mch m c thit k s dng IC m HEF4518 v mch gii m s dng IC HEF4511, led 7 on
s dng loi cathode chung, s mch ton b nh hnh 16.
Gii thch hot ng ca mch: xung ly t mch m giy CK_PHUT a n ng vo CK2 tch
cc cnh xung ca IC8A, ng vo CK1 tch cc cnh ln khng s dng nn ni mass, ng vo RES c
ni vi mch RESET_ALL ca ton b mch.
Ng ra BCD ca IC3A ni vi IC gii m HEF4511 iu khin led 7 on hin th s m.
Ng ra Q3 (XUNG_CHUC_PHUT) ca IC8A lm xung ck kch cho mch m hng chc pht IC8B
ni vi ng vo CK2.
Do hng chc pht ch m t 0 n 5 nn ly trng thi th 6 = 0110 lm trng thi reset IC8B: s
dng 2 tn hiu Q1 v Q2 ca IC8B qua cng AND v qua cng OR kt hp vi tn hiu reset ton mch
RESET_ALL.
Ng ra Q2 ca IC8B c dng l xung CK kch cho mch m gi.

GVHD: GVC.Th.S Nguyn inh Phu

14

n mn hc X

SVTH: H QUC VIT

Hnh 16: S mch m pht gii m hin th.


4. Khi m gi:
Chc nng m n v gi v m chc gi, m t 00 n 23. Xung m gi ly t mch m pht
CK_GIO, sau khi m xong 1 chu k 24 gi th phi to xung kch cho mch m ngy nu c, ng thi
chu s tc ng ca mch reset h thng.
S khi ca mch m gi nh sau:
CK_GIO
RESET_ALL

KHI M GII M
HIN TH
GI
CK_NGAY

Hnh 17: S khi mch m gi.


Mch m c thit k s dng IC m HEF4518 v mch gii m s dng IC HEF4511, led 7 on
s dng loi cathode chung, s mch ton b nh hnh 18.
Gii thch hot ng ca mch: xung ly t mch m giy CK_GIO a n ng vo CK2 tch cc
cnh xung ca IC13A, ng vo CK1 tch cc cnh ln khng s dng nn ni mass.
Ng ra BCD ca IC13A ni vi IC gii m HEF4511 iu khin led 7 on hin th s m.
Ng ra Q3 (XUNG_CHUC_GIO) ca IC13A lm xung ck kch cho mch m hng chc gi IC13B
ni vi ng vo CK2.
Do gi ch m t 00 n 23 nn ly trng thi th 24 = 0010 0100 lm trng thi reset hai IC13A v
IC13B: s dng 2 tn hiu Q2 ca IC13A v Q1 ca IC13B qua cng AND v qua cng OR kt hp vi
tn hiu reset ton mch RESET_ALL.
Ng ra Q2 ca IC8B c dng l xung CK kch cho mch m ngy.

GVHD: GVC.Th.S Nguyn inh Phu

15

n mn hc X

SVTH: H QUC VIT

Hnh 18: S mch m gi gii m hin th.


5. Khi ngun:
Cc vi mch s dng ngun 5V.
Tra cu datasheet cc IC c cng sut tiu th khong hng W n mW.
Thit b tiu th cng sut nhiu nht l led 7 on do cn phi tnh ton ngun.
C 6 led 7 on, mi led c 7 on, led sng ht th 7 on u sng, ly trung bnh l 5 on sng.
Mi on tng ng 1 led n c dng l 10mA
Dng tng l
I T = 6 5 10 = 300 mA
Chn IC n p 7805 loi 1A th dng cp cho mch hot ng.
S dng ngun n p 12VDC qua IC n p 7805 c ngun 5V. S mch nh sau:

Hnh 19: S mch ngun.


Mch ngun s dng IC

GVHD: GVC.Th.S Nguyn inh Phu

16

n mn hc X

SVTH: H QUC VIT

Chng III
THI CNG
1) Cc bc v s mch in v kim tra
2) Cc bc tin hnh lp rp
3) Cc bc kim tra v chy th

4) nh gi kt qu chy thc tnh ton sai s

GVHD: GVC.Th.S Nguyn inh Phu

17

n mn hc X

SVTH: H QUC VIT

Chng IV
KT LUN V HNG PHT TRIN
1) Kt lun
2) Hng pht trin

GVHD: GVC.Th.S Nguyn inh Phu

18

n mn hc X

SVTH: H QUC VIT

Ti liu tham kho

GVHD: GVC.Th.S Nguyn inh Phu

19