89
Sensor Networks-Backup 자료 Update http://casp.hanyang.ac.kr [email protected] CASP Lab. Yongjin Kim

Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Embed Size (px)

Citation preview

Page 1: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Networks-Backup 자료 Update

http://[email protected]

CASP Lab. Yongjin Kim

Page 2: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

목차

센서 네트워크

센서 네트워크 하드웨어

센서 네트워크 소프트웨어

Page 3: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

센서네트워크

센서네트워크란?센서네트워크응용

센서네트워크의특성

센서네트워크구조

센서 Node Hardware Platforms센서 OS -- TinyOS, NesCAd-hoc 네트워크일반 Ad-Hoc 네트워크기술과 Sensor Network Ad-Hoc 네트워크기술의차이점

Page 4: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network란?무선통신, 통신프로토콜, 컴퓨터네트워크, ASIC, 디지털공학, 로보틱스, MEMS, 센서등다양한분야접목으로센서네트워크를구현하여군사, 환경, 보건, 재난방재등에응용하는네트워크기술

Page 5: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network – Military 응용

Page 6: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network – Scientific ApplicationsB

ridge between the Internet and the physical

world

Bridge betw

een the Internet and the physical w

orld

Bridge between the Internet and the physical world

Bridge between the Internet and the physical world

Page 7: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network Application AreasSmart HomeSeismic(지진의) Structure responseContaminant(오염) TransportMarine Microorganisms(미생물)Ecosystems(생태계), Bio-complexity(생물복합성)ITS (Intelligent Transport Systems )Healthcare Process Automation Military Intelligent Robot Automotive (Vehicle)Factory AutomationEtc.

Page 8: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network 특성Large number of sensor nodes

Maybe 10 to 100,000 nodes (scalability)Node position may not be predeterminedLow Cost

Low energy consumptionTo relocate & recharge large number of nodes is impossibleLife time of sensor network (sensor node) depends on battery life time

Network self-organizationLarge number of nodes in hostile locations-> manual configuration unfeasibleNodes may fail, & new nodes join the networkAd-hoc sensor network protocols

Collaborative/Distributed processingLocally carry out simple computation -> forwards and aggregate data

Query ability (Sensor Database)Single node or group of nodesBase nodes collect data from given area & create summary messages

Page 9: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Networks 구조

Ad-hoc (single, multi-hop) network

Page 10: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Node Hardware PlatformsApplication, Cost, Power, Functionality, and Form Factor

Berkeley’s Motes/MICA/PicoNode/Smart DustUCLA iBadge, Medusa MK-IISensoria WINSMIT’s uAMPsJapanese T-EnginesEtc.

Page 11: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Berkeley MICA 구조Atmel ATMEGA103

4 Mhz 8-bit CPU128KB Instruction Memory4KB RAM

4 Mbit flash (AT45DB041B)SPI interface1-4 uj/bit r/w

RFM TR1000 radio50 kb/s – ASK

Network programming51-pin connector

Analog compare + interrupts

Atmega103 Microcontroller

TR 1000 Radio Transceiver 4Mbit External Flash

51-Pin I/O Expansion Connector

Power Regulation MAX1678 (3V)

DS2401 Unique ID

8 Analog I/O 8 Programming Lines

SPI B

us

CoprocessorHardware Accelerators

Digital I/O

TransmissionPower Control

Page 12: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Mica Sensor Board & Ultrasonic Transceiver

Light (Photo)TemperatureAcceleration

2 axis, Resolution: ±2mgMagnetometer

Resolution: 134μGMicrophoneTone DetectorSounder

4.5kHz

Used for rangingUp to 2.5m range6cm accuracyDedicated microprocessor25kHz element

Page 13: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network OS센서운영체제

센싱 application과노드들간통신을위한작은운영체제요구사항

작은크기

작은전력소모

노드간의통신

프로세서와메모리관리

동시성다수의하위래벨이벤트 발생과상위레벨프로세싱을동시처리

