1 / 11

Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers

Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers. Jonathan Hui University of California, Berkeley. Outline. Quick overview of Microcontrollers TinyOS Lab nesC Programming Language Embedded sockets interface Sensor/actuator drivers Texas Instruments MSP430.

ntoth
Télécharger la présentation

Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Outline • Quick overview of • Microcontrollers • TinyOS • Lab • nesC Programming Language • Embedded sockets interface • Sensor/actuator drivers • Texas Instruments MSP430 EECS194-5

  3. Computer Systems • Traditional systems: separate chips • Microcontroller: integrate on single chip Mote MCU CPU Timer Network Peripherals Memory Storage EECS194-5

  4. 48K ROM 10K RAM 250 kbps Microcontrollers EECS194-5

  5. 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 EECS194-5

  6. Web Server Link 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 EECS194-5

  7. Application IPv6 Network Kernel Driver Driver Driver Driver Driver Driver Sensors Actuator Sensors Actuator Radio Timer Flash Sensor Actuator TinyOS IPv6 Network Kernel • Network Kernel • Manages communication and storage • Scheduler (decides when to signal events) EECS194-5

  8. 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 EECS194-5

  9. 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(); } Example Flow Start Timer Send Msg Toggle LED System Init Radio Transmit Radio Receive … Sleep … … Sleep … EECS194-5

  10. = HW Timer Overflow 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 Send Msg Toggle LED System Init Radio Transmit Radio Receive … Sleep … … Sleep … EECS194-5

  11. That’s a Start • We’ll learn lots more in lab! EECS194-5

More Related