Motes: Basic Architecture and Programming - PowerPoint PPT Presentation

Loading...

PPT – Motes: Basic Architecture and Programming PowerPoint presentation | free to download - id: 986df-Mjg5M



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Motes: Basic Architecture and Programming

Description:

Mote Definition and Original Usage of the Term. Dictionary ... Developed first 'mote' platform WeC. A board consisting of a processor and RF module ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 27
Provided by: poste5
Learn more at: http://www.postech.ac.kr
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Motes: Basic Architecture and Programming


1
Motes Basic Architecture and Programming
  • Jang Ungjin and Sunggu Lee
  • EE Dept.
  • POSTECH
  • Oct. 2008

2
Contents
  • Mote Architecture
  • TinyOS NesC
  • Code Example
  • References

3
Mote Architecture
4
Mote Definition and Original Usage of the Term
  • Dictionary Definition
  • Speck of dust
  • Usage with respect to WSNs
  • Term popularized by work at U. C. Berkeley on
    WSNs in the late 1990s
  • Developed first mote platform WeC
  • A board consisting of a processor and RF module
  • Uses low-power short-distance wireless
    communication
  • Emphasis is on low power and small size
  • Various events can be recognized by adding sensor
    modules
  • Eventually, they hope to be able to make it as
    small as a speck of dust (a mote) and spread it
    around everywhere

5
Representative Motes
6
Example WSN Configured Using Motes
S
S
S
M
M
M
S
S
M
M
S
S
M
M
S
S
Node
M
M
M
S
G
S
M
M
Mote
M
To Host PC, LAN or Internet
Sensor
S
Gateway
G
7
MPR2400(MICAz) - Mote
  • Processor Performance
  • Program Flash 128KB
  • Logger Flash 512KB
  • Serial Communication UART
  • Analog to Digital Converter 10bit
  • RF Transceiver
  • ZigBee
  • Frequency band 2.42.4835GHz
  • Transmit data rate 250Kbps
  • Outdoor Range 75100m
  • Indoor Range 2030m

Fig. 1. MPR2400
Fig. 2. MPR2400 Block Diagram
8
MTS310 Sensor Module
Acoustic Sensor
Sounder
Photo Sensor
Dual-Axis Magnetometer
Temperature Sensor
Dual-Axis Accelerometer
9
MIB510 Gateway Module
Fig. 2. MIB510 Block Diagram
Fig. 1. MIB510
  • Base Station for WSN (sink node)
  • Supports Serial Port (RS-232C) Communication for
    all MICA Platforms

10
Tiny OS NesC
11
TinyOS Characteristics
  • TinyOS
  • Operating system for motes
  • Component Based
  • TinyOS program is built by connecting
    components.
  • Code reuse is simplified.
  • Event-driven Concurrency Model
  • State of component is changed when an event
    occurs.
  • Appropriate to the WSNs

12
TinyOS Architecture
  • No Kernel
  • No Process Management
  • No Virtual Memory
  • No Dynamic Allocation
  • No Exception Handling
  • Task Scheduler a set of Components

TOS Scheduler(Main)
Application Configuration
Application Interfaces
Application Specific Components
Commands
Events
TOS Component Interfaces
Library Components
System Components
Hardware Presentation/Abstraction Layer
Mote Devices
Sensor Devices
13
NesC Introduction
  • An extension of C programming language
  • designed to embody the structuring concepts and
    execution model of TinyOS

TinyOS Libs
NesC Compiler
C Compiler
Application (.nc)
Application (.c)
Application (.exe)
14
Component
  • Key notion of TinyOS programming model
  • Encapsulation of a specific set of services,
    specified by interfaces
  • Components define two scopes
  • Specification
  • Implementation
  • Two Types of Components
  • Module
  • Configuration