Page 14: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS-Traditional SystemsWell established layers of abstractionsStrict boundariesAmple resourcesIndependent Applications at endpoints communicate point-point through routersWell attended

User

System

Physical LayerData LinkNetwork

TransportNetwork Stack

Threads

Address Space

Drivers

Files

Application

Application

Routers

Page 15: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

by comparison ...Highly Constrained resources

processing, storage, bandwidth, powerApplications spread over many small nodes

self-organizing Collectives highly integrated with changing environment and networkcommunication is fundamental

Concurrency intensive in burstsstreams of sensor data and

network trafficRobust

inaccessible, critical operationUnclear where the

boundaries belong

=> Provide a framework for:

• Resource-constrained concurrency

• Defining boundaries

• Appl’n-specific processing

allow abstractions to emerge

Page 16: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS (1)TinyOS센서네트워크와같은임베디드네트워크시스템을위해특별히고안된운영체제

작은데이터메모리

이벤트기반의어플레케이션과 코어로구성

어플리케이션에따라크기는수백바이트에서수백킬로바이트

TinyOS 특성컴포넌트(Component) 기반의구조어플리케이션들이구현에필요한각각의컴포넌트들을연결속성(Wiring Specification)을이용하여연결하여구성

태스크, 이벤트기반의동시성구분된 동작

명령어들이동작의실행을요청하게되면, 즉시명령들은리턴(Return) 하게되고, 완성에대한통보는이벤트를통해신호되는구분된동작

Page 17: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Tiny OS (2)Scheduler + Graph of Components

constrained two-level scheduling model: threads + events

Component:Commands & Event HandlersCommand & Event interfaceFrame (storage)Tasks (concurrency)

Constrained Storage Modelframe per component, shared stack, no heap

Very lean multithreadingEfficient Layering

Messaging Component

init

Pow

er(m

ode)

TX_p

acke

t(buf

)

RX_

pack

et_d

one

(buf

fer)

Internal State

init

pow

er(m

ode)

send

_msg

(add

r, ty

pe, d

ata)

msg

_rec

(type

, dat

a)

msg

_sen

d_do

ne)

internal thread

Commands Events

bit_cnt++ bit_cnt==8

Send Byte Eventbit_cnt = 0

No

YesStart

Done

Page 18: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Complete TinyOS Application

Page 19: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Application = Graph of Components

Example: ad hoc, multi-hop routing of photo sensor readings

RFM

Radio byte

Radio Packet

UART

Serial Packet

ADC

Temp photo

Active Messages

clocksbit

byte

pack

et

Route map router sensor appln

appl

icat

ion

HW

SW

3450 B code226 B data

Graph of cooperating state machines on shared stack

Page 20: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

NesC정의

TinyOS의특성을지원하기위해고안된프로그램언어C 언어의확장

구성컴포넌트양방향인터페이스

특징테스크와이벤트들에기반한동시성모델을제공

NesCC 언어 User

Page 21: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Ad-hoc 네트워크 (1)What is Ad Hoc Network?

In Latin, ad hoc mean “for this,” further meaning “for this purpose only.”

All nodes are mobile and can be connected dynamically in an arbitrary manner.

No default router available.

Potentially every node becomes a router: must be able to forward traffic an on behalf of others.

Two types of wireless networksInfrastructured network

A network with fixed and wired gateways.

When a mobile unit goes out of range of one base station, it connects with new base station.

Infrastructureless (ad hoc) networks All nodes of these networks behave as routers and take part in discovery and maintenance of routes to other nodes.

Page 22: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Ad-hoc 네트워크 (2)

기존의기지국기반의통신인플라를사용하지않고무선인터페

이스를사용해패킷데이터를전송하는무선노드로구성된네트

워크

Ad-hoc 네트워크내의노드들은라우터와호스트로동시에이용될수있기때문에다른노드의패킷을중계할수있고, 어플리케이션을실행시킬수있다. Ad-hoc 네트워크의가장큰매력은완전히독립적으로존재한다는것이다. 사용자가네트워크내에서더많은자유와유연성을얻게된다.

