UCSCBaskin School of Engineering  
General Information Events, News & Organizations Degrees & Departments Research Classes Admissions & Advising People & Jobs Administration
CMPE 117 - Winter 2005

Embedded Software

Instructor: Luca de Alfaro

  • Location: 2:00-3:15, MWF, Baskin Engineering 169.
  • Lab location: Baskin Engineering, Rm. 115.
  • Lab times: Section 1: Mondays, 3:30 to 5; Section 2: Tuesdays, 2 to 3:30.
  • Office Hours: Mondays, 1-2.
  • TA: Eric B. Decker (cire at soe dot ucsc dot edu).
  • TA Office Hours: by appointment.
  • Web discussion group

General Information

What is Embedded Software?

Embedded software is the software that is included in products, rather than running on desktop PCs or workstations. The applications of embedded software range from small, stand-alone systems such as those found in appliances, to the real-time, networked systems responsible for the control and performance of cars, aircraft, and production plants. Over 99% of the CPUs being produced are used in embedded systems, and embedded software determines an increasing share of the functionality, appeal, and complexity of a product, from cellphones, to automotive engine control systems.

What is This Course About?

  • Program Lego® Mindstorm® robots in a variety of languages! Make them roam, explore, build ad-hoc communication links, and perform a variety of tasks. The special project this year consists in setting up an ad-hoc network between the robots, so that the robots can communicate and coordinate their tasks.
  • Learn how to write concurrent, real-time code, and how to ensure it is correctly scheduled.
  • Learn how different real-time operating systems support embedded programming.
  • Experiment with high-level languages for embedded systems, developed to make real-time distributed control easy!
    These languages are based on a completely different set of ideas from the programming languages you are used to.
  • Learn what are the main challenges in developing embedded software for complex systems such as cars, cellphones, and satellites, and learn techniques to overcome them.

Notes on This Year's Version of the Course

Topics

This year, I will introduce as soon as possible the architecture of the Lego Mindstorm robots, so that the students will be able to start working on the project in January. The project consists in developing an ad-hoc network using the infrared communication link of the Mindstorms. We will be able to use debugging tools and packet generators in order to help test the code. The ad-hoc network is a challenging application that will lead us to explore in a practical context many of the issues of embedded programming: scheduling, resource contention, locks, power-aware design, and real-time. It should be fun!

Lab

The course has a lab. Indicatively, I would prefer to hold lab lectures each Monday after class, but I will conduct a poll during the first week of classes, to ensure that the time is convenient for most students. Generally, I give one lecture a week in the lab. The first lectures will be dedicated to Lego Mindstorm programming; after that, we will talk about the details of the ad-hoc protocol. In a later part of the course, students will also use Esterel to program the Mindstorms. Students will have access to the lab during most times of the week to work on their projects. Students can work either alone, or in pairs, at the projects.

Prerequisites

In order to present much of the material of this course, I need students to know the basics about threads/processes; this is the reason of the CMPS 111 prerequisite. If you think you know the topic well enough, but you haven't taken CMPS 111, come talk to me; you may convince me into granting you a permission code to enroll.

Course Information

Textbook

Giorgio C. Buttazzo, Hard Real-Time Computing Systems: Predictable Scheduling Algorithms & Applications. Kluwer Academic Publishers, 1997. I bought my copy from amazon.co.uk.

Midterms and Final

  • Midterm 1, February 2 (Wednesday), in class.
  • Midterm 2, March 4 (Friday), in class.
  • Final: no final! The software project is due.

Reading and Resources

General Interest

robos

robos is the operating system that we will use for the Lego® Mindstorm® robots. These pages contain both the code, and a wealth of documentation and information about robos (including application code examples).

Esterel

Esterel is a synchronous language that we will use in programming Lego® Mindstorm® robots. Access restricted to cmpe117 students. This page contains all you need to install Esterel for lego.

Slides

Protocols

The Consensus Problem

Robos Ad-hoc Protocol (RAP)

Assigned Readings

  • January 17: Read the legOS Kernel Documentation, and familiarize yourself with the legOS Howto. Both available here.
  • January 21: You should have read all the slides on aperiodic scheduling. We are covering in class now periodic scheduling.
  • January 31: At this point, I assume you have read and studied all the slides on aperiodic scheduling, periodic scheduling, and resource access protocols (in particular, priority inheritance and priority ceiling with priority inheritance).
  • February 9: Johnson and Maltz: Dynamic Source Routing in Ad Hoc Wireless Networks
  • February 9: An interesting article on embedded software in cars.
  • February 11: Read chapter 2 of the Esterel primer (PS,PDF). You can find more information on Esterel here.

Homeworks

  • Homework 1, due January 17: You should implement the rover that wanders around the room, and recover from bumps, as described in class. Make a global strategy so that it wanders randomly, and use an implementation based on two communicating threads, similar to the one discussed in class. You should demo your code in the lab (on Monday or Tuesday), and also email a tarball with the code as an attachment to cire at soe dot ucsc dot edu.
  • Homework 2, due January 24 before class: You should code a light-seeking robot. The robot should try to go where the light intensity is highest. You can base your code on the code you have done for homework 1; the implementation should use at least two threads. Please submit the code before class by emailing it to cire at soe dot ucsc dot edu as an attachment. You will demonstrate the code during the lab sections.
  • Homework 3, due January 26 in class: pdf.
  • Homework 4, due February 2 in class: pdf.
  • Homework 5, due February 14-15 in the lab: implement the part of the ad-hoc protocol that deals with RR and RP packets, and with the generation (not routing) of RC packets. Use this tarball as a starting point. In the lab, we will test the code using a random packet generator. Note that you don't yet need to implement the route table to make this work (you do, however, need to distinguish between old and new nonces).
  • Homework 6, due February 22-23 in the lab: Let's make the whole of RAP work! To set the serial port in the way you need, do sudo setserial .... I checked, and everything works; look at the README file in the rap directory for more information.

Disclaimer

LEGO® and Mindstorm ® are trademarks of the LEGO Group of companies which does not sponsor, authorize or endorse this site.

General info · News · Events · Degree Programs · Research · Classes · Admissions · Advising · People · Jobs · Administration
SOE Webmail · SOE SSH · SOE Wiki · Search · Sitemap · Contact us · Driving directions · Privacy · UCSC
© Baskin School of Engineering, University of California, Santa Cruz
1156 High St., Santa Cruz, CA 95064 · (831) 459-2158 · webmaster@soe.ucsc.edu