You are on page 1of 57

TRNG I HC CN TH

KHOA CNG NGH




LUN VN TT NGHIP I HC

PHT TRIN NG DNG TRN
KIT eZ430-RF2500






Sinh vin thc hin: Cn b hng dn
Trng Vn Dt ThS.GV.Trn Nht Khi Hon
MSSV:1063782
Nguyn Hong Thi
MSSV:1063827
Lp: DI0671A1





Cn Th, 2010
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

1
CHNG I: GII THIU TNG QUAN


Chng 1 s trnh by cc vn sau:
- t vn .
- Yu cu v mc tiu ca ti.
- Hng gii quyt.
- Trnh by lun vn.
- Kt lun.
I. T VN
MSP430 l mt trong nhng h vi iu khin 16-bits kin trc RISC nh AVR,
PIC... Ngoi cc tnh nng vt tri ca nhng h iu khin trn, MSP430 cn
c nhng tnh nng ni tri khc nh:
- Tiu th nng lng cc thp.
- Ngun nui thp ( t 1.8V- 3.6V).
Hnh 1.1 ni ln s pht trin ca sn phm MSP430 trong tng lai l rt a
dng, kh nng x l cao v mc tch hp rt ln.

Hnh 1.1 Tin trnh pht trin MSP430
1


1
Mike Mitchell slap111.pdf trang 3.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

2
Kit eZ430-RF2500 l mt sn phm ng dng ca MSP430, c tch hp thm
b phn truyn nhn d liu khng dy hot ng vng tn s 2.4GHz v b
phn cm bin nhit c th hin hnh 1.2.










Hnh 1.2 Tng quan v kit eZ430-RF2500
2

i vi sinh vin, Kit eZ430-RF2500 l sn phm tng i mi, cha c nhiu
ti liu nghin cu v trin khai ng dng. Di y l mt s kt qu nghin
cu ca cc tc gi s dng MSP430 sau:
Tm hiu vi iu khin MSP430F2274 [18].
Dng MSP430 tnh ton p ng xung hu hn trong DSP [5].
ng dng thit k b lc s FIR [6].
S dng MSP430 gii m tnh hiu remote [7].
iu khin thit b qua mng [8].
Thit k my o a nng [9].
Trong lun vn ny, chng em s tm hiu v pht trin ng dng trn kit eZ430-
RF2500. Cc kt qu ca lun vn s gp vo ngun ti liu tham kho sinh
vin cc kho sau tip tc nghin cu v trin khai ng dng trn kit ny.
II. YU CU CA TI
Trong lun vn ny, chng em ng dng kit eZ430-RF2500 ca TI s dng b
cm bin nhit v truyn nhn khng dy c tch hp sn trn kit thit k
h thng thu thp nhit mi trng gi v PC v iu khin thit b ti ni thu
thp nhit .
H thng thit k bao gm: mt AP (Access Point) l trung tm thu nhn d liu
c gi v t cc ED (End Device) v giao tip vi PC truyn d liu ln giao

2
Slau227A. pdf trang 4.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

3
din, ED ngoi vic thu thp nhit gi AP cn thc hin iu khin ng c
hot ng.
III. HNG GII QUYT
Da trn nhng vn t ra chng ta c th s dng phng php sau
hon thnh tt lun vn:
S dng mt s tool c dnh cho phn cm bin nhit trong kit eZ430-
RF2500 cp nht nhit mi trng xung quanh sau gi d liu v cho
trung tm hin th ln PC thng qua giao din ngun m, ng thi iu khin
ng c hot ng da trn s thay i nhit .
Dng IAR Embedded Workbench IDE l phn mm h tr y cc cng
c lp trnh cho dng sn phm MSP430 thc hin vic vit chng trnh,
bin dch, g li v np, IAR c vi c tnh ca phn mm nh sau:
+Trnh bin dch cp cao c ti u ha MSP430 IAR C/C++.
+H tr trnh bin dch MSP430 IAR Assembler.
+Cng c g li mnh IAR C-SPY debugger.
IV. TRNH BY LUN VN
Ni dung ca ti c phn b thnh 4 chng, cc chng c th trnh
by cc ni dung sau:
Chng I nu ln nhng vn m Lun vn thc hin.
Chng II Tm tt l thuyt c lin quan trong qu trnh thc hin ti.
Chng III M t h thng c thit k v hot ng ca cc thnh phn
trong h thng.
Chng IV trnh by chng trnh cn thit cho h thng hot ng.
Cui cng l kt qu m Lun vn t c trong qu trnh thc hin v
hng pht trin tip ca ti.
V. KT LUN
H thng c thit k em ra ng dng trong thc t. Kt qu cho thy h thng
thit k truyn nhn tt khong cch > 40m v s50 mt trong mi trng
truyn thng, nu mi trng truyn c nhiu chng ngi th khong cch
truyn nhn gia ED n AP s l s10m.

Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

4
CHNG II: C S L THUYT

Chng 2 trnh by chi tit cc l thuyt c lin quan n lun vn nh sau:
- c im c bn ca MSP430F2274: khi qut c cu trc bn trong
ca MSP430F2274.
- c im ca kit eZ430-RF2500
- Tng quan v mng c s dng trong h thng c thit k.
- Tm hiu v ADC10 tch hp bn trong MSP430F2274.
- Cc chun giao tip c s dng.
I. C IM C BN CA MSP430F2274
Sau y l s khi bn trong ca MSP430F2274 c th hin qua Hnh 2.1
Hnh 2.1 S khi MSP430F2274
3
.
S khi trn bao gm mt s khi nh sau: khi ngun xung, khi CPU, khi
ADC10, khi Timer, khi chun giao tip, c trnh by chi tit bn di.
c tnh k thut ca MSP430F2274

3
Datasheet MSP430F2274.pdf trang 3.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

5
- Ngun in th s dng trong khong t 1.8V n 3.6V.
- Ngun tiu th cc thp.
- Ch hot ng: 270 A ti 1MHz v 2.2V.
- Ch ng :0.7 A.
- Ch khng hot ng:0.1 A.
- Thi gian thc dy t ch ng l t hn 1s.
- Cu trc RISC 16 bit , mi chu k lnh hot ng mt 62.5ns.
- C hai thanh ghi cho Timer_A, Timer_B 16 bit.
- H tr cc giao din giao tip ni tip nh: UART, SPI, I2C, IrDA.
- B chuyn i ADC 10-bit vi tc chuyn i ln ti 200ksps.
- B nh bao gm 32KB + 256B Flash Memory, 1KB RAM.
Ch hot ng
MSP430 c mt ch trng thi hot ng v 5 ch hot ng trng thi
ngun thp. Mt s kin ngt s nh thc mt trong 5 ch hot ng dng
ngun thp ny.
Sau y l 6 ch vn hnh c thit lp bi phn mm.
Active mode (AM)
- Tt c cc xung l hot ng.
Ch ngun thp 0 (LMP0)
- CPU l khng cho php.
- ACLK v SMCLK l duy tr hot ng. MCLK l khng cho php.
Ch ngun thp 1 (LMP1)
- CPU l khng cho php, ACLK v SMCLK duy tr hot ng.
MCLK l khng cho php.
- DCOs l khng cho php pht nu DCO khng dng trong ch
hot ng.
Ch ngun thp 2 (LMP2)
- CPU l khng cho php.
- MCLK v SMCLK l khng cho php.
- DCOs l cho php duy tr.
- ACLK l duy tr hot ng.
Ch ngun thp 3 (LMP3)
- CPU l khng cho php.
- MCLK v SMCLK l khng cho php.
- DCOs l khng cho php.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

6
- ACLK l duy tr hot ng.
Ch ngun thp 4 (LMP4)
- CPU l khng cho php.
- ACLK l khng cho php.
- MCLK v SMCLK l khng cho php.
- DCOs l khng cho php.
- Khng cho thch anh dao ng.
CPU
CPU c kin trc RISC (Reduced Intruction Set Computer) l mt kin trc vi
x l theo hng n gin ha tp lnh. Cc lnh c xy dng c th thc
hin vi ch 1 chu k my. Mt khc bus d liu v bus a ch (c rng 16
bt) tch ri nhau iu ny gip cho qu trnh c d liu v m lnh c th din
ra ng thi do nng cao hiu sut lm vic ca vi x l.
CPU gm 16 thanh ghi 16 bit. R0 n R3 c cc chc nng c bit nh: thanh
ghi m chng trnh, thanh ghi con tr, thanh ghi trng thi, thanh ghi hng.
Cc thanh ghi cn li c s dng vi mc ch chung.
H thng xung clock
H thng xung clock l h tr bi ngun xung c bn bao gm dao ng thch
anh 32768Hz, mt ngun thp bn trong, dao ng tn s thp, ngun dao ng
iu khin s bn trong DCO. H thng xung c bn c thit k nhm hai mc
ch: gim gi thnh ca h thng v ngun tiu th thp. Dao ng ni DCO
cung cp thi gian ngun hot ng v thit lp l t hn 1s. Nhng ngun
xung c bn cung cp nhng tn hiu xung nh sau:
- ACLK l ngun dao ng thch anh 32768Hz.
- Ngun xung chnh MCLK, l h thng xung c dng trong CPU.
- SMCLK l h thng xung c dng cho nhng module ngoi vi.
Ng vo/ra s
MSP430F2274 h tr 4 port P1, P2, P3, P4 v mi port 8 bit c lp trnh c
lp tuy nhin c mt s bit ca port dng cho chc nng giao tip trn kit
eZ430-RF2500.
WDT + Watchdog Timer
Chc nng c bn ca khi Watchdog timer l vn hnh iu khin h thng khi
ng li sau khi phn mm xut hin vn .
Timer_A, Timer_B:
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

