Professional Documents
Culture Documents
The FireFly Platform Programming FireFly and the Nano-RK Sensor OS Lecture #3
Administrivia
BlackBoard Access
Lab Partners
Labs 1, 2, and 3 in Levine 279 Getting started - http://nanork.org/
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
Previous Lecture
Some Sensor Nodes Application Domains for WSNs Advantages of WSNs Taxonomy of WSNs Batteries and Energy Challenges and Metrics Summary
Operating System
Nano-RK Communication Link Layer Tips and Tricks
Lab Descriptions
FireFly History
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
Qui ckTi me and a TIFF (Uncompresse d) de comp re ssor are ne eded to see th is pi cture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
Atmel AVR
Microcontrollers
FireFly 1.2 Atmega32 (2K SRAM, 32K FLASH, 4K EEPROM) FireFly 2.0 Atmega128 (4K SRAM, 128K FLASH, 4K EEPROM) FireFly 2.2 Atmega1281 (8K SRAM, 128K FLASH,4K EEPROM)
ATmega1281 Features
1 I2C controller (2 wire serial protocol, Philips) 8-bit Harvard Architecture (16-bit address space) RISC Instruction Set 2 UARTS (RS232 115200 baud) 1 SPI (4 wire serial protocol, Motorola) 8 channel 10-bit ADC 2 8 bit Timers / Counters 4 16 bit Timers / Counters 6 Full 8-bit GPIO ports 32 8-bit Registers 64 Control Registers
Wireless Sensor Networks
QuickTime and a TIFF (Un compressed) decompressor are neede d to se e this picture.
EEPROM (4K)
Does not get cleared on power down Easy for a program to read / write from Uses interface that reads / writes to control registers
Data Memory
32 8-bit Registers
Compiler (or you) use these for many instructions that only operate on registers
Internal SRAM
This is memory that must be loaded and written to and from registers This is slower than directly accessing a register Program Data, Stack and Heap Live Here
Wireless Sensor Networks
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
Control Registers
Data Direction Register (DDR, TRIS) Internal Pull Up Register (PLP) Reading / Writing to the Port
QuickTime and a TIFF (Un compressed) decompressor are neede d to see this picture.
Each GPIO port can be configured as input or output on a bit-by-bit basis. Input can act as a high-impedance state to allow other devices to control the line level.
GPIO Register
Writing to a Port
A memory address directly maps to the state of a port
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
GPIO Register
Reading and Writing with a Port
QuickTime and a TIFF (Un compressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
AVR UART
QuickTime and a TIFF (Uncompressed) decompressor are need ed to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are need ed to see this picture.
Multi-drop 2 wire serial bus protocol Designed by Philips Two Bi-directional Open-Drain Lines 400 kbits / sec (up to 3.4Mbits / sec high speed mode)
Wireless Sensor Networks
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
2.4 Ghz (ISM band) 250 Kbps (Burst Data Rate) 16 Channels (11-26) in 5MHz Steps Transmits > 100 meters line of sight 0.18 CMOS Process
Communication Logistics
128-Byte Max Packet Size SPI communication from Atmel to Radio Built-in CRC (cyclic redundancy code) 128-bit AES encryption
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
cc2420 Power
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
FireFly Programmer
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
FireFly Programmer
Download Firmware Image to Board Read and Write Serial Debugging Data TimeScope
4 channel code execution profiler (good for setting OS reserves)
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
Software Tools
>
Operating Systems
TinyOS (Berkeley)
Event Based Operation Not Multi-threaded nesC programming language
SOS (UCLA)
Cooperative Multi-tasking Loadable Modules
Mantis (Colorado)
Preemptive Multi-tasking
Nano-RK (CMU/Penn)
Preemptive Priority Based Multi-tasking RK (Resource Kernel)
Nano-RK Features
C GNU tool-chain Classical Preemptive Operating System Multitasking Abstractions Real-Time Priority-Based Scheduling
Rate Monotonic Scheduling
Nano-RK Architecture
Nano-RK Reservations
CPU Utilization
Time Allowed Per Period For example, a task can run for 10ms of time every 250ms
Network Utilization
Packets In and Out Per Period
wait_until_xxx() functions
Suspend task until the event or timeout happens If there is no wait_until_xxx() call, then your reserve will be violated If reserves are disabled, then this can starve low priority tasks and will waste battery power
Unexpected Restarts
Capture restart that occurs without power-down
Resource Over-use
Manage sensors / actuators Low Voltage Detection Watchdog Timer
QuickTime and a TIFF (Uncompressed) decompressor are need ed to see this picture.
RT-Link
Time Division Multiple Access (TDMA) Protocol
Anthony Rowe, Rahul Mangharam, Raj Rajkumar, "RT-Link: A Time-Synchronized Link Protocol for Energy Constrained Multi-hop Wireless Networks," SECON 2006
LPL-CSMA
Low-Power Listen Carrier Sense Multiple Access (LPL-CSMA) schemes Tradeoff: Check Faster or Listen Longer
QuickTime and a TIFF (Uncompressed) decompressor are need ed to see this picture.
LPL-CSMA
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
a
RX
Gateway
f
c b e d b
TX RX
TX
c
RX
TDMA Frame
Wireless Sensor Networks
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
RT-Link Schedule
QuickTime an d a TIFF (Uncompressed) decompressor are need ed to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompressor are neede d to see this picture.
QuickTime and a TIFF (Uncompressed) decompre ssor are neede d to see this picture.
"T" refers to the text section, "B" refers to the BSS section, and "D" refers to the data section. Remember that strings don't show up in this list because they do not have compiler mapped labels.
Wireless Sensor Networks
Questions?
On Tuesday:
Labs and Get started with nano-RK Other Operating Systems