Download presentation
1
TinyOS 1/2 Onsystech Sangjae Han
2
목차 TinyOS 개요 TinyOS 설치(실습) TinyOS Architecture TinyOS Structure
프로그램 다운로드 및 설치 디렉토리 구성 개발 방법 Atmega128L & TinyOS Blink Application 포팅및 동작확인
3
TinyOS 개요 TinyOS Developed at University of California in Berkeley
Professors David Culler & Kris Pister David Culler --> TinyOS & Intel Research Berkeley Kris Pister --> Dust networks (Smart Dust) Key Engineer --> Jason Hill, etc. Use more than 300 academic groups & industrial organizations Open-source software development Simple operation system Programming language and model Set of services
4
TinyOS Architecture 1/2 Designed for Low Power Sensor Networks
Key Elements Sensing, Computation, Communication, Power Resource Constrained Power, Memory, Processing Adapt to Changing Technology Modularity & Re-use
5
TinyOS Architecture 2/2 TinyOS Layers
6
TinyOS Categories Events Tasks Time Critical
Interrupts cause Events (Timer, ADC, Sensors) Small / short duration Suspend Tasks Tasks Time Flexible Run sequentially by TOS Scheduler Run to completion with other Tasks Interruptible
7
TinyOS Kernel
8
TinyOS structure overview
Configuration A “wiring” of Components together Component Provides a specific Service Message Handling, Signal Processing Implemented in a Module (code) Wired up of other components in a Configuration
9
Components structure Interface Implementation
Declares the Services provided Implementation Defines internal workings of a Component May include “wires” to other components A Message Handler might use Radio and UART communication components
10
Component Anatomy Modules Configurations
Contain application code, implementing one or more interfaces Does NOT contain the wiring to other components CC1000ControlM.nc – Radio Control Configurations Configurations are used to assemble other components together, connecting interfaces between User and Implementations. SingleTimerC.nc – uses TimerM.c
11
TinyOS Component Interface
Commands Provides Services to User (“Caller”) Events Sends Signals to the User autonomously Mandatory (implicit) Commands .init – invoked on boot-up .start – enables the component services .stop – halt or disable the component
12
TinyOS components Implementation
Defines ‘how’ the component works. Allows multiple Implementations for an Interface e.g. different implementations of a MAC layer with one standard Interface to the User All Commands & Signals declared in the INTERFACE must be implemented Including .init, .start, & .stop Implemented under the MODULE keyword
13
TinyOS Implementation Syntax
module LedsC { provides interface Leds; } implementation Leds uint8_t ledsOn; async command result_t Leds.redOn() atomic TOSH_CLR_RED_LED_PIN(); ledsOn |= RED_BIT; return SUCCESS; } //implementation }//module
14
Async and Atomic Commands and Events that are executed as part of a Hardware Event handler must be declared with the async keyword Indicates that this code may execute asynchronously to Tasks and other processes. Races are avoided by accessing shared data exclusively within Tasks Because Tasks can’t interrupt each other Use atomic statement to access shared variables
15
TinyOS configuration Ties Components together
Every TOS Application has a single top-level CONFIGURATION file A “wire” connects the Component’s Interface to another Component
16
Configuration Example
configuration BlinkTask { } implementation { components Main, BlinkTaskM, SingleTimer, LedsC; Main.StdControl -> BlinkTaskM.StdControl; Main.StdControl -> SingleTimer; BlinkTaskM.Timer -> SingleTimer.Timer; BlinkTaskM.Leds -> LedsC;
17
TinyOS installation Download programs
Double click “tinyos is.exe”
18
TinyOS installation
19
TinyOS installation
20
TinyOS installation
21
TinyOS installation
22
What is being Installed?
TinyOS & Tools: event-driven OS for wireless sensor networks; tools for debugging nesC: a extension of C-language designed for TinyOS Cygwin: a Linux-like environment for Windows AVR Tools: a suite of software development tools for Atmel's AVR processors Java 1.4 JDK & Java COMM 2.0: for host PC applications and port communications Graphviz (from AT&T Labs): to view files made from make docs
23
Directory Structure
24
TinyOS 1.1.x Standard TinyOS applications and test programs
User contributions included Documentation and On-line Tutorial Development utilities and programs TinyOS modules and interfaces
25
TOS subdirectory
28
TinyOS directory structure
29
개발환경 /opt/tinyos-1.x /opt/tinyos-1.x/apps /opt/tinyos-1.x/tos
관련 어플리케이션 /opt/tinyos-1.x/tos TinyOS관련 소스및 라이브러리 /opt/tinyos-1.x/tos/platform 개별 플랫폼별 적용가능한 소스코드(mica2사용) 유저프로그램(실습) /opt/tinyos-1.x/apps/xxxapp 생성후 작업!!!
30
실습(LED Blank) Blank 디렉토리 파일을 참고하여 실습보드의 Led를 깜빡이는 프로그램을 작성한다. 참고사항.
1. Timer만을 이용 2. Task를 이용( keyword- task, post ) 참고사항. 해당 보드의 설정파일을 확인한다.( platform/mica2) Blank디렉토리의 파일을 참고하여 /apps/xxx에 자신의 프로그램을 작성한다. 작성된 프로그램을 컴파일한다. Make mica2 컴파일된 이미지를 보드에 프로그래밍한다. Ponyprog를 이용하여 다운로드 다운로드후 실행, 보드 리셋(or power on reset)을 하여 프로그램 동작을 확인한다. 타이머를 조절하여 깜빡이는 주기를 변경해본다. 프로그램 동작하면 조별이름으로 압축하여 제출후 퇴실.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.