Page 23: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

The Properties of Protocols (For Routing)

A routing protocol should be distributed

Assume routes as unidirectional links

Power efficient

Consider its security

Two Main categories of ProtocolsTable Driven Routing Protocols

Pro-active, learn the network’s topology before a forwarding request comes in

On-Demand Routing ProtocolsRe-active, become active only when needed

Hybrid protocols can be preferred

Page 24: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

일반 Ad-Hoc 네트워크기술과Sensor Network Ad-Hoc 네트워크기술의차이점

The number of sensor nodes in a sensor network can be several order of magnitude higher than the nodes in an ad hoc network

Sensor nodes are densely deployed

Sensor nodes are prone to failures

The topology of a sensor network changes very frequently

Sensor nodes mainly use a broadcast communication paradigm, whereas most ad hoc networks are based on point-to-point communication

Sensor nodes are limited in power, computational capacities, and memory

Sensor nodes may not have global identification (ID) because of the large amount of overhead and large number of sensors

Page 25: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

센서네트워크하드웨어

AVR CC1000Sensor Network 플랫폼구조Sensor 보드ISP

Page 26: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

AVR 특징Atmel's AVR® microcontrollers

RISC core running single cycle instructions I/O

Internal oscillatorsTimers, UART, SPI, pull-up resistors,pulse width modulation, ADCanalog comparatorand watch-dog timers

AVR instructions are tuned to decrease the size of the program whether the code is written in C or Assembly. With on-chip in-system programmable Flash and EEPROM, the AVR is a perfect choice in order to optimize cost and get product to the market quickly.

Page 27: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

AVR 패밀리의종류와특징Tiny 시리즈

RAM이없거나적은모델이대부분이며핀수또한적어서간단한어플리케이션에적합하다.

AT90S 시리즈RAM의크기는보통으로 8051과비슷하거나더나은성능을제공한다.

Mega 시리즈플래쉬메모리와램의용량이크고핀수또한많아서복잡한어플리케이션에적합하다.

http://www.atmel.com

Page 28: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ATmega 128- 8bit Microcontroller with 128K Bytes In-System Programmable Flash

Advanced RISC 구조On-chip 2-cycle Multiplier

Nonvolatile program and data Memories128K Bytes of In-System Reprogrammable Flash, 4K Bytes EEROM, 4K Bytes Internal SRAM, SPI 인터페이스 for In-System Programming

JTAG 인터패이스Peripheral 특징

Timer, RTC, 8-ch 10bit ADC, SPI, Watchdog timerSpecial Microcontroller 특징

내부 Calibrated RC 오실레이터, Software Selectable Clock Frequency, Atmega103 Compatibility Mode Selected by a fuse

I/O and Packages53 Programmable I/O Lines, 64-lead TQFP and 64-pad MLF

Operating Voltages2.7(4.5) – 5.5V(5.5V) for ATmega128L(ATmega128)

Speed Grades0 – 8 MHz(16MHz) for ATmega128L(ATmega128)

Page 29: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ATmega 128L 블록다이어그램

AVR CORE

UART0

Timer, Interrupt …

SPI

UART1

ADC

Page 30: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

CC1000 RF 트랜시버Single IC TransceiverDual Band 433MHz and 915MHz ISM Bands38.4KBit/sec Data Rate FSKLow Power Requirements

16mA Tx / 9mA RxProgrammable Configuration

RF Channels within Band – Frequency HopRF Transmitter Power Data Rate

Page 31: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Chipcon CC1000 블록다이어그램

Page 32: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Chipcpon-Atmega128L 인터페이스Configuration Interface Communication Interface

Data uses Atmega128L SPI PortCC1000 is SPI Master

SPI PortRx Double Buffer (more later)Tx Single Buffer (more later)

Page 33: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

RF Modulation - FSKFrequency Shift Keying (FSK)