7
Dng nh thi v ng b cho cc ng dng trong chng trnh. Timer_A l
mt b Timer/Counter 16 bit. Vi ba thanh ghi lu tr v 3 thanh ghi so snh. L
mt Timer a chc nng. m thi gian, so snh, PWM . Timer_A cng c kh
nng ngt khi counter m trn hoc mi thanh ghi m trn. Cc c tnh chnh
ca Timer_A bao gm:
- L mt Timer/counter 16 bit khng ng b vi 4 ch hot ng.
- C th la chn v cu hnh ngun xung.
- Hai ti 3 thanh ghi c th cu hnh capture/compare.
- Cu hnh u ra vi ch PWM.
- Cht ng vo v ng ra khng ng b.
Hnh 2.2 cho ta thy c s tng quan ca Timer_A.

Hnh 2.2 S khi ca Timer_A
4
.
Khi th nht: l khi chn ngun xung cho Timer_A c 4 ngun xung c
bn l TACLK, ACLK, MCLK, INCLK cc ngun ny c th c
chia nh xung bi b chia 1, 2, 4, 8.
Khi th 2: l khi chn ch hot ng ca Timer_A, Timer_A c 4
ch hot ng nh bng 2.1 bn di.

4
Slau144e.pdf Chng 12, trang 12-3
2
1
4
3
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

8
MCx Ch ngha
00 Stop Timer l tm dng.
01 Up Timer thc hin vic m lp li t 0 ti gi tr
trong thanh ghi TACCR0.
10 Continuous Timer lp li m t 0 ti 0FFFh.
11 Up/Down Timer lp li vic m t 0 ln ti gi tr ca
TACCR0 v quay v gi tr 0.

Bng 2.1 Ch hot ng ca Timer_A
5
.
Khi th 3: l ni cha gi tr tham chiu ca Timer_A trong qu trnh
hot ng.
Khi th 4: l khi cha thanh ghi m chng trnh ca Timer_A l
TAR.
Hot ng ca Timer_A:
Chn ngun xung cho qu trnh chuyn i l ACLK thng qua bit TASELLx,
ACLK l ngun dao ng thch anh 32768Hz c chnh xc cao.
Ghi gi tr nh thi vo thanh ghi TACCR0
Chn ch hot ng cho Timer_A.
Kch hot cho Timer hot ng theo cc cch sau:
- Timer m khi MCx > 0 v ngun xung l hot ng.
- Timer c th khi ng li khi gi tr trong thanh ghi TACCR0 l khc 0.
Hnh 2.3 di y th hin Timer hot ng Up mode






Hnh 2.3 Timer_ A hot ng ch Up mode
6
.
Timer thc hin vic m lp li cho ti gi tr c so snh trong thanh ghi
TACCR0. S timer m trong mt chu k l TACCR0 +1. Khi gi tr ca timer
l bng vi TACCR0 th timer khi ng li v m t 0. Nu ch Up mode
l c chn khi timer c gi tr ln hn TACCR0 th timer ngay lp tc khi
ng li v m t 0.

5
Slau144e.pdf Chng 20, trang 20-9.
6
Slau144e.pdf Chng 12, trang 12-6.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

9
II. C IM KIT eZ430-RF2500
Hnh 2.2 l hnh nh tng quan v kit eZ430-RF2500

Hnh 2.4 Board eZ430-RF2500 USB
7

eZ430-RF2500 l mt th giao tip USB v truyn nhn d liu khng
dy. eZ430-RF2500 c pht trin da trn MSP 430F2274 kt hp vi
chp CC2500 truyn nhn tn hiu vng tn s 2.4 GHz, tch hp sn cm
bin nhit . Do c im dng MSP430 c nhng u th v nng lng nn
p ng c nhng nhu cu trong thit b di ng. MSP430 dng ngun
3.6V nn trong thit k ny c th s dng pin Lithiun 3.7 V.
B eZ430-RF2500T l mt sn phm c th lm vic vi u cm USB
nh mt h thng c lp vi cm bin bn ngoi. Hoc s dng thit k m
rng vi nhng module ngoi vi. Vi giao din g li USB cho php sn
phm c th truyn v nhn d liu t xa t my tnh c nhn s dng truyn
nhn ni tip UART.
c tnh ca eZ430-RF2500:
+Giao din lp trnh v g li.
+C sn 21 chn.
+Mt tch hp cao, MSP 430 c ngun cc thp siu tit kim nng
lng.
+Hai chn xut/ nhp kt ni vi hai led xanh v cho php ngi
lp trnh m phng trc quan.
+Mt nt nhn dng m phng trc quan.
Thnh phn ca kit eZ430-RF2500:
- Hai eZ430-RF2500T target board.
- Mt eZ430-RF USB debugging interface.
- Mt AAA battery pack with expansion board (batteries includeed).

7
Slau227E. pdf Trang 6.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

10
M hnh kt ni gia eZ430-RF2500T target board v Battery Board






Hnh 2.5 eZ430-RF25000 Target Board
8

II.1 c im CC2500 trn kit eZ430-RF2500
CC2500 l vi iu khin thc hin cc cng vic nh: iu ch, gii iu ch,
kim tra li, lp bit, . phc v cho vic thu pht khng dy.

Hnh 2.6 S khi bn trong CC2500
9

- c im ca truyn nhn RF
- nhy cao (-140dBm ti 2.4kBaud, t l li gi l 1%).
- Tiu th dng thp (13.3 mA trong RX).
- Cng sut ng ra c th t ti + 1dBm.
- H tr tc d liu t 1.2 n 500 kBaud.
- Dy tn: 2400 - 2483.5 Mhz.
- c tnh tng t (analog)
- H tr iu ch OOK, 2-FSK, GFSK v MSK.

8
Slau227E. pdf Trang 7.
9
Datasheet CC2500.pdf Trang 15.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

11
LENGTH FILTER
channel
SSI
x
xBW
f
_
2 8
2
=

- Tch hp b cm bin nhit tng t.
- c tnh s (digital)
- H tr linh hot cho nh hng gi tin ca h thng: pht hin t ng
b, cho php kim tra a ch, linh hot trong vic xc nh chiu di gi
tin, c th t ng kim tra CRC..
- Giao din SPI rt hiu qu: tt c thanh ghi c th lp trnh vi mt
burst truyn.
- Ng ra RSSI s.
- H tr t ng nh gi knh truyn r rng (CCA) trc khi truyn (cho
php lng nghe trc khi tr chuyn vi h thng).
- c tnh v ngun thp (lower power)
- Dng tiu th ch l 400 nA trong ch ng.
- Thi gian khi ng nhanh: 240 s t ch ng sang ch RX hoc
TX.
- C b m d liu 64 bytes cho RX FIFO v TX FIFO.
II.2 Tn hiu RSSI (Received Signal Strength Indication)
L ch s cng trng ni ln sc mnh ca tn hiu nhn. Trong ch RX,
gi tr RSSI c th c c lin tc trong thanh ghi trng thi RSSI (c a ch
l 0x34) cho n khi t ng b c pht hin v gii iu ch. Gi tr RSSI
lun lun n nh cho n khi trng thi k tip ca ch RX l hot ng. Tc
cp nht RSSI ph thuc vo bng thng lc ni nhn v 2 bit
AGCCCTRL0.FILTER_LENGTH ca thanh ghi AGCCTRL0.



