Title: TinyOS ??? ? nesC Programming
1TinyOS ??? ? nesC Programming (USN ?? ?? ??)
(?) ED
2?? ??
1
TinyOS? ??
2
TinyOS? ??
3
TinyOS Programming Environment Setting
4
TinyOS Programming
Lesson 1
Blink LEDs
Lesson 2
Sensor Acquisition
Lesson 3
Task Programming
Lesson 4
Send Receive Message using RF
Lesson 5
How to debug
Lesson 6
Data Display on PC
Lesson 7
Command to node Broadcasting
Lesson 8
Saving data
3TinyOs? ??
USN??? USN?? ???? ??? ??? ??? ???? ??? ??, ??, ??? ???? ?? ???? ?? ????? ??? ????? ???. ?? ?? ??? ?? Zigbee ??? ?? ????? ?? ??? ?? ??? ???? ??? ?? ??? ? ?? ???. ? ? ??(?? ??)? ???? ??? ??? ????? ?? RFID ??? ?? ??, ?????? ?? ???? ??? ??? ?? ??? ?? ??. ???? ?? USN? ?? ?? ???? ????? ??? ????? ??? ???? ???? ?? ?? ???? RFID? USN? ????? ??? ????? ??, ???? ??? ?????? ?? ????? ????? ?? ??. ???? 2010??? ? ??? 3?994??(?? 2?974??)? ?? ?? ?? ???? ?? ???????? ? 2?4?634?? RFID/USN ????? ??? ????.
4TinyOS? ??
5TinyOS? ??
6TinyOS? ??
7TinyOS? ??
8TinyOS? ??
9TinyOS? ??
Download
Windows ??
http//www.tinyos.net ???? ??
10TinyOS? ??
http//www.tinyos.net/dist-1.1.0/tinyos/windows/?
type.
11TinyOS? ??
Tinyos-1.1.11-3is.exe ? ??????.
12TinyOS? ??
?????? ??
??? ??
???? ??
13TinyOS? ??
Next
Next
14TinyOS? ??
Cygwin ??? ??? TinyOS? ????.
Continue
15TinyOS? ??
?? ?? ??? ??? ?? ?? ???? ??.
16TinyOS? ??
??? ???? ????? ???? ????,
?? ??? ??? ?? ????.
Windows Explorer?? ???? Program Files ??? ?? UCB
??? ???? ??.
17TinyOS? ??
TinyOS ?? ??
????? Cygwin ????? ????.
18TinyOS? ??
AVR Studio? ?? (Download? ??)
Astudio????.
www.atmel.com ? ????.
AVR Studio 4.12(build 460)? ????.
19TinyOS? ??
AVR Studio? ?? (Download? ??)
Next
I agree? Next
Next
20TinyOS? ??
AVR Studio? ?? (Download? ??)
Next
21TinyOS Programming Environment Setting
ED-ZigNet Porting
??? USN? ??? ???? ?? ???? ??? ?? ?? USN ???? ????
??. ? ???? Line-Up? ?? ??? ??.
Mote Name ?? Clock CPU Flash (Code KB) RAM (KB) Radio (kBaud) Radio Type
WeC 1999 4MHz Atmel 8 0.5 10 RFM
RENE 2000 4MHz Atmel 8 0.5 10 RFM
DOT 2001 4MHz Atmel 16 1 10 RFM
MCA 2002 4MHz Atmel 128 4 40 RFM
MICA2 2003 7MHz Atmel 128 4 40 Chip Con
iMote 2003 12MHz ARM 512 64 460 Zeevo Con
btNode 2003 12MHz Atmel 128 4 460 Enicsson BT
Telos 2004 20MHz Motorola 60 4 250 ZigBee
MICAz 2004 7MHz Atmel 128 4 250 ZigBee
22TinyOS Programming Environment Setting
ED-ZigNet Porting
??? ?? USN Platform?? ?????. ? ? ED-ZigNet? ??
??? ??? Micaz Platform? ???? ??. ??? platform?
????? ?? ????, Microprocessor ?? ????? ?? ???.
??? Microprocessor ??? CC2420 chip(ZigBee Chip)?
?????? Sensor? ?? ?? Micaz? ???. ???
ED-ZigNet?? Porting? ??? ???. ??? porting ???
Hardware? ??? ??????? ???? ??? ? ? ??. ??? ???
???? ????, ?? ??? CD? TinyOS ??? ??????
ED-ZigNet? Porting ??? ??? ??.
23TinyOS Programming Environment Setting
ED-ZigNet Porting
24TinyOS Programming Environment Setting
ED-ZigNet Porting
TinyOS ??? ????.(C\Porgram Files\UCB\Cygwin\opt\)
25TinyOS Programming Environment Setting
ED-ZigNet Porting
?? ?(A)
26TinyOS Programming - 1
Lesson 1 Blink LEDs
Blink LEDs
?? ??? ????? ?? ?? ?? ?? ??? ? ????. ??? ?,???
???? ??? ?? ????. ED-ZigNet?? ????? ? ?? LED?
??? ??. ?? ?? LED? ????? ????? ??? ??? ??.
27TinyOS Programming - 1
Lesson 1 Blink LEDs
Program Coding
Windows Explorer? ???? C\Program
Files\UCB\Cygwin\opt\tinyos-1.x\apps\ZigNet1\Blink
? ????.
28TinyOS Programming - 1
Lesson 1 Blink LEDs
Blink? Configurature ??
Blink? Module ??
Blink.nc BlinkM.nc SingleTimer.nc??? ??
29TinyOS Programming - 1
Lesson 1 Blink LEDs
Ultra Editor? ???? ???? ??? open??. ??? source?
????. Source ??? Text Editor? ????
????. Notepad? ???? ??? open? ?? source? Linux
???? ??? ???? ?? ?? ??. Text Editor tools?
????? ????.
30TinyOS Programming - 1
Lesson 1 Blink LEDs
Compile
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
31TinyOS Programming - 1
Lesson 1 Blink LEDs
Compile
Blink ??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/
Blink/
32TinyOS Programming - 1
Lesson 1 Blink LEDs
Compile
??? ??. make micaz
33TinyOS Programming - 1
Lesson 1 Blink LEDs
Download
??? Compile ? ???? ????. cd build/micaz
??? ????.
??? ??? Display??.
???? ??? ? ???? ?????.
??? ED-ZigNet? ???? ? ??? main.ihex????.
34TinyOS Programming - 1
Lesson 1 Blink LEDs
Download
AVR Studio? ????.
35TinyOS Programming - 1
Lesson 1 Blink LEDs
Download
Tools - Program AVR Connect ? ????.
36TinyOS Programming - 1
Lesson 1 Blink LEDs
Download
Programmer Device? ????.
Device? ??? Com PORT? ????. ????? Auto? ????
JTAG ICE
37TinyOS Programming - 1
Lesson 1 Blink LEDs
Download
Device? ????. ATmega128
Flash ? ? ???
38TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Sensor Acquisition
??? Lesson 1?? LED? ???? ?? ?? ?????. ?? ?????
??? ??? ????? ??? ?? ????? ??. S/W? ??? ???? ???
???? USN?? ???? ?? ??? ?????. ???? ?????????
???? ?? ???? ??? 0 ?? 1? ??? ??? ?? ? ? ??. ????
cds? ??? ?? ?? ???? LED? ??? Display?? ??? ??
????.
39TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Program Coding
Windows Explorer? ???? C\Program
Files\UCB\Cygwin\opt\tinyos-1.x\apps\ZigNet1\Sense
? ????.
40TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Program Coding
Sense? Configurature ??
Sense? Module ??
41TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Compile
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/Sense
42TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Compile
make micaz ? ????.
43TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Compile
Compile? ????.
Build/micaz ??? ????.
??? ????.
Main.ihex ??? ????
44TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Download
AVR Studio? ????.
45TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Download
Tools - Program AVR Connect ? ????.
46TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Download
Programmer Device? ????.
Device? ??? Com PORT? ????. ????? Auto? ????
JTAG ICE
47TinyOS Programming - 2
Lesson 2 Sensor Acquisition
Download
Device? ????. ATmega128
Flash ? ? ???
48TinyOS Programming - 3
Lesson 3 Task Programming
Task Programming
??? Lesson 2?? cds? ?? ??? ???? LED? ????
Display?? ??? ?? ?????. ? ??? ??? ?? ??? ???? ??
Display?? ????. ? ????? Event? ?? ? ?? ??? ??
????. ?? Lesson 3??? ??? ??? ??. ?? ?????
Event? ?? ?? ???? ?? ??? Timer? ?? ?? ???? ????
??? Display?? ??? ????? ??. ??? ?? Task??.
49TinyOS Programming - 3
Lesson 3 Task Programming
Program Coding
Windows Explorer? ???? \opt\tinyos-1.x\apps\Zi
gNet1\Sensetask ? ????.
Sense Task? Module??
Sense Task? Configuration??
50TinyOS Programming - 3
Lesson 3 Task Programming
Compile
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/SenseTa
sk
51TinyOS Programming - 3
Lesson 3 Task Programming
Compile
??? ????
Compile??.
52TinyOS Programming - 3
Lesson 3 Task Programming
Compile
Compile
Compile? ????.
Build/micaz ??? ????.
??? ????.
Main.ihex ??? ????
53TinyOS Programming - 3
Lesson 3 Task Programming
Download
AVR Studio? ????.
54TinyOS Programming - 3
Lesson 3 Task Programming
Download
Tools - Program AVR Connect ? ????.
55TinyOS Programming - 3
Lesson 3 Task Programming
Download
Programmer Device? ????.
Device? ??? Com PORT? ????. ????? Auto? ????
JTAG ICE
56TinyOS Programming - 3
Lesson 3 Task Programming
Download
Device? ????. ATmega128
Flash ? ? ???
57TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Send Receive Message Using RF
??? Lesson 3?? ????? ??? ?? ?? LED? ?? ???? ??
?? ?????. ?? ??????? ??? ?? RF(Radio Frequency)?
?? ????? ??. RF? ?? ??? ????, ??? ?? ??? LED?
display?? ??? ??? ??. ????? ??? ?(Transmission)?
?? ?(Receive)? ? ?? Programming ? ????.
58TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Program Coding - Transmission
Windows Explorer? ???? \opt\tinyos-1.x\apps\Zi
gNet1\CntToLedsAndRfm ? ????.
CntToLedsAndRfm? Configuration Module ??
59TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Compile - Transmission
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/CntToLe
dsAndRfm
60TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Compile - Transmission
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/CntToL
edsAndRfm/
????? ??? ??. ls
?????. make micaz
61TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Transmission
AVR Studio? ????.
62TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Transmission
Programmer Device? ????.
Device? ??? Com PORT? ????. ????? Auto? ????
JTAG ICE
63TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Transmission
Device? ????. ATmega128
Flash ? ? ???
64TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Program Coding - Receive
Windows Explorer? ???? \opt\tinyos-1.x\apps\Zi
gNet1\RfmToLeds ? ????.
RfmToLeds? Configuration Module ??
65TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Compile - Receive
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/RfmToLe
ds
66TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Compile - Receive
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/RfmToLe
ds
??? ?? ??. ls
67TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Compile - Receive
??? ??. make micaz
68TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Receive
AVR Studio? ????.
69TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Receive
Programmer Device? ????.
Device? ??? Com PORT? ????. ????? Auto? ????
JTAG ICE
70TinyOS Programming - 4
Lesson 4 Send Receive Message using RF
Download - Receive
Device? ????. ATmega128
Flash ? ? ???
71TinyOS Programming - 5
Lesson 5 How to debug
How to debug
??? Lesson 4?? ????? ??? ??? RF? ??? ? ?? ????
LED? ??? Display?? ???? ?????. ???? ???? ? ?
Source? ?? ??? ??? ???? ?????. ??? ??? TinyOS?
???? ???? ??? ? ???? ??? ??? source?? ??? ????
???. ??? ??? ??? Programming? ??
??. Programming ? node? Download?? ??? ??????
???? ???? ???. ??? ??? ??? ???? Simulation?? ???
????. Simulation? PC? ??? ???? node? ???? ? ?
??.
72TinyOS Programming - 5
Lesson 5 How to debug
Program Coding
Windows Explorer? ???? \opt\tinyos-1.x\apps\Zi
gNet1\TestTinyViz ? ????.
73TinyOS Programming - 5
Lesson 5 How to debug
Compile
????? Cygwin ???? ????. (??-Program-Cygwin-Cygwin
Bash Shell)
74TinyOS Programming - 5
Lesson 5 How to debug
Compile
??? ????. cd /opt/tinyos-1.x/apps/ZigNet1/TestTi
nyViz
??? ??? ????. ls
75TinyOS Programming - 5
Lesson 5 How to debug
Compile
????? (make micaz ? ?? make pc??) make PC
76TinyOS Programming - 5
Lesson 5 How to debug
Compile
??? ???? ??? ????.
77TinyOS Programming - 5
Lesson 5 How to debug
Simulation
???? ??? Cygwin? ?? ? ??
78TinyOS Programming - 5
Lesson 5 How to debug
Simulation
??? Cygwin? java ??? ????. cd
/opt/tinyos-1.x/tools/java
??? sim??? ????. cd net/tinyos/sim
79TinyOS Programming - 5
Lesson 5 How to debug
Simulation
Java? ?????.. make
??? GUI (Graphic User Interface) debug tools?
?????. ? tinyviz? Cygwin ?????? ? ? ??? /bin ???
copy??.
80TinyOS Programming - 5
Lesson 5 How to debug
Simulation
Windows Explorer? ???? sim ??? ????.
Tinyviz ? ????.
81TinyOS Programming - 5
Lesson 5 How to debug
Simulation
Windows Explorer? ???? bin ??? ????.
??? tinyviz? ?????
?? Cygwin ????? tinyviz? ?? ?? ? ??
82TinyOS Programming - 5
Lesson 5 How to debug
Simulation
? ?? Cygwin ??? ??? ? TestTinyviz? ?? ????
??? ? ???? ????.
30?? node? Simulation ??. ./main.exe gui 30
83TinyOS Programming - 5
Lesson 5 How to debug
Simulation
? ?? Cygwin?? ???? TinyViz ??? ????.
84TinyOS Programming - 5
Lesson 5 How to debug
Simulation
TinyViz ????? ?? ???.
85TinyOS Programming - 5
Lesson 5 How to debug