1/0 represented by two different frequencies slightly offset from carrier frequency

64KHz Separation

Page 34: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Manchester EncodingEvery Bit (Zero or One) has a transition Simplifies Clock Recovery at ReceiverImplemented in CC1000 hardware

Page 35: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor Network 플랫폼구조Atmel ATmega128L

32 kHz crystal and 4 Mhz (7.3728 MhzMica2) crystal10 bit ADCUART SPI busI2C bus

Radio (RFM or Chipcon CC1000)External serial flash memory(512kbyte)Connectors for interfacing to sensor and programming boards3 programmable LEDSJTAG port

ATmega 128L

Serial Flash

LEDS

Radio

External Connectors

Page 36: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

CC 1000 Radio 인터페이스Dedicated CPU bus (lines) to configure radio registers for radio frequency, power,…Dedicated SPI bus for data transfer. CC1000 is bus master. Radio generates one interrupt every 8bits when in receive mode.More in-depth radio discussion later in session ~20msec38K

~40msec19K

Rcv Time(*)Baud Rate

(*) Does not include random delay

안테나 컨텍터

Control Signal Lines

Page 37: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Typical CC1000 application circuit

Page 38: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Bill of materials for the application circuit

Page 39: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Flash Memory 인터페이스512 Kbytes of flash (non-volatile) storageUseful for data loggingUsed by Task (Tiny Application Sensor Kit) and TinyDB for data loggingUsed by XNP for code downloadSerial interface to Atmega 128L MicrocontrollerTinyOS driver (Logger…) bit bangs interfaceAttached to 2xuart port. Another driver (UCB) uses synchronous usart for high speed data transfer(5KB/Sec driver) Beware, device consumes 15mA when storing to meory

Control Lines

Page 40: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ADC 인터페이스Eight channels of 10bit ADC, Multiplexed.Dedicated channels

ADC0 : Radio’s RSSIShared WSN Channels

ADC7 : Battery monitor (can be shared with another channel but will have ~10K ohm Impedance.)ADC4 to ADC7: JTAG. If using JTAG debug these channels won’t work as ADC inputs

ADC 8ch

Page 41: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

RS232 인터페이스

Page 42: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

External ConnectorsAnalog VCC

CdSe광센서

온도센서

Page 43: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Sensor- light Temperature

Page 44: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ISP (In System Programmer) ISP 정의시스템에프로그래밍을위한회로

커넥터가마련이되어있어서따로롬라이터를이용하지않고도PCB 기판상에서프로그래밍이가능하도록하는도구일반롬라이터는전원과클럭을롬라이터자체적으로공급

ISP는 PCB 회로상의전원과클럭을이용장점회로추가로시스템의디버깅이용이하고업그레이드가쉬운시스템을만들수있다

단점부피가커지고제품단가가올라간다

Page 45: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ISP 인터페이스-STK100/STK200/STK300 ISP

Kanda사에서공급받아서 ATMEL에서판매하는 Starter KitSTK는기본적인테스트를할수있는 evaluation board와 ISP 프그래머를포함

STK100은 Tiny 시리즈용STK200은 AT90S 시리즈용STK300은Mega 시리즈용

Page 46: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ISP 인터페이스-STK200 ISP 다운로더케이블

Page 47: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Dummy Parallel ISP (1)

Dummy parallel ISP란 PC의병렬케이블을직접 AVR에연결하여프로그래밍하는방식이다(병렬케이블커넥터와점퍼선만있으면된다)

Page 48: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Dummy Parallel ISP (2)Linux용 gdb를이용하여런타임디버거로이용할수있다UISP 리눅스용으로개발된 ISP 소프트웨어Dummy parallel ISP 뿐만아니라 STK200, STK300등을지원 Altera의CPLD 프로그래밍툴인 Byte BlasterMV도지원

UISP(Win9x) Version 0.1.0.6AT90S 시리즈프로그래밍가능, Win9x, WinNT(???)