Nu PKTCTRL1.APPEND_STATUS l cho php th gi tr ca RSSI t ng
c thm vo byte u tin sau d liu. Khi tn hiu RSSI c c ti thanh
ghi trng thi RSSI n c nh dng l 2s complement. Sau y l tin trnh
chuyn i tn hiu RSSI c c sang mc cng sut tuyt i:
+ c thanh ghi trng thi RSSI
+Chuyn i gi tr c t h thp lc phn (h 16) sang h thp phn (h 10)
l RSSI_dec
( )
(

+ |
.
|

\
|
+ + =
DataRate BW
MAX
TIME WAIT
BW
sponceTime RSSI
channel
LENGTH FILTER
channel
. 8
10
,
20
2 1
2
_ 8
Re
_
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

12
+ Nu RSSI_dec>= 128 th RSSI_dBm= offset RSSI
dec RSSI
_
2
256 _


+ Ngc li nu RSSI_dec<=128 th RSSI_dBm= offset RSSI
dec RSSI
_
2
_

Ta c bng sau y cung cp mt s gi tr c trng cho RSSI_offset. Bng sau
cho ta thy c RSSI_offset tng ng vi cc tc d liu khc nhau.






Bng 2.2. Gi tr c trng ca RSSI_offset
10

III. TNG QUAN V MNG SIMPLICITI
SimpliciTi l mt giao thc mng kh n gin, c s dng phn ln trong cc
mng RF nh. SimpliciTi c thit k nhm mc ch thc hin giao tip d
dng vi vi iu khin c yu cu v ngun ti nguyn nh. Mng thng s
dng rt t nng lng nn ta c th dng pin nn thi gian s dng l pin rt di.
Mc d vy nhng giao thc mng SimplciTi h tr cho ngoi vi (End Device)
cc cu hnh mng nh: mng ngang hng (peer-to-peer), cc ty chn cho vic
lu tr v chuyn tip tin nhn, v s dng RE (Range Extenders) m rng
phm vi ca mng li. SimpliciTi c s dng trong mt lot cc ng dng s
dng ngun nng lng thp nh: bo ng v an ninh (pht hin khi, cm bin
nh sng, cm bin kh cacbon monoxide...), t ng c mc cht lng (gas,
nc), nh t ng,...
III.1 Cc thnh phn ca mng
Sau y l hnh nh m t tng quan cc thnh phn c bn trong mng SimPliTi
h tr cho vic truyn tin RF n gin.






10
Datasheet CC2500.pdf Trang 32.
Tc d liu [kbps] RSSI_offset[decimal]
2.4 71
10 69
250 72
500 72
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

13









Hnh 2.7 Cc thnh phn ca mng SimpliciTi
11

ngha ca cc khi trong hnh v nh sau:
III.1.1 M ha (Encryption)
Ta c th chn la vic m ha bng phn cng hoc s dng phn mm
nu b thu pht ca chng ta c h tr. Nhng i vi CC2100/CC2500 khng
c h tr phn cng cho vic m ha nn ta phi m ha bng phn mm. Khi
chng ta cho php chng trnh m ha c thc hin th tt c cc trng ca
d liu u c m ha ngoi tr trng a ch.
III.1.2 Nhy tn (Frequency Aglility)
SimpliciTi cho php thc hin vic di chuyn tn s truyn nhn n mt tn s
khc nu tn s hin ti c nhiu hoc khng tng thch.
Ngoi vi c th nhn c gi tin v chng c th pht hin l khng lin lc
c nu chng ang hot ng trn tn s khng ph hp bi v khng c bt
c hi m no sau khong thi gian gi v gi li mt khung.
III.1.3 Qun l mng (Network Management)
y l tn min ca AP c cc chc nng nh lu tr v chuyn tip, cho thit b
ngng hot ng, m ha mt m, v qun l nhy tn s.
III.1.4 Access Point
C th nhn d liu c gi t ngoi vi, chuyn tip d liu...v nhim v
chnh l qun l mng.
III.1.5 Range Extender
Nhim v chnh ca Range Extender l chuyn tip khung d liu.

11
Larry Friedman SimplisiTi Specification. pdf Trang 5.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

14
III.1.6 Nng lng dng trong mng (Battery-only Network)
AP c cp trc tip t PC, cn cc End Device c cung cp t pin.
III.2 Cu trc phn lp ca mng
Mng SimpliciTi c cu trc phn lp c bn gm: Application, Network, Data
Link/PHY.

Hnh 2.8 Cu trc phn lp mng SimpliciTi
12

III.2.1 PHY hoc Data Link (MAC/LLC) Layer
Chc nng chnh ca lp ny l ng khung d liu trc khi truyn.
III.2.2 Tng mng (Network layer).Thit lp cc thng s trc khi truyn
nh:
Tn s c bn v khong cch tn s.
S tn s h tr.
Phng php iu ch, tc d liu...
a ch ca ngoi vi.
Tc lp li trn Tx ca ngoi vi.
III.2.3 Tng ng dng (Application layer)
Dnh cho ngi dng pht trin ng dng.
III.3 Cu hnh mng (Topol ogy): sau y l mt s cu trc mng c bn
c th hin qua mng SimpliciTi.




Hnh 2.9 K hiu cc kt ni
13


12
Larry Friedman SimplisiTi Specification. pdf Trang 7.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

15

AP (Access Point) ng vai tr nh ni chuyn tip d liu c gi t ED1
(End Device 1) chuyn d liu nhn c cho ED2 thng qua AP.







Hnh 2.10 Lu v chuyn tip d liu qua AP
14

ED1 chuyn d liu trc tip qua ED2 thng qua vic kt ni m hnh mng
ngang hng (peer-to-peer).




Hnh 2.11 Hng mng ngang hng
15

RE (Range Extender) l ni lu tr v chyn tip d liu ca ED1 chuyn sang
ED2 thng qua mng ngang hng (peer-to-peer).








Hnh 2.12 Lu v chuyn tip d liu thng qua RE
16

M hnh mng thc hin vic truyn d liu t ED1 n ED2 thng qua hai b
phn lu v chuyn tip l RE v AP.


13
Larry Friedman SimplisiTi Specification. pdf Trang 8.
14
Larry Friedman SimplisiTi Specification. pdf Trang 9.
15
Larry Friedman SimplisiTi Specification. pdf Trang 8.
16
Larry Friedman SimplisiTi Specification. pdf Trang 9.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

16

Hnh 2.13 Lu v chuyn tip d liu thng qua RE, AP
17

III.4 Cu trc khung d liu
Cu trc khung c 3 thnh phn c bn nh sau:
- Phn c x l bi lp PHY/MAC
- Phn h tr cho vic qun l mng c ci t trong lp nwk
(network).
- Phn trnh by cho nhng d liu ng dng c h tr lp ng
dng (application layer ).
III.4.1 Khung PHY/MAC
c x l bi phn cng. N cha nhng thng tin v bit m u (preamble)
v bit ng b (sync).
III.4.2 Khung NWK
c x l bi firmware trong NWK layer. Nhng trng trong phn ny
dng cho mc ch iu khin mng c nhng thng s c th nh: th loi
khung, trng thi m ha, s th t...
III.4.3 Khung ng dng
Dng ng khung d liu ng dng c th dng truyn trong mi trng
khng kh.
Trng a ch: SimpliciTi khng chia trng a ch ring cho tng lp c
th ging nh mt s giao thc khc. M n c 4 bytes SimpliciTi a ch dng
chung.
Hnh 2.10 v hnh 2.11 cho ta thy c cu trc khung d liu trong mng
SimpliciTi.

17
Larry Friedman SimplisiTi Specification. pdf Trang 9.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

17












Hnh 2.14 Cu trc khung trong mng SimpliciTi (with security enabled)
18

Hnh 2.15 Cu trc khung trong mng SimpliciTi (without security enabled)
19

IV. B CHUYN I ADC10 TRONG MSP430F2274
Trong MSP430F2274 c tch hp b cm bin nhit ADC10 vi 10 bit cho
qu trnh chuyn i v tc chuyn i c th ln ti 200ksps, hnh 2.12
cho ta thy tng qut v cc thnh phn trong b phn ADC10.




18
Larry Friedman SimplisiTi Specification. pdf Trang 11.
19
Larry Friedman SimplisiTi Specification. pdf Trang 12.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

18






































Hnh 2.16 S tng quan v ADC10
20

IV.1 Tng quan cc khi trong ADC10
Khi th 1: trong s khi trn l ng vo ca tn hiu tng t trong
qu trnh chuyn i c gi tr t 0000 n 1111 tng ng vi 16 knh
ng vo tng t .
Khi th 2: l khi chn in th trong qu trnh chuyn i.

20
Slau144e.pdf Chng 20, trang 20-3.
1
2
3
4
5
6
7
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

19
Khi th 3: l tn hiu ng vo tng t ca b cm bin nhit c
tch hp bn trong ADC10 ca MSP430F2274.
Khi th 4: l khi ng vo ngun xung cung cp cho qu trnh chuyn
i ADC10 c 4 ngun xung c bn gm: ACLK, MCLK, SMCLK,
ADC10OSC ( l ngun xung dao ng ni 5MHz) v cc ngun xung ny
c th c chia nh xung bi b chia ADC10DIVx t 1 n 8 ty theo
nhu cu ca ngi s dng.
Khi th 5: l khi thc hin qu trnh ly mu v chuyn i tn hiu
tng t ng vo v sau lu kt qu ca qu trnh chuyn i vo thanh
ghi ADC10MEM.
Khi th 6: l ni lu tr kt qu ca qu trnh chuyn i.
Khi th 7: cho php lu tr kt qu ca qu trnh chuyn i ti bt c
u trong b nh CPU. Khi DTC l cho php, mi ln ADC10 hon thnh
qu trnh chuyn i v gi d liu ti ADC10MEM, th vic truyn d
liu c kch hot.
IV.2 Cc bc trong qu trnh chuyn i ADC10
thc hin qu trnh chuyn i ADC10 thnh cng th chng ta thc hin cc
bc sau:
- Chn tn hiu ng vo cn chuyn i t 16 knh tng ng.
- Chn ngun xung cung cp cho qu trnh chuyn i: Ngun
ADC10CLK c th dng nh xung chuyn i hoc c s dng
ly mu tn hiu vo. Vic chn ngun xung ADC10 c thng
qua bit ADC10SSELx v chng ta c th chia ngun xung ny
xung thng qua bit ADC10DIVx. Ngun ADC10 c th l SMCK,
MCLK, ACLK hoc l dao ng ni ADC10OSC.
- Chng ta phi m bo ngun xung c chn phi duy tr hot
ng cho ti khi kt thc ca qu trnh chuyn i. Nu ngun xung
khng hot ng trong qu trnh chuyn i th qu trnh chuyn i
khng c hon thnh, th s khng c bt c kt qu no l c gi
tr.
- Chn ngun in th tham chiu: ADC10 cha 2 ngun in th c
th tham chiu vi vic chn la 2 mc in th. Nu ta ci t
REFON =1 cho php ta tham chiu ngun bn trong. Khi REF_5V,
ngun tham chiu bn trong l 2.5V v khi REF_5V =0 th ngun
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

20
tham chiu s l 1.5V. V c bit khi REFOUT =0 th ngun tham
chiu bn ngoi trn chn Vref+.
- Sau khi chuyn i hon thnh kt qu c lu thanh ghi
ADC10MEM 2 dng l: s nh phn v dng 2s complement.
Cng thc chuyn i cho kt qu ADC khi dng nh dng nh
phn.



Gin thi gian cho qu trnh ly mu v chuyn i: S chuyn i
ADC10 c khi to bi cnh ln ca tn hiu ng vo ly mu SHI.
Ngun SHI c chn thng qua bit SHSx v gm c cc chn la khc:
- ADC10SC bit
- Timer_A Output Unit 1
- Timer_A Output Unit 0
- Timer_A Output Unit 2
Bit SHTx dng thit lp chu k ly mu t
sample
4, 8, 16, hoc 64 chu k ca
ADC10CLK. Tng thi gian ly mu l bao gm t
sample
cng vi t
sync
. Khi tn
hiu SAMPCON l chuyn i t cao xung thp bo hiu cho ta bit qu trnh
chuyn i c bt u, qu trnh chuyn i cn ti 13 chu k ca
ADC10CLK mi hon thnh xong. Trong 12 chu k dng thc hin
chuyn i v 1 chu k cui dng sao chp kt qu chuyn i ti ni lu tr
ADC10MEM.









Hnh 2.17 Thi gian ca qu trnh chuyn i v ly mu
21


21
Slau144e.pdf Chng 20, trang 20-7.
+

=
R R
R in
ADC
V V
V V
N 1023
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

21
ADC10 c 4 ch vn hnh cho qu trnh chuyn i c thit lp bi
2 bit CONSEQx ca thanh ghi ADC10CTL1 nh sau:

Bng 2.3 Tng kt v ch chuyn i
22

IV.3 Qu trnh chuyn i ADC10 vi ng vo nhi t
Mun s dng b cm bin nhit trong qu trnh chuyn i ta thc hin cc
bc sau:
- Bc 1: Chn ng vo chuyn i l A10 c gi tr l 1010 da trn
thanh ghi ADC10CTL1 vi 4 bit INCH_10 =1010.
- Bc 2: Chn in th tham chiu l 2.5V thng qua bit th 6 ca
thanh ghi ADC10CTL0 cho SREF_1 =1.
- Bc 3:Chn ngun xung cung cp cho qu trnh chuyn i,
MSP430F2274 c 4 ngun xung c bn ACLK, MCLK, SMCLK,
ADC10OSC hot ng c lp.
- Trong qu trnh chuyn i trn ta chn ngun xung ADC10OSC l
ngun dao ng ni bn trong MSP430F2274 nn chnh xc cao
hn cc ngun cn li.
- Bc 4: Cho php ly mu v bt u chuyn i c thit lp
thng qua thanh ghi ADC10CTL0 vi bit ENC v ADC10SC.
- Bc 5: Thu kt qu ca qu trnh chuyn thng qua thanh ghi
ADC10MEM vi nh dng nh phn.
Hnh 2.14 bn di th hin mi quan h gia nhit v in th trong qu
trnh chuyn i.


22
Slau144e.pdf Chng 20, trang 20-9.
CONSEQx Ch Vn hnh
00 Single channel
single - convertion
A single channel is
converted once.
01 Sequence-of-
channels
A sequence of channel is
converted once.
10 Repeat single
channel
A single channel is
converted repeatedly.
11 Repeat sequence-
of-channels
A sequence of channels is
converted repeatedly.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

22














Hnh 2.18 Hm lin h gia nhit v in th
23

Sau y l hnh nh thanh ghi trong qu trnh thit lp cho hot ng ng vo
cm bin.












Bng 2.4 Cc thanh ghi trong ADC10
24




23
Slau144e.pdf Chng 24, trang 20-14.
24
Slau144e.pdf Chng 20, trang 20-24.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

23
Thanh ghi ADC10CTL0
SREFx Bit 15-13 Chn ngun tham chiu
000
001
010
011
100
101
110
11
ADC10SHTx Bit 12-11 Thi gian ly mu v gi ca ADC10
00
01
10
11

ADC10SR Bit 10 Chn b m d liu cho tc ly mu
0 H tr cho tc ti 200 ksps
1 H tr cho tc ti 500 ksps

REF2_5V Bit 6 in th tham chiu
0 1.5V
1 2.5V

REFON Bit 5 Pht in th tham chiu
0 Off
1 On

ADC10ON Bit 4 ADC10 on
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

24
0 Off
1 On

ADC10IE Bit 3 iu khin ngt
0 Cho php
1 Khng cho php

ENC Bit 1 iu khin chuyn i
0 Khng cho php
1 Cho php

ADC10SC Bit 0 Bt u chuyn i
0 Khng bt u chuyn i v gi
1 Bt u chuyn i v gi

Thanh ghi ADC10CTL1












Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

25
INCHx Bit 15-12 Chn ng vo chuyn i
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
ADC10DF Bit 9 nh dng d liu
0 Nh phn
1 2s complement
ADC10DIVx Bit 7-5 B chia
000 1
001 2
010 3
011 4
100 5
101 6
110 7
111 8
Thang ghi ADC10MEM
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

26
Kt qu chuyn i Bit 15-0 10 bit chuyn i l c nm bn phi, trong
nh dng nh phn. Bit 9 l bit MSB. Bit 15-10 lun lun l 0.
Hnh 2.15 L lu chuyn i ca ADC10 c thit lp thng qua bit
CONSEQx ca thanh ghi ADC10CTL1.




























Hnh 2.19 Ch chuyn i n
25
.


25
Slau144e.pdf Chng 20, trang 20-10.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

27
V. CC CHUN GIAO TIP S DNG TRONG H
THNG
V.1 Chun SPI (Serial Peripheral Interface)
Trc ht ta xem tng quan s giao tip gia MSP430F2274 vi CC2500 s
dng chun SPI.
Hnh 2.20 S giao tip SPI gia MSP430F2274 v CC2500
26

- L chun truyn thng ng b ni tip c pht trin bi Motorola
hot ng ch song cng (full duplex) Chun ny thc hin vic
giao tip gia MSP430F2274 v CC2500.
- SPI l s lin kt d liu ng b trong khi USART. S dng 4
dy (i khi 3 dy) n cho php vi iu khin truyn thng vi bt
c vi ngoi vi no m n h tr. Mt bus ch cho php mt master
nhng c th cha nhiu slave. Master l mt vi x l n khi
to giao thc trong khi slave tng ng nh l cu lnh hoc yu cu
cho vic truyn thng tin. Bng sau cho php ta thy c s ca
tn hiu dng SPI:




26
Thomas Watteyne eZWSN Exploring Wireless Sensor Networking Lab Version Trang 11.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

28

Bng 2.4 Tn hiu SPI
27

- Tn hiu xung clock ni tip l ngun xung cung cp cho s vn
hnh ng b gia master v slave. SIMO v SOMI chc nng l
ng truyn v nhn d liu tng ng vi vai tr ca chng trong
vic giao tip.
Thit lp SPI:
- Trc khi chng ta dng giao thc SPI truyn thng vi ngoi vi
khc chng ta phi thit lp chun USART ca MSP430. Da vo
datasheet ca MSP430F2274 ta c mt s chn phc v cho truyn
thng SPI nh sau:

27
Gustavo Litovsky MSP430 Tutorial for eZ430-RF2500 and More. pdf, trang 14.
Tn tn hiu La chn tn ngha
SCLK SCK, CLK Xung ni tip
MOSI/SIMO SDI, DI, SI Master output slave
input
MISO/SOMI SDO, DO, SO Master input slave output
SS nCS, CS,, nSS, STE, CE Chn slave, Cho php
Chip
Chn Peripheral Module Functionality
(Multiplexed)
P3.0/UCB0STE/
UCA0CLK/
A5
Chn I/O s dng chung
USCI_B0 slave cho php truyn
USCI_A0 xung vo/ra
ADC10, ng vo tng t A5
P3.1/
UCB0SIMO/
UCB0SDA

Chn I/O s dng chung
USCI_B0 slave vo/master ra trong
ch SPI
SDA I2C d liu trong ch I2C
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

29


Bng 2.5 Port dng cho chun SPI trong MSP430F2274
28

Tt c cc chn l c nhiu chc nng v c th l I/O. Trong vi iu
khin ny c c USCI_A0 v USCI_B0 c kh nng s dng cho giao
thc SPI. Nhng trong kit eZ430-RF2500 ta ch c th s dng USCI_B0
cho chun SPI giao tip vi CC2500 v USCI_A0 s dng chun
UART giao tip vi my tnh thng qua cng USB. P3.0 c s dng
nh mt chn chung iu khin CSn (dng chn slave truyn thng).
P3.1, P3.2 c s dng nh SIMO va SOMI c nh sn. P3.3 l
ni cung cp xung cho php s ng b gia master v slave trong qu
trnh truyn thng.
V.2 UART Module v truyn thng vi PC
Qu trnh giao tip ca kit eZ430 RF2500 vi my tnh c thc hin thng
qua UART (Universal asynchronous receiver/transmitter) c th hin qua
hnh 2.21 bn di.

28
Gustavo Litovsky MSP430 Tutorial for eZ430-RF2500 and More. pdf, trang 16.
P3.2/
UCB0SOMI/UCB0SCL

Chn I/O s dng chung
USCI_B0 slave ra/master vo trong
ch SPI
SCL I2C xung trong ch I2C
P3.3/
UCB0CLK/
UCA0STE
Chn I/O s dng chung
USCI_B0 xung vo/ra
USCI_A0 slave cho php truyn
P3.4/
UCA0TXD/
UCA0SIMO
Chn I/O s dng chung
USCI_A0 truyn d liu ra trong ch
UART
Slave vo/master ra trong ch SPI

P3.5/
UCA0RXD/
UCA0SOMI
Chn I/O s dng chung
USCI_A0 nhn d liu vo trong ch
UART
Slave ra/master vo trong ch SPI
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

30

Khi s dng UART
Hnh 2.21 UART kt ni vi my tnh
29

L chun truyn thng khng ng b, iu khin giao tip ca
MSP430F2274 truyn thng ni tip vi my tnh.
Qu trnh thit lp vi iu khin hot ng dng truyn nhn UART:
Trc khi truyn thng tin gia PC v kit thng qua giao thc truyn thng ni
tip bt ng b UART ta thc hin mt s thit lp cho vi iu khin
MSP430F2274 nh sau:
Ta thc hin vic gn gi tr cho port P3.4 v P3.5 ln mc logic 1 cho php
MSP430F2274 thc hin c vic truyn nhn d liu vi PC qua giao thc
UART
P3SEL |= 0x30
Sau chn ngun xung thng qua thanh ghi UAC0CTL1 =UCSEL_2 ta chn
ngun xung l SMCLK 8Mhz.
Thc hin vic thit lp tc Baud thng qua 2 thanh ghi
UCA0BR0,UAC0BR1 ta chn
UCA0BR0 =0x41
UAC0BR1 =0x3
Thc hin cng thc sau: UCA0BR0 +UAC0BR1 x 256 =833
Ta thc hin vic tra bng 1 phn ph lc s cho ta c tc baud v t l
li tng ng.
Cu trc khung d liu: hnh 2.18 bn di cho ta thy c cu trc khung d
liu s dng trong UART truyn thng vi PC.


29
Slau227E. pdf Trang 6
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

31
Hnh 2.22 Cu trc khung d liu truyn thng vi PC
30



































30
MSP430 Microcontrollers Essentials Chng 14, trang 14-24.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

32
CHNG III: THIT K H THNG
Chng 3 trnh by cc vn c th sau:
- M hnh tng qut nht m h thng c thit k hot ng.
- Nguyn tc hot ng ca cc thnh phn trong h thng c thit
k.
- Tng quan v giao din hin th lc h thng hot ng.
- Phn mm h tr IAR c s dng vit chng trnh, bin dch
v np cho h thng hot ng.
- S mch thc t: khi qut c s mch c iu khin bi
ngoi vi (End Device).
I. M HNH TNG QUT
Hnh 3.1 bn di cho ta thy c cc thnh phn trong h thng bao gm 8
End Device, 1 Access Point.
















Hnh 3.1 M hnh tng qut ca h thng
M hnh mng hnh sao ca h thng c thit k thu thp nhit t cc
EDx (End Devicex) nm xung quanh AP (Access Point) v sau ED gi d
liu v cho AP hin th ln giao din, kt qu thu nhn c t cc ED.
Access
Point
End
Device 1
End
Device 2
End
Device 3
End
Device 8
End
Device 7
End
Device 6
End
Device 5
End
Device 4
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

33
Mi ED c cc chc nng ring bit nhng chng cng c chc nng chung nht
l thc hin cm bin nhit ti ch v gi d liu cm bin c v cho AP.
II. NGUYN TC HOT NG CA CC THNH
PHN TRONG H THNG
- H thng c bn gm 2 phn chnh: Mt module ng vai tr l AP
(Access Point) v mt module khc ng vai tr l ED (End Device).
Hot ng vi nhau da trn nguyn tc c bn: cc thit b ED lun
lun gi d liu lin kt ti AP mong mun tham gia vo mng, trong
khi th AP lun lun lng nghe v thit lp kt ni vi ED no c yu cu
tham gia vo mng. Khi hon tt vic kt ni th AP trong mng lun
lun sn sng nhn d liu t nhng ngoi vi mi giy mt ln. End
Devide c cha cc b cm bin sau khi thc hin thu thp nhit , in
th s gi d liu v cho AP s dng ch cng sut thp LPM3, d
liu gi v bao gm nhit v in th m ED tnh ton c. Khi
AP nhn c d liu gi v t bt c ED no trong mng th n gi d
liu qua ng dng UART n cng COM ca my tnh v d liu
c hin th trong giao din ng dng ngi dng GUI. Trong kt ni
mng ny th mt AP c th h tr ln ti 8 thit b ED.
- V cu trc mng s dng trong ti ny l cu trc mng hnh Sao,
nn cc End Device trong cng mt mng c vai tr ngang nhau. Sau y
l vai tr c th ca AP v ED.
- Sau y l nguyn tc hot ng chi tit cho tng thnh phn trong h
thng c thit k.
II.1 Vai tr ca AP
- S dng b cm bin bn trong ADC10 bt u thc hin vic cm
bin o lng nhit mi trng xung quanh mi giy mt ln ri
sau gi d liu ln my tnh PC. Ngoi ra AP cn lin tc lng
nghe trn mng pht hin c ngoi vi mi tham gia vo mng li
v nhn gi tin c gi v t ED mi chc chn rng l tham gia
vo mng. Access Point s dng 2 led cho vic bo hiu, mt n led
chy/tt bo hiu cho vic AP truyn d liu cm bin c
cho PC, cn n led xanh chy /tt bo hiu cho vic AP nhn c
gi tin yu cu tham gia vo mng ca ngoi vi mi.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

34
II.2 Vai tr ca ED
- Ngay lc mi khi ng, ED bt u tm kim AP thc hin vic
kt ni. Trong khi tm kim th c hai led v xanh u tt/chy.
Khi pht hin ra mt AP, ED c gng lin kt mng c th hin
thng qua vic nhy ca led . Nu n khng th lin kt c vi
AP th led vn tip tc nhy. Mt s kt ni vi AP th tt c cc
led u tt, v ED c a n ch LMP3 nhy led trong lc
hot ng.
- ED1 thc hin cc vai tr nh th hin trn, ngoi ra chng
cn thc hin chc nng kh quan trng trong h thng l iu khin
ng c bc hot ng nhiu ch khc nhau ty theo nhit
m chng cm bin c. V sau y l m hnh m ED1 thc hin
trong h thng




Hnh 3.2 Hot ng ca ED1
- ED2 chng c iu khin bi ngi dng thng qua switch
thc hin vic gi d liu v AP khi ngi dng yu cu.
- ED3 iu khin ng c bc thng qua bn phm ca my tnh vi
s h tr ca giao din putty.
- ED4 n ED8 c cng chc nng l cm bin nhit ti ch v
gi v cho AP trong mi giy.
II.3 Mt s u khuyt im ca cu hnh mng s dng trong
h thng
- Trong ti ny chng em thc hin vic thit lp giao tip gia cc
Module theo kiu mng hnh sao c mt Module ng vai tr l AP
(HUB) l ni thu nhn d liu v gi ln PC cn cc Module cn li
ng vai tr l ED (NODE) l thit b gi d liu v cho AP.
- u v khuyt im ca mng hnh sao: so vi mt s mng khc nh:
mng hnh cy, mng peer-to-peer, mng hnh bus th mng hnh sao c
mt s u v khuyt im nh sau:
u im ca mng hnh sao:
Hot ng theo nguyn l cc nt l ngang hng nhau nn nu
Access
Point
End
Device
Mch iu
khin
ng
c bc
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

35
c mt thit b no mt nt thng tin b hng th mng vn hot
ng bnh thng.
Cu trc mng n gin v cc thut ton iu khin n nh.
Mng c th m rng hoc thu hp tu theo yu cu ca ngi
s dng.
Nhc im ca mng hnh sao:
Kh nng m rng mng hon ton ph thuc vo kh nng ca
trung tm. Khi trung tm c s c th ton mng ngng hot ng.
Mng yu cu ni c lp ring r tng thit b cc nt thng
tin n trung tm. Khong cch t my n trung tm rt hn ch (100
m). Nhn chung, mng dng hnh sao cho php ni cc my tnh vo
mt b tp trung (HUB) bng cp xon, gii php ny cho php ni
trc tip my tnh vi HUB khng cn thng qua trc BUS, trnh c
cc yu t gy ngng tr mng. Gn y, cng vi s pht trin
switching hub, m hnh ny ngy cng tr nn ph bin v chim a s
cc mng mi lp.
III. HOT NG CA GIAO DIN HIN TH

Hnh 3.3 l hnh nh tng quan ca giao din hin th kt qu c s dng trong
h thng.















Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

36





















Hnh 3.3 Giao din hin th
Chng trnh ca giao din hin th c vit trn nn C++ chng em pht
trin da trn nn chng trnh ngun m ny v dng hin th kt qu ca h
thng.
Nh chng ta thy hnh 3.3 trn th hin kt qu cp nht c t cc End
Device c t ti nhng v tr khc nhau. Thng tin th hin cc ED, AP bao
gm: nhit cm bin c ti ch (nhit chng ta c th chn la ch
l
0
C hoc F (Fahrenheit) qua vic thit lp tab trn giao din, in th, s th
t ca ED trong h thng v thi gian. phn bit c AP vi ED trn cng
giao din th chng c mu sc khc nhau. Tt c cc d liu nhn c t cc
ED c truyn ln PC thng qua ng dng UART (chi tit phn III chng
2).
Hnh nh mi tn trn giao din t ED ni vi AP ni ln khong cch t ED n
AP trong khng gian m AP o c da trn ch s cng trng RSSI
(Received Signal Strength Indication) nhn c. Chi tit v tng tab cng nh
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

37
chc nng ca chng c th hin qua hnh nh s trnh by rt c th trong
phn ph lc.
IV. PHN MM H TR IAR
Sau y l hnh nh tng quan v phn mm sau khi thc hin vic bin dch v
np cho kit eZ430-RF2500.

Hnh 3.4 Tng quan v IAR
B kit eZ430-RF2500 ca Texas Instrument c h tr cho chng ta hai phn
mm vit chng trnh cho MSP430F2274 l IAR v CCE. Nhng trong
ti ny chng ta s tm hiu v phn mm IAR. Cch vit chng trnh, bin
dch, g li v np xung kit. IAR h tr c ngn ng C v Assemler. V sau y
l nhng bc thc hin khi vit chng trnh:
- Bc 1:To mt ca s lm vic.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

38
- Bc 2: To mt project mi.
- Bc 3: Thm tp tin vo project.
- Bc 4:Ci t trc khi bin dch.
- Bc 5: Bin dch v lin kt.
- Bc 6: G li v ng dng.
Chi tit v cc bc thc hin cng nh hnh nh h tr chng ta c th tham
kho phn ph lc phn sau.
V. S MCH THC T
Sau y l s mch thc t hot ng iu khin ng c bc da trn s
iu khin t ngoi vi.





















Hnh 3.5 S mch ng dng thc t
Hot ng ca s mch trn: kit eZ430-RF2500 c th s dng ngun pin
ri nhng trong s mch trn ta cp ngun cho kit trc tip t khi ngun
3.3V, khi c cp ngun th kit hot ng iu khin ng c bc theo 4 ch
(4)
(1)
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

39
l: quay tri, quay phi, quay nhanh, quay chm da trn 4 phm n SW1,
SW2, SW3, SW4. Nu xy ra s c mt in th mch c cung cp bi ngun
nui l pin 9V, ngun pin ny c sc nu pin yu, ngc li khi pin y th
mch t ng ngt. Do mch c th hot ng tt trong lc ngun in hot
ng chnh b mt.
S mch trn bao gm 4 khi c bn, mi khi c chc nng c th c trnh
by nh sau:
- Khi th nht l khi ngun dng cung cp ngun cho ton b h thng
hot ng, khi ngun cung cp 3 ngun c bn nh sau: ngun 12V cung
cp cho mch sc pin hot ng, ngun 5V cung cp cho khi iu khin
ng c bc hot ng, ngun 3.3V cung cp cho kit eZ430-RF2500
hot ng.







Hnh 3.6 S mch ngun
- Khi th hai l khi mch sc pin dng sc ngun pin 9V khi pin yu
nhm h tr ngun khi mt in [12].












Hnh 3.7 S mch sc pin
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

40
- Khi th ba l khi kch hot mch s dng ngun nui khi h thng mt
in s dng rle.











Hnh 3.8 S mch s dng ngun nui
- Khi th t l khi thc dng iu khin ng c bc s dng IC2803














Hnh 3.9 S mch iu khin ng c bc









Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

41
CHNG IV: THIT K PHN MM

Ni dung chng IV trnh by chi tit cc phn sau:
- tng vit phn mm cho kit eZ430 RF2500.
- Lu gii thut chng trnh cho AP v ED.
- Thit lp mt s thanh ghi cho CC2500 thc hin cho vic thu
pht khng dy.
I. TNG VIT PHN MM
tng vit phn mm ti AP (Access Point) c th hin qua s trng thi
nh sau:

































Transmit data of
ED to PC
Listen for a link
and process
Timer A
delay about
1s
Setup
Read tem and vol
Process all waiting
frame
Transmit data of
AP to PC
Read signal
from ED and
process
Polling
new ED
Setup fail
Transmit
finish
Converter
finish
Receive
data
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

42
Hnh 4.1 S trng thi ca AP

u tin h thng thc hin vic khi to phn cng, chun giao tip,
mng,...nu khi to tht bi th h thng tip tc khi to li, ngc li th h
thng thc hin vic lng nghe ch kt ni mi nhm pht hin ngoi vi mun
gia nhp vo mng sau khi c ngoi vi mi th AP thc hin vic c nhit v
in th ca AP sau truyn ln PC tip theo AP i khung d liu n t ED
nu nhn c d liu th truyn ln PC hin th ln giao din sau khi kt thc
vic truyn d liu ln PC, AP tip tc lng nghe knh truyn v thc hin nh
cc bc trn.
tng vit phn mm ti AP (Access Point) c th hin qua s trng thi
nh sau:
























Hnh 4.2 S trng thi ca ED

u tin h thng thc hin vic khi to phn cng, chun giao tip,
mng,...nu khi to tht bi th h thng tip tc khi to li, sau khi thc hin
khi to thnh cng th thc hin vic cm bin nhit v chuyn i in th
sau gi nhit v in th v cho AP tip theo s iu khin ng c hot
ng ri quay thc hin cc vic theo tun t nh trn.
Setup
Read temp and
vol
Send data to
AP
Control step
motor
Scan key and read temp
ED go to sleep (used for delay
control step motor)
Delay about 1s

Not enough 1s
enough 1s
Setup fail
Successful
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

43
Hnh 4.2 S trng thi ca AP

II. LU GII THUT CA CHNG TRNH
Th hin qu trnh m chng trnh hot ng.
II.1 Lu cho AP (Access Point )
M t mt cch tng qut qu trnh AP thc hin vic khi to mng, lng nghe
lin kt, x l khi c ED tham gia vo mng v thu nhn d liu t cc ED trong
h thng mng c thit k v truyn d liu ny ln PC.
BSP_Init ( ) SimpliciTI API gi cc chng trnh con thch hp thit lp cc
thng s cho MSP430, CC2500 v cc phn cng c th trn mch nh
Switches/Led trong cc ng dng. Sau khi khi to phn cng, AP v ED trong
mng cm bin khng dy to ra mt a ch ngu nhin 4-byte, v sau ghi a
ch ngu nhin ny vo b nh flash ti s dng trong vic thit lp li h
thng. K t khi mt giao thc SimpliciTI AP nhn dng thit b mi trn mng
bng a ch thit b ca chng, lu tr ny ngu nhin to ra a ch trong flash
v s kim tra a im ny c thc hin trc lc khi to thit b, m bo
rng mt ED m b mt in hay c t li l lun lun c nhn bit
ging nh cc thit b khc (c cho l lin kt cng ID). Cc a ch ngu
nhin c to ra bng cch s dng cc kt qu t cc hm
TI_getRandomIntegerFromVLO v bn trong cc th vin vlo_rand.s43.
MCU_Init ( ) c chc nng khi to thm cc ch hot ng c th ca
MP430 cho cc ng dng giao tip gia kit vi PC. Chng bao gm:
Cc DCO v MCLK c thit lp hot ng ti tn s 8 MHz.
Timer_B c thit lp kch hot ngt 1 giy 1 ln.
Giao din truyn thng ni tip (USCI) UART c khi to giao tip vi
my PC thng qua cng COM tc 9600 Baud v RX / TX: ngt kch
hot.
Sau khi khi to phn cng hon tt, cc gi tr tham s TI c chuyn n
cng COM truyn ln PC v chng trnh gi hm SMPL_Init (sCB) khi to
cc giao thc mng. Tham s sCB l mt hm con tr tr n mt hm callback
c thc thi trong thng trnh phc v ngt (ISR) trong lc tip nhn gi tin
ca AP. Con tr sCB gi hm lc cc gi tin nhn c theo lin kt ID ca n
xc nh ngun gc ca ni truyn v phn bit cc gi d liu t mt ED
thnh lp mt kt ni vo mng truyn n. Mt lin kt ID 0, nhn dng mt
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

44
yu cu tham gia. Sau khi chp nhn yu cu tham gia ca mt ED. AP lit k
cc thnh vin mi vo mng v tng lin kt ID t 0x01 n 0x1D v gn cho
cc ED. Mt lin kt ID t 0x01 n 0x1D xc nh vic tip nhn ca mt
gi t mt trong nhng mng li ca ED.Giao thc mng SimpliciTI cho php
h tr mc gii hn 30 thit b EDs c ni n AP mang cc gi tr lit k t
0x01 n 0x1D. Tuy nhin, cm bin khng dy Monitor v1.02 cho php s
lng ti a l tm ED c ni n AP. T cc lin kt ID, chc nng ca hm
sCB s xc nh v tng tng ng sPeerFrameSem [aphore] hay sJ oinSem
[aphore] x l trong vng lp chnh ca chng trnh. AP cng c nh
ngha mt m sSelfMeasureSem [aphore], do Timer A c lp trnh cho ngt
mt ln trong mt giy t cc AP s ly mu nhit v hiu in th pin
ring n sau s c cp nht hin th ln PC. l ba semaphores kim
sot hot ng chng trnh sau khi khi to mng. Chng ta nn lu c bit
cc gi tr tr v ca hm sCB. Tr li gi tr ln hn s khng bo cho giao thc
SimpliciTI bit cc chc nng callback x l khung nhn c v gii phng
b nh cho vic ti s dng. Hm sCB trong demo_AP.c tr v s khng, v phn
firmware nhn c trong b m u vo s c x l bi ng dng. Khi mt
thit b d kin s duy tr v s cc lin kt n cc ng dng khc / nt trong
mng, n cn gi m s c th trong ISRs nh gim thiu nguy c mt gi tin
v thng bo.
















Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

45


































Overwrite device address and
Initialize MSP430
Transmit splash
screen and
" Initializing Network"
Initialize network
SMPL_Init(sCB)
sJoinSem,
sSelfMeasureSem,
or sPeerFrameSem?
sNumCurrentPeers++;
Decrement joi n
semaphore
Read temperature
(ADC10)
Format ADC10 samples
into a message
for transmission
Transmit message to PC
Define input
message buffer
Read voltage
(ADC10)
Process all waiting
frames
Listen for a link
SMPL_LinkListen()
sJoinSem
sSelfMeasureSem
sPeerFrameSem
Initialize
radio
Address already
written into flash?

NO
Create random address
(TI_getRandomIntegerFromVLO)
and write address to flash


Retreive device address from flash

YES
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

46
Hnh 3.1 Lu gii thut ca AP
31

II.1.1 Nhnh sJoinSem
Semaphore sJoinSem trong demo_AP.c c thit lp khi ED gi hm
SMPL_Init( ), n th hin s n lc khi mun tham gia vo mng. Khi ED gi
hm ng dng SMPL_Init( ) th SimPliTi s gi khung tham gia vo mng vi
lin kt 0, thng tin cho AP tng semaphore sJoinSem. Khi sJoinSem [aphore]
c AP thit lp, v s lng cc ED t hn s lng ti a ca cc lin kt
(nh quy nh ti smpl_config.dat), th AP s khi to SMPL_LinkListen(). Hm
SMPL_LinkListen( ) c chc nng l mt con tr vo lin kt ID c s dng
xc nh tt c cc tin nhn t ED yu cu lin kt. Hm SMPL_LinkListen ( )
l mt hm chn cuc gi, c ngha l n s khng tr li cc ng dng cho n
khi mt lin kt thnh cng c to ra. Do , iu quan trng l cc
SMPL_LinkListen ( ) ch c gi v thc hin khi ngi dng bit mt thit b
khc c nhng yu cu lin kt bng cch s dng chc nng ca hm
SMPL_Link ( ). Khi mt lin kt c to thnh cng, nhnh sJ oinSem s tng
ln mt n v bo cho AP c thm mt thit b tham gia vo mng.
II.1.2 Nhnh sPeerFrameSem
Semaphore sPeerFrameSem l s c tng mi khi AP nhn c mt khung d
liu t cc nt mng. u tin AP s nh ngha mt b m tin dng lu tr
cc khung d liu hin ti ang c phn tch v sau vng qua hng i ng
vo tm kim tin cho n khi x l tt c cc khung hng i.

31
Slaa378B Wireless Sensor Monitor Using the eZ430-RF2500, trang 5.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

47
Hnh 3.2 S nhnh sPeerFrameSem
32

II.1.3 Nhnh sSelfMeasureSem
sSelfMeasureSem [aphore] l semaphore cho cc ng dng c th .Ngi s
dng s t mt khong thi gian quy nh thc thi mt ng dng cn thit.
Trong chng trnh nhnh sSelfMeasureSem sau mi mt giy s thit lp cho b
ADC10 c cc d liu nhit t cm bin nhit c tch hp trong chp,
hiu in th ca ngun nui ng thi x l cc d liu ng khung s dng
giao thc SimpliciTI RF pht hoc truyn ln PC.

32
Slaa378B Wireless Sensor Monitor Using the eZ430-RF2500, trang 8.
for (i = 0; i < sNumCurrentPeers; ++i)
Create a message buffer
to strore incoming frame

Received a message from activeLinkIDs[i]?


Main program loop

Received a message from
activeLinkIDs[i]?

Transmist RSSI data and
message to the PC

Toggle LED to indicate message
receipt and decrement
sPeerFrameSem[aphore]

i ==sNumCurrentPeers
NO
YES
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

48
II.2 Lu cho ED (End Device)
M t mt cch tng qut qu trnh ED hot ng gi lin kt tham gia vo mng
cng nh thc hin vic gi d liu cm bin c cho AP.



























Hnh 3.3 Lu gii thut cho ED
33

Vic thit lp cho ED cng tng t nh cho AP dng hm SMPL_Init( ) khi
to cho mng. Th tc khi to l khc nhau cho cc ED trong hai bc quan
trng l: mt l vic to a ch thit b trong khi hot ng v tham s truyn cho

33
Slaa378B Wireless Sensor Monitor Using the eZ430-RF2500, trang 9.
Address already Enter
LPM3 until timer
interrupt written into
flash?

Create random address Read
battery voltage
(TI_getRandomIntegerFromVLO)
Initialize
radio
BSP_Init()

Retrieve device address
from flash
Read battery voltage
(ADC10)
Overwrite device address and
Initialize MSP430


Initialize/join network
SMPL_Init((uint8_t(*)(linkID_t))0)

Format ADC samples
for transmission

Link to Access Point
SMPL_Link()

Send data to AP
SMPL_Send()

Read temperature
(ADC10)

Enter LPM3 until
timer interrupt
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

49
cc hm SMPL_Init ( ). Trong ng dng ny ta to ra mt a ch 4-byte ngu
nhin, vit a ch vo b nh flash c s dng li khi h thng khi ng
li, bi v AP nhn dng ED mi trn mng thng qua a ch ngoi vi ca chng,
v lu a ch ny vo b nh flash v kim tra a ch ny trc khi khi to ED
m bo l cc ED khng c cp ngun hoc khi ng li lun c nhn
dng l nh nhau bi AP. a ch ngu nhin c to ra bng cch s dng cc
kt qu t bn trong chc nng ca hm TI_getRandomIntegerFromVLO th
vin file vlo_rand.s43 cung cp. Th vin ny s dng cc cnh ln ca xung dao
ng tn s thp ca ngoi vi kch hot ly mu ng h h thng v sau
c din gii thnh mt a ch thit b 4-byte. Bng cch thay i tn s xung
gia hai ln kch hot, cc kt qu ngu nhin ca cc a ch ca thit b c
tng ln, v ta c th m bo rng hai ngoi vi s khng to ra a ch ging
nhau trong cng mt mng. Cc ED s hot ng mi giy mt ln giao tip
vi nhit mi trng ngun in p ca pin ly mu x l d liu gi v
cho AP. Cc EDs khng nhn c tin nhn t nhau.
III. KHI TO CHO CC2500
thc hin vic truyn thng qua khng gian ta thc hin mt s ci t sau:
Vi dao ng 26-MHz.
III.1 Thi t lp tc d liu
Vic thit lp ny c thc hin thng qua thanh ghi MDMCFG4 (c a ch
0x10) v thanh ghi MDMCFG3 (c a ch 0x11) nh sau:
Ta nh ngha MDMCFG4 = 0x2D v MDMCFG3 =0x3B v c cu trc ca
thanh ghi nh sau:
0 0 1 0 1 1 0 1

Bit Field Name ngha ca cc i lng
7:6 CHANBW_E [ 1:0]
5:4 CHANBW_M[1:0] Dng tnh bng thng knh.
3:0 DRATE_E[3:0] Dng cho vic tnh tc d liu.

0 0 1 1 1 0 1 1

Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

50
Bit Field Name ngha ca cc i lng
7:0 DRATE_M[7:0]

Da trn nhng s liu thit lp trn ta tnh c tc d liu nh sau:











Bng thng lc knh: cng c thit lp thng qua 2 thanh ghi trn v ta c
cng thc nh sau:


III.2 iu ch
Vic iu ch c thit lp thng qua thanh ghi MDMCFG2 (c a ch 0x12),
ngoi nhim v iu ch thanh ghi trn cn cho php ta thit lp vic m ha/gii
m MANCHESTER v xc nh chiu di ca t ng b (sync word).
Ta nh ngha MDMCFG2 = 0x73 v c cu trc ca thanh ghi nh sau:
1 1 1 1 0 0 1 1

Bit Field Name ngha
7 DEM_DCFILT_OFF
6:4 MOD_FORMAT[2:0] Setting Modulation
0(000) FSK
1(001) GFSK
( ) ( )
kbps x
x
f
M DRATE
R
XOSC
E DRATE
DATA
250 10 . 26
2
2 59 256
.
2
2 . _ 256
6
28
13
28
_
=
+
=
+
=
(

|
|
.
|

\
|
=
XOSC
DATA
f
R
E DRATE
20
2
2 .
log _
256
2 .
2 .
_
_
28
=
E DRATE
XOSC
DATA
f
R
M DRATE
( ) ( )
kHz
x x M CHANBW
f
BW
E CHANBW
XOSC
channel
540
2 2 4 8
10 . 26
2 . _ 4 . 8
0
6
_
~
+
=
+
=
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

51
..
3(011) OOK
. ..
.. ..

7(111) MSK
3 MANCHESTER_EN 0 =Khng cho php
1 =Cho php
2:0

SYNC_MODE[2:0] Setting Sync-word
0(000) no preamble/sync
1(001) 15/16 sync word
.......................................
3(011) 30/32 sync word


III.3 Gii thut cho vic kim tra FEC (Forward Error Check)
c thit lp thng qua thanh ghi MDMCFG1 (c a ch 0x13)

Ta nh ngha MDMCFG1 = 0x22 v c cu trc ca thanh ghi nh sau

0 0 1 0 0 0 1 0
Bit Field Name ngha
7 FEC_EN 0 =Khng cho php
1 =Cho php
6:4

NUM_PREAMBLE[2:0] Thit lp S bytes m u
0(000) 2
1(001) 3
2(010) 4
-------
6(110) 16
7(111) 24
3:2 Reserved
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

52

Trong thanh ghi ny ta cng c th quyt nh c s byte preamble
trong gi tin da vo vic thit lp thanh ghi ny bit 6:4. Ty theo ta t gi tr
cho bit v tr 6:4 m s byte preamble c th l 2, 4, 6,
III.4 Khong cch knh truyn
c thit lp mt phn thng qua thanh ghi MDMCFG0 (c a ch l 0x14)
Ta nh ngha MDMCFG0 = 0xF8 v c cu trc ca thanh ghi nh sau:
1 1 1 1 1 0 0 0

Bit Field Name ngha
7:0 CHANSPC_M[7:0] Gip ta xc nh c
khong cch knh
truyn.
Cng thc nh sau:




Vi cc bit CHAN c thit lp thng qua thanh ghi CHANNR (a ch 0x0A)
c gi tr nh sau:

1 1 1 0 1 0 1 1

III.5 Thit lp tn s sng mang
Thng qua 3 thanh ghi FREQ2 (c a ch 0x0D), FREQ1 (c a ch 0x0E),
FREQ0 (c a ch 0x0F) nh sau: FREQ2 =0x5D, FREQ1 =0x93, FREQ0 =
0xB1
0 1 0 1 1 1 0 1



1:0 CHANSPC_E[1:0] Phc v cho vic tnh khong cch knh
1 0 0 1 0 0 1 1
1 0 1 1 0 0 0 1
( )
( ) . 47 235 2 248 256
2
10 . 26
. 2 . _ 256
2
2
18
6
_
18
Mhz x x
CHAN M CHANSPC
f
f
E CHANSPC XOSC
CHANNEL
~ +
= + = A
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

53

Ta c cng thc tnh tn s sng mang l s kt hp ca 3 thanh ghi trn nh
sau:


III.6 Thit lp nh dng gi tin
Ta thit lp thanh ghi PKTCTRL0 (c a ch 0x08) ny cho php chp c
thc hin kim tra CRC ( ) hay khng v xc nh thuc tnh ca gi tin. Ta nh
ngha PKTCTRL0 = 0x05 v c cu trc ca thanh ghi nh sau:


III.7 Chi u di gi ti n
c thit lp thng qua thanh ghi PKTLEN (c a ch 0x06)
Ta nh ngha PKTLEN = 0xFF v c cu trc ca thanh ghi nh sau:

0 0 0 0 0 1 0 1
Bit Field Name ngha
2 CRC_EN 1:tnh ton CRC trn Tx v cho php kim tra CRC
trn Rx
0:Khng cho php
1:0

LENGTH_CONFIG[1:
0]
Setting Packet length configured
0(00) C chiu di c nh
1(01) C chiu di thay i
2(10) C chiu di v hn
3(11) Ginh ring
1 1 1 1 1 1 1 1
Bit Field Name ngha
7:0

PACKET_LENGTH Ch ra chiu di gi tin khi ta chn ch
gi tin c chiu di c nh hoc l
chiu di ti a ca gi tin khi ta chn gi
tin c chiu di thay i.
| | Mhz x xFREQ
f
f
XOSC
carrier
2433 6132657
2
10 . 26
0 : 23
2
16
6
16
~ = =
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

54

Thit lp thanh ghi PKTCTRL0 (c a ch 0x08) = 0x05

0 0 0 0 0 1 0 1

Hai bit 1:0 l LENGTH_CONFIG[1:0] cu hnh chiu di gi tin, ta t 01 tc
chiu di gi tin c th thay i v chiu di gi c t sau t ng b.
Hai bit 5:4 nh dng d liu trong truyn v nhn, ta t 00 tc dng ch
thng l dng FIFO cho TX v RX.
III.8 Kim tra a ch ca gi tin
c thit lp thng qua thanh ghi PKTCTRL1 (c a ch 0x07)
Ta nh ngha PKTCTRL1 = 0x04

Hai bit 1:0 cho php ta cu hnh kim tra a ch ca gi tin nhn ta t 00 tc
l khng cho php a ch ca gi tin nhn.
Bit 2 khi ta a ln mt l cho php thm vo 2 bytes trng thi ca RSSI v
LQI trong phn d liu cn truyn (payload of the packet).

Bng m t thng s ca qu trnh truyn khng dy thit lp tc 250 kBaud















0 0 0 0 0 1 0 0
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

55
Bng 1 Thng s truyn
34

KT LUN V KIN NGH


Sau y l mt s cng vic m chng em thc hin trong qu trnh
nghin cu ti nh:
- S lc v kit eZ430-RF2500.
- Tm hiu v vi iu khin MSP430F2274 v IC thu pht khng dy
CC2500.
- Tm hiu phn mm IAR thc hin vic vit chng trnh.
- Vit chng trnh iu khin ng c bc.
- Pht trin giao din hin th trn source ngun m.
- Tm hiu v cc chun giao tip SPI v UART.
- Thit k phn cng phc v cho yu cu ca ng dng.
- V mch s dng phn mm Orcad.
- Thc hin kho st hot ng ca h thng c thit k trong thc
t.
I. KT QU

Sau thi gian thc hin lun vn, chng em t c mt s kt qu sau:
- Ci t h thng bao gm 1 AP giao tip vi PC v 8 ED.
- Giao tip thnh cng trong mng hnh sao.
- H thng t ng cp nht d liu t cc ED, sau truyn n
trung tm mi giy mt ln hoc khi c yu cu.
- nh thi cho vic truyn d liu ca ED v trung tm AP.
- Cp nht thi gian thng xuyn cc gi tr ca tng thit b.
- Sao lu d liu di dng file text.
- Phn cng c thit k hot ng kh tt.
H thng thit k c kho st kh nng hot trong iu kin khong cch thay
i. Do h thng hot ng da trn vic thu pht khng dy nn vn v vt
cn trong mi trng truyn c nh hng kh r nt n s hot ng ca h
thng, khi trong mi trng truyn c nhiu chng ngi nh: bc tng, knh,

34
Texas Instrument , SWR040C.pdf Trang 10.
Lun vn tt nghip in t
Pht trin ng dng trn kit eZ430 RF2500 Trang

56
ta nh, cy ci,.th kh nng thu nhn d liu ca trung tm AP t cc ngoi
vi ED xung quanh gim i ng k, ngc li khi h thng hot ng trong mi
trng truyn thng LOS (Line Of Sigth ) th kh nng nhn tn hiu t AP n
ED gi v l kh tt. Kho st thc t nh sau:
- Trong mi trng c vt cn th khong cch nhn tn hiu ca AP t cc
ED xung quanh l s 10 mt.
- Trong mi trng khng c vt cn LOS th khong cch nhn tn hiu t
AP n cc ED xung quanh l > 40 mt v s 50 mt.

II. KT LUN
H thng thit k hot ng trong thc t kh tt trong iu kin khong cch
t AP n ED l nh hn 10 mt trong mi trng c vt cn, nu trong mi
trng truyn khng vt cn th khong cch gia chng l ln hn 40 mt v
nh hn 50 mt. Hot ng cm bin c nhit ca mi trng l -40
0
C
s t s 85
0
C, ngc li h thng s khng hot ng hoc hot ng khng n
nh.
p ng c yu cu t ra l thit k c mt h thng c bn thu thp
nhit gia my tnh (PC) trung tm v cc thit b t xa bng khng dy .
III. HNG NGHIN CU TIP THEO CA TI
- Lp trnh pht trin tip cc cu hnh mng: hnh cy v mt li.
- Xy dng h thng c tnh t chc, cng ng, gim st, bo
ng,nh: ngi nh thng minh . Gim st v iu khin cc thit b
trong trng hc, cc khu cng nghip,.. Bo ng mt cch linh hot cho
cc h thng cn c s an ton cao da vo tnh cu trc mng ca n ( hnh
sao, hnh cy, mt li ).
- Xy dng gii thut o khong cch t ED n AP da vo ch s cng
trng RSSI.
- Lp trnh iu khin ED (End Device) hot ng tng tc vi AP (Access
Point).