130 likes | 219 Views
Introduction to Wireless Sensor Networks. TinyOS Overview 10 February 2005. Organizational. Class Website. www.engineering.uiowa.edu/~ece195/2005/. Class Time. Office Hours. Think Back – Mote Subsystems. Flash. RAM. Power Management. I/O. ALU. MCU Components. Memory. Flash.
E N D
Introduction to Wireless Sensor Networks TinyOS Overview 10 February 2005
Organizational Class Website www.engineering.uiowa.edu/~ece195/2005/ Class Time Office Hours
Flash RAM Power Management I/O ALU MCU Components
Memory Flash registers RAM scratch stack
Compile-Link Cycle • Compilation - translate high-level language to assembly language • Assembly – translate assembler into machine language • LOOP: • MOV AX,0x02 • LJMP _printf • DEC AX • JNZ LOOP for (i=0;i<=2-1;i++) printf(“%d\n”,i); • LOOP: • MOV AX,0x02 • LJMP _printf • DEC AX • JNZ LOOP • 00101001 • 01000101 • 11100101 • 10001001 • … LJMP _printf
Linking Our code • 00101001 • 01000101 • 11100101 • 10001001 • … Image LJMP _printf • 00101001 • 01000101 • 11100101 • 10001001 • … • 00101011 • 01000111 • 11100101 • 10101001 • … Libraries Linker • 00101011 • 01000111 • 11100101 • 10101001 • … _printf OS services • 00101011 • 01000111 • 11100101 • 10101001
Compile Write Code (editor) Program Mote Assemble (programmer, ISP, serial, etc.) Link Test Modify Code Program Development Cycle
Programming Mote • Downloading binary image into device • Connect to programmer • Run programming software
TinyOS Tutorial • Website: • http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson1.html • Concept: nesC • OS, Libraries, and Applications are written in nesC • C-like language • Compiler: ncc • Concept: components
TinyOS Tutorial • Concept concurrency model • Executes only one program • Two threads • Tasks • Hardware event handlers • Task • Functions. Once scheduled, runs to completion. No preemption. • Hardware event handlers • Run to completion, may preempt execution of functions or other event handlers • async keyword • nesC code are susceptible to race conditions
Think of as “bind to”. The left side binds an interface to an implementation on the right Components that uses interface Components that provides interface Application: Blink configuration Blink {}implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl -> SingleTimer.StdControl; BlinkM.Timer -> SingleTimer.Timer; BlinkM.Leds -> LedsC;}
Homework • Tiny OS Tutorial • Monday • Demo in Sensors Lab in IIHR WTA • http://www.uiowa.edu/~maps/h/hwta1.htm • Will post signs • http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson1.html