UISP(Win9x) Version 0.1.1.0 betaAT90S 시리즈프로그래밍가능, Win9x, WinNT(???)

UISP(Linux)AT90S 시리즈프로그래밍가능, 리눅스용

Page 49: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

전체시스템구성도

Page 50: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Wire sensor Network Board

Page 51: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Battery Life ConsumptionTwo models:

1% duty cycle0.5% duty cycle

Conclusion:To achieve multi-year battery life, must sleep most of the time.

Page 52: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Ratio Metric ADCs & SensorsAtmega 128 is 10bit (1024) ratio metric ADCIf sensor is ratio metric then don’t have to measure battery voltage. (Sensor’s FS changes with battery voltage).Ratio metric sensors may not work over full range of battery voltage, be careful.ADC full scale is proportional to battery voltage.Must measure battery voltage to get accurate sensor readings:

Battery Volts = RefVolt*ADC_FS/data

WSN have on-board voltage references to calibrate the ADC full scale.

Page 53: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

센서네트워크소프트웨어

ICCAVRPonyPro2000TinyOS

Page 54: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR-http://www.imagecraft.com

ImageCraft사의 AVR 전용 IDE(ANSI C tools)

register allocation, peephole, dead code

elimination, ...

AVR studio

nonolimit of devices

Atmel 1200 and

tinyAVRs

ICCtiny

built-in ISP

support

register allocation, peephole

AVR Studio,Flash

Studio+

yesyes up to 128K bytes

AtmelAVRs &

MegaAVRs

ICCAVRProfessional

built-in ISP (In-System

Programmer)

support

register allocation, peephole

AVR Studio,Flash

Studio+

no yes up to 64K bytes

AtmelAVRs &

MegaAVRs

ICCAVRStandard

OtherFeatures

Optimizations

DebuggersCodeCompressor

CodeBrowser

Code Memory

Size

TargetCPU’s

Product

Page 55: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR

Editors

Status

Project files

Page 56: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR 설정 - Paths

사용자정의Output 디렉토리

설정

Page 57: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR 설정 – Compiler

Intel Hex포맷으로설정

Page 58: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR 설정 – Target

ATmega128 설정

내부메모리설정은디바이스설정시에자동으로설정

Page 59: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

ICCAVR- Getting Started 1. Project>New2. Project name and path3. Project>Options4. In the Paths options, enter “user dir” In the output directory5. In the Compiler options, check “Accept C++ Comments” and “Intel HEX” as

the “output format”6. In the Target options, select “Atmega128” under “Device Configuration”7. Write the source code8. Add the source file to the project by selecting “Project>Add File (s)” and

select the file just written9. Compile by selecting “Project>Make Project” or by clicking on the “build”

icon10. Open AVR ISP and download the hex file located in the “user dir” folder into

the device

Page 60: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 설정 - Device ISP Downloader

ATmega128설정

Page 61: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 설정 - Interface SP Downloader

Avr ISP I/OLPT1

Setup

Probe 버턴을눌렀을때 Test fail 메시지가나오면ISP 다운로더검사

Page 62: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 설정 - Calibration

버스타이밍측정-측정하는동안 CPU와 Hard disk는Idle 상태가된다

Page 63: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 설정 –Fuse bit read ISP Downloader

1.아이콘클릭2.Command>Security and Configuration Bits3. Ctrl-s

Page 64: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 사용 TIP첫째, 자신이사용하는 AVR 모델을지원하기만한다면가급적 v2.06c를사용하시지말고 v2.05a를사용하십시오. 구버전이더빠릅니다. 그러나, 예를들어 ATmega8515를사용하신다면이는구버전에서지원하지않으므로반드시 v2.06c를사용해야합니다.

둘째, Calibration을하십시오.

셋째, Avr ISP API보다는 Avr ISP I/O로설정하는것이더빠릅니다.

넷째, Verify는꼭하실필요가없습니다. 대부분의경우속도가느린것은 Verify 동작인데, 위의답변처럼 Verify를금지하거나 Verify 도중에중지하셔도상관없습니다.

