1 / 69

SN Overview

SN Overview. Sensor Network: Bridge between the internet and the physical world IEEE 802.15.4 (TinyOS, IPv6, ZigBee, SP100, etc). Network Embedded System C. Main.exe. App.c. TinyOS / nesC. 2-Level Structure Command (Bottom direction) Non-time critical Long running operations

nuala
Download Presentation

SN Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SN Overview Sensor Network: Bridge between the internet and the physical world IEEE 802.15.4 (TinyOS, IPv6, ZigBee, SP100, etc)

  2. Network Embedded System C Main.exe App.c

  3. TinyOS / nesC • 2-Level Structure • Command (Bottom direction) • Non-time critical • Long running operations • Cannot preempt & can be preempted • Background computation • Events (Top direction) • Time critical • Small running operations • Cannot be preempted • Able to interrupt running Tasks

  4. Preemption • Pre-emption as used with respect to operating systems means the ability of the operating system to preempt or stop a currently scheduled task in favour of a higher priority task. The scheduling may be one of, but not limited to, process or I/O scheduling etc. • Non-preemptability arises, for instance, when handling an interrupt. In this case, scheduling is avoided until the interrupt is handled. Making a scheduler preemptible has the advantage of better system responsiveness and scalability. • The schedulers used in most modern operating systems, such as various flavours of Unix, can preempt user processes. This is called preemptive multitasking, and is in contrast to cooperative multitasking wherein a process "gives away" its time by utilizing kernel resources or by specifically calling a kernel routine to allow other processes time to run. Some operating systems' schedulers (including Linux as of the 2.6 series) have the ability to preempt a process while it is processing a system call as well (a preemptible kernel). • Linux, Unix, *BSD, Mac OS X, and Windows NT are all examples of operating systems that utilize preemptive multitasking; Netware, Windows for Workgroups, and Macintosh System 9 are all examples of cooperative multitasking operating systems. • From www.wikipedia.org

  5. TinyOS Kernel

  6. nesC Overview • [nes-si:] • Network Embedded System C Language • Supports TinyOS • Make applications for Network Embedded system • No dynamic memory allocation • Extension of C programming language • Efficient code for micro-controllers • Able to interact with old C code • Many C Programmer • C is little helpful for safe code & structuring applications

  7. nesC Application • Components + Interface • *.nc • Component: • Module • Configuration • Static • No dynamic memory • No function pointers • Programming ( ATmega128L ) • In flash memory(128K, 40K, 60K) • In SRAM(4K) • In EEPROM(4K)

  8. nesC Structure • Module • oooM.nc • Code file • Configuration • ooo.nc/oooC.nc • Wiring of components • Define wiring of Modules • Interfaces • ooo.nc • Contains only definition • Commands/Events

  9. File type • Components • Configuration • Module • Interface

  10. Configuration (ex. Blink.nc)

  11. Basic Concept • Component • Configuration • Module • Provides • Uses • Interface • Command • Event • Task • Post • Keep in mind (Interface file defines Command / Event) • Command is implemented on Providing Component • Event is implemented on Using Component

  12. Basic Concept: Configuration • Syntax • File name: • Top-level configuration: • ooo.nc (in each application) • General configuration: • oooC.nc • Wire only 2 components together at a time • Using with ‘’ and ‘=’

  13. Configuration • Ex. • Top-level configuration

  14. Configuration (ex. Blink.nc)

  15. Basic Concept: Module • Syntax • Name • File: oooM.nc • Interface.command(or event) • Command • Implement in all the ‘provides’ interfaces • Prefixed with ‘call’ • Event • Implement in all the ‘uses’ interfaces • Prefixed with ‘signal’

  16. Module • Ex. • Module • Interface • Command • Event

  17. Module (ex. BlinkM.nc)

  18. Module (ex. BlinkM.nc)

  19. Module (ex. BlinkM.nc)

  20. Basic Concept: Interface • File name: ooo.nc • Bi-directional • Provider & User • No actual code or wiring • Declare commands and events • Provider Module: • Implement all commands • User Module: • call command & Implement all events • Parameterized Interfaces • Ex.

  21. Interface (ex. Timer.nc)

  22. Interface (ex. StdControl.nc)

  23. Interface • Ex.

  24. Configuration • Ex. • General configuration

  25. Wiring Syntax • Ex. • End-point1End-point2 • End-point1End-point2 • End-point1=End-point2

  26. Task • Ex. • Task can be posted in command, event and task • task void taskname() {………} • Post taskname();

  27. Sample nesC Application (Kmote0) • 전원 On  부팅  Led On • Basic Application • Component • Main.nc, LedsC.nc • Test.nc, TestM.nc • Interface • StdControl.nc, Leds.nc

  28. Top Configuration Test Main StdControl TestM Leds LedsC

  29. Configuration (Test.nc)

  30. Configuration (Main.nc)

  31. Interface (StdControl.nc)

  32. Module (MainM.nc)

  33. Module (TestM.nc)

  34. Module (LedsC.nc)

  35. Module (LedsC.nc)

  36. Module (LedsC.nc)

  37. Module (LedsC.nc)

  38. Module (LedsC.nc)

  39. Interface (Leds.nc)

  40. Interface (Leds.nc)

  41. Interface (Leds.nc)

  42. Sample nesC Application (Blink+UART) • nesC application • Component based application • Set of components • Byte단위 시리얼 통신을 위한 Component • UART • Led, Timer, UART, Wireless Communication, External Flash

  43. Configuration (Blink.nc)

  44. Nesdoc

  45. Nesdoc

  46. Configuration (Main.nc)

  47. Module (MainM.nc)

  48. Configuration (UART.nc)

  49. Module (UARTM.nc)

  50. Module (UARTM.nc)

More Related