Presentation is loading. Please wait.

Presentation is loading. Please wait.

2008EECS194-51 Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.

Similar presentations


Presentation on theme: "2008EECS194-51 Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley."— Presentation transcript:

1 2008EECS194-51 Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley

2 2008EECS194-52 Outline Quick overview of –Microcontrollers –TinyOS Lab –nesC Programming Language –Embedded sockets interface –Sensor/actuator drivers –Texas Instruments MSP430

3 2008EECS194-53 Mote MCU Computer Systems Traditional systems: separate chips Microcontroller: integrate on single chip Timer MemoryStorage CPU Peripherals Network

4 2008EECS194-54 Microcontrollers 48K ROM 10K RAM 250 kbps

5 2008EECS194-55 Mote Characteristics Limited resources –RAM, ROM, Computation, Energy  Wakeup, do work as quickly as possible, sleep Hardware modules operate concurrently –No parallel execution of code (not Core 2 Duos!)  Asynchronous operation is first class Diverse application requirements  Efficient modularity Robust operation –Numerous, unattended, critical  Predictable operation

6 2008EECS194-56 TinyOS Basics What is an OS? –Manages sharing of resources (hardware and software) –Interface to access those resources TinyOS Basics –System  Graph of components –Components Provides interfaces Uses interfaces –Interfaces Commands Events Network Link Web Server

7 2008EECS194-57 TinyOS IPv6 Network Kernel Actuator Sensors TimerFlashRadioSensorActuator Network Kernel –Manages communication and storage –Scheduler (decides when to signal events) IPv6 Network Kernel Driver Application

8 2008EECS194-58 Event-Based Execution All execution occurs in event handlers –Events do not preempt each other Commands –Get information from underlying components Get current time –Configure underlying components Start timer (will cause a future event) Bind socket to a port –Helper functions Format an IPv6 address

9 2008EECS194-59 Example Flow Event: Boot –Command: Start timer Event: Timer fired –Command: Send message Event: Message received –Command: Toggle an LED event void Boot.booted() { call Timer.startPeriodic(100); } event void Timer.fired() { call Udp.sendto(buf, len, &to); } event void Udp.recvfrom(void *buf, uint16_t len, sockaddr_in6_t *from) { call Leds.led0Toggle(); } Start Timer System Init … Sleep … Send Msg Radio Transmit … Sleep … Radio Receive Toggle LED

10 2008EECS194-510 What’s Happening Underneath? MCU hardware modules operate concurrently  Must handle events in a timely manner Hardware events preempt application events –Allows system to operate asynchronously from app –Tasks are used to signal application events –Kernel scheduler executes tasks one-by-one Start Timer System Init … Sleep … Send Msg Radio Transmit … Sleep … Radio Receive Toggle LED = HW Timer Overflow

11 2008EECS194-511 That’s a Start We’ll learn lots more in lab!


Download ppt "2008EECS194-51 Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley."

Similar presentations


Ads by Google