다섯째, PonyProg2000을실행한후에그안에서반복적으로 HEX 파일또는 ROM 파일을불러다가다운로드하지말고, 반드시한번실행하고나면바탕화면으로나왔다가다시 PonyProg2000을실행하십시오. PonyProg2000은첫번째실행은빠른데그안에서반복적인동작을하면현저히느려집니다.이는프로그램의버그로보입니다.

Page 65: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

PonyPro2000 Fuse bit 설정Fuse bit의정의

Hardware적인Microcontroller 옵션설정ISP를이용하여설정한다.STK200 케이블인경우체크하면 0 이라이팅된다PonyProg2000에서는 0이셋이다.

Fuse 설정내용Flash Lock, Boot Lock103호환모드, Watch dog ENJTAG EN, SPI EN, CKOPTBoot 영역

Page 66: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 구성TinyOS, TinyOS Tools, nesCCygwin (An icon for Cygwin will appear on your Desktop when TinyOS 1.1.0 is installed)Support ToolsJava 1.4 JDK & Java COMM 2.0GraphvizAVR Tools

avr-binutilsavr-libcavr-gccavariceAvr-insight

Page 67: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (1)Insert the Crossbow TinyOS Support Tools CD-ROM into CD drive of your PC.

This is the initial screen that appears. Open up a window to display the contents of the CD-ROM. Then click on the folder TinyOS Install/and then double click on tinyos-1.1.0is.exe

Page 68: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (2)After you click on the tinyos-1.1.0-1is.exe, the Install Shield Wizard appears. This step may take several minutes.

Page 69: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (3)Choose between Complete and Custom install. A Custom install allows the user to choose the features that are installed. A Complete install includes all of the above features (recommended). The user chooses the destination directory. Any chosen features are installed under that destination directory. Hereafter the destination directory is referred to as<install dir>

Page 70: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (4)JDK If the user choose to install the JDK module, a dialog asking if the user has read Sun’s terms and conditions appears. If the user selects No, then setup is ended

If the user selects Yes, then the setup continues to another screen (not shown). Verify the install directory and setup type; click on Next> proceed or <Back to make changes.

Page 71: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (5)The screen on the left appears when the IS wizard is copying files from the CD-ROM to your hard driver.

After this step completes, another window (not shown) will appear which says, “The setup will now install Cygwin (if it was selected) as well as any necessary ROMS.” Click on Continue.

Page 72: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (6)

Cygwin. If the user chooses to install Cygwin and any necessary RPMs by clicking on the Continue button, the 1.1.0 cygwin package tree is copied over to a directory called <install dir>/cygwin-installation files/. Setup.exe. Is called to perform automatic installation of those files in <install dir>/cygwin

Page 73: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치 (7)

Necessary RPMs. After the

Cygwin setup is complete,

installation of the RPMS

immediately follows. This is the

most lengthy step. On some PCs

it takes at least 60 minutes. This

step also compiles the java files

(as seen to the left). After this,

you are done!

Page 74: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Cygwin- http://www.cygwin.com정의

cygwin은레드햇에서개발된윈도우를위한유닉스환경

구성DLL(cygwin1.dll)유닉스 API의기능을제공하는유닉스에뮬레이터

유닉스로부터포팅(porting) 된 tool의모음장점

Linux/Unix로할수있는일의대부분을윈도우환경아래에서 cygwin을이용

제품을무료로사용, 원본을임의로수정하여재배포하는것도가능(GPL 라이센스(GNU Public License))Linux/Unix 환경으로개발된소프트웨어를윈도우운영체제에서사용

Page 75: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Updating to TinyOS 1.1.5Save your previous work. We recommend making a tarball of your entire TinyOS-1.x directory and saving it someplace (bake up)Copy to a C:\drive directory of your choice the file tinyos-1.1.5Mar2004cvs-1.cygwin.noarch.rpm which is in the TinyOS support Tools CDROM.Install: Open Cygwin by double-clicking on the Cygwin icon on your desktop. Be sure that you have administrator privileges. Then type.

Rpm –force –ignoreos –Uvh tinyos-1.1.5Mar2004cvs-1.cygwin.noarch.rpm

in the directory where you saved the rpm. This will take a while (the tinyospackage installation includes compiling the java code). TinyOS is installed in /opt/tinyos-1.x.You’re done! Check the documentation in opt/tinyos-1.x/doc/index.html for more information. See “Installing and Updating Packages “if you want to install any optional packages.

Page 76: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Copy the Crossbow TinyOS Directory (xbow/) into the contrib/Directory

Crossbow has developed a number of firmware applications that are not in the main tinyos-1.x/apps/ directory. They are on the TinyOS Support Tools CDROM as a zip file and need to be copied into thetinyos-1.x/contrib/ directory.

Verify that a directory called contrib exists under the tinyos-1.x directory. That is it is at the same level as the apps/ directory.

Copy the xbow.tgz file in the CDROM>Crossbow Software into the opt/tinyos-1.x/contrib/ directory. Unzip the file there. When complete, you should see a folder (directory) called xbow directly under the contrib directory.

Page 77: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS 설치구조

Page 78: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

TinyOS PC Tools VerificationA TinyOS development environment requirement

Gcc compiler, perl, flex. Cygwin, JDK1.4.x

ToscheckOpen a Cygwin window by double-clicking on the icon that should be on your desktop.Chang into the opt/tinyos-1.x/tools/scripts/directory and run toscheck

cd /opt/tinyos-1.x/tools/scripts toscheck

The last line of the output should be:

toschecktoscheck completed without errorcompleted without errorIf any errors are reported, make sure to fix the problem

Page 79: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

프로그램환경설정하기-RF 주파수설정

(915Mhz)

cd /opt/tinyops-1.x/tos/platform/mica2CC1000Const.h

#define CC1K_DEF_PRESET (CC1K_914_077MHZ)

Page 80: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

프로그램환경설정하기 - uart baud rate 설정(19200kbs)

cd /opt/tinyops-1.x/tos/platform/mica2HPLUART0M.nc

Outp(24, UBRR0L);

Page 81: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

UBBR Settings at Various CPU Frequencies (Normal Mode)

Double Speed= Normal x 2-> 12 x 2 =24

Page 82: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Equations for Calculating Baud Rate Register Setting

Page 83: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

프로그램환경설정하기-Makefile Programmer 설정하기(stk)

cd /opt/tinyops-1.x/appMakerules

PROGRAMMER_FLAGS=-dprog=stk200 $(PROGRAMMER_PART) $(PROGRAMMER_EXTRA_FLAGS)PRPGRAMMER := STK200

Page 84: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

프로그램환경설정하기-Makefile output file Hex로출력하기

cd /opt/tinyops-1.x/appMakerules

MAIN_HEX = $(BUILDDIR)/main.hex

Page 85: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

UISP 사용하여 Fuse Bit 읽기

uisp –dprog=stk200 –dpart=ATmega128 –rd_fuses

Page 86: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

UISP 사용하여 Fuse Bit 쓰기

JTAG Enableuisp –dprog=stk200 –dpart=ATmega128 –wr_fuse_h=0xd9

JTAG Disableuisp –dprog=stk200 –dpart=ATmega128 –wr_fuse_h=0xd9

Page 87: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Blink Application 실행하기 (1)

cd /opt/tinyops-1.x/app/Blink

Page 88: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Blink Application 실행하기 (2)

make mica2

../build/mica2에main.srec와main.hex생성

Page 89: Sensor Networks-Backup Data-Update - pds7.egloos.compds7.egloos.com/pds/200803/21/35/Sensor_Networks-Backup_Data... · Large number of nodes in hostile locations-> manual configuration

Blink Application 실행하기 (3)

make reinstall mica2Compile과 Download 함께하기

Make install mica2