15
Example of Component
Fig. 1. Graphical Representation of TimerM
Component
Fig. 2. Code of TimerM Component
16
Interface
  • Interaction channel between two components, the
    provider and the user
  • A component can either be the provider or the
    user.
  • ComponentA
  • Provider of interface1
  • User of interface2
  • ComponentB
  • Provider of interface2
  • User component calls a command of using interface
    to request execution of some codes to provider.
  • Provider component signals an event of providing
    interface to alarm occurrence of a specific
    situation to user.

Interface1.nc
ComponentA.nc
Interface2.nc
Interface2.nc
ComponentB.nc
17
Example of Interface
Fig. Code of Some Interfaces of TinyOS
18
Implementation of Module
  • Codes of module
  • Implementation of commands and events
  • Private state variables, data buffers
  • Internally used functions - typical C style
    function
  • Tasks - independent locus of control(scheduling)
  • Execution of functions
  • post task
  • call command
  • signal event
  • Module must implement
  • All commands in provided interfaces
  • All events in used interfaces

19
Implementation of Configuration
  • List of components Wiring between components
  • Components list
  • Specifies components used to build the
    configuration
  • Renaming of components
  • To avoid name conflicts
  • To simplify changing the components that a
    configuration uses
  • Types of wiring statements
  • X C1.X provided(used) interface X of the
    configuration is equivalent to provided(used)
    interface X of C1
  • C1.X -gt C2.X
  • used interface X of C1 is connected to
    provided interface X of C2
  • C1.X lt- C2.X equivalent to C2.X -gt C1.X
  • ? C1, C2 names of components
  • Implicit connection
  • C1 -gt C2.X ( and the same with , or lt-)
  • Iteration to find Y such that C1.Y -gt C2.X forms
    a valid connection

20
Task Interrupt
  • Execution Model
  • Task Scheduler
  • Can executes tasks in any order
  • Must obey the run-to-completion rule
  • Interrupt Handler
  • Signaled asynchronously by hardware
  • Two parts of NesC Code
  • Synchronous Code(SC)
  • Asynchronous Code(AC)
  • AC can preempt SC or other AC.
  • Shared data that is reachable from AC has a
    potential data race.
  • To prevent data race
  • Access shared data only in SC or Atomic
    statement.

21
Code Example
22
Blink.nc
  • configuration Blink
  • implementation
  • components Main, BlinkM, SingleTimer, LedsC
  • Main.StdControl -gt SingleTimer.StdControl
  • Main.StdControl -gt BlinkM.StdControl
  • BlinkM.Timer -gt SingleTimer.Timer
  • BlinkM.Leds -gt LedsC

23
BlinkM.nc
  • module BlinkM
  • provides
  • interface StdControl
  • uses
  • interface Timer
  • interface Leds
  • implementation
  • command result_t StdControl.init()
  • call Leds.init()
  • return SUCCESS
  • command result_t StdControl.start()
  • return call Timer.start(TIMER_REPEAT, 1000)
  • command result_t StdControl.stop()
  • return call Timer.stop()
  • event result_t Timer.fired()
  • call Leds.redToggle()
  • return SUCCESS

24
SingleTimer.nc
  • configuration SingleTimer
  • provides interface Timer
  • provides interface StdControl
  • implementation
  • components TimerC
  • Timer TimerC.Timerunique("Timer")
  • StdControl TimerC

25
Blink Application Structure
Blink
Main
BlinkM
Use
SingleTimer
LedsC
Provide
26
References
  • 1 David Gay, Philip Levis, David Culler, Eric
    Brewer, nesC 1.1 language reference manual
  • 2 TinyOS Documentation, http//www.tinyos.net,
    Sep. 2003.
  • 3 MPR2400 datasheet, http//www.xbow.com, 2006.
  • 4 MTS310 datasheet, http//www.xbow.com, 2006.
  • 5 MIB510 datasheet, http//www.xbow.com, 2006.
  • 6 Korean reference ???, ???, ?? ?? ???? ??,
    ???, 2005.
About PowerShow.com