Real-Time Systems

Jacky Baltes <>

Important Updates

  1. Test 2 consists of three parts (worth 15 points each): Timers and Interrupts, Concurrency and Semaphores, and AVR Assembly Language. Questions similar to Test 1. No definition or long answer questions. I want to know if you can understand and apply the various algorithms.
  2. Piezo speaker output for “Hello World” (About as good as it gets on the piezo)
  3. Demonstrations for Assignment 3a will be Friday, 1st April 2016
  4. Test 2 will be held on Wed. 6th April 2016 in Machray Hall 315
  5. Class on Monday, 28th March 2016: the TA will cover three exercises for ASM to C translation, I will be back on Tue.
  6. Assignment 3b is available now.
  7. Deadline for Assignment 3a extended until Monday, 21st March 2016 at 23:59
  8. Assignment 3 is released now.
  9. Deadline for Assignment 2 extended until Monday, 7th March 2016 at 23:59
  10. Updated version of Cooperative OS for AVR Butterfly
  11. Deadline for Assignment 2 extended until Friday, 4th March 2016 at 14:30
  12. Comments about Midterm Test
  1. Topics: Everything discussed in class
  2. Most questions focus on algorithms and datastructures. You need to implement several programs in C for the AVR Butterfly. For analysis style questions, I think of Input $I, Algorithm/Datastructure $A, and Output $O as 3 parameters of the system. I often give two and ask you for the third. Simplest case is: What is the output of algorithm $A/trace the execution of algorithm $A, given input $I? But I can also ask: Here is the output $O of algorithm $A, what was the input $I? Or here is $I and $O, what parameters were used for $A?  
  3. No long answer questions
  4. There are 3 questions on the midterm, grouped into three sections.
  1. Late submission policy for Sound and Co-operative OS Assignment updated.
  2. You are allowed to create one cheat sheet for yourself and use during the midterm: (a) maximum size is US letter sized, (b) you can write on both sides of the cheat sheet.
  3. Old exams added
  4. Class on Friday, 26th February 2016 is cancelled
  5. TA will do demo for Assignment 1 and will cover Pitfalls in Using setjmp
  6. Fixed error in COM1A should be 10, not 01 in sound lecture notes and added sample program
  7. Test 1: Wednesday, Feb. 24th 2016 at 14:30 in Machray Hall 315
  8. Demonstration of Tea Timer, Monday, Feb. 22nd 2016 at 14:30 in E2-438
  9. Tea timer assignment is now available
  10. The updated ROASS document is available here
  11. Page opened Mon Jan  4 21:31:57 CST 2016


This course covers a variety of topics in embedded real-time systems. Topics covered are processor and ports, interrupts, timer and event based scheduling, and software engineering methodologies for embedded systems.

Lecture Slides

The following lecture slides are available.

  1. Introduction to Real-Time Systems
  2. Buttons
  3. Buzzer
  4. Sound Generation Using PWMs
  5. Tasks and Threads
  6. Interrupts
  7. Co-Operative Context Switch Using setjmp
  8. Pitfalls in Using setjmp
  9. Timers
  10. Context Switch Via Interrupts
  11. AVR GCC Inline Assembler
  12. AVR Assembly Language
  13. AVR Assembly Language Exercise
  14. Analog to Digital Conversions
  15. Disabling the JTAG Port
  16. Semaphores
  17. Some more AVR Assembly Language Exercises
  18. Scheduling


The following links lead to the assignments.

  1. Tea Timer Assignment
  2. Sound and Co-operative OS Assignment
  3. Two parts
  1. Pre-emptive OS kernel
  2. Wave Player

Sample Code

The following are links to same sample code provided for the course.

  1. Hello World Sample Program
  2. Buttons Sample Program
  3. Simple Sound Sample Program
  4. Additive Synthesizer
  5. Simple Co-operative Multitasking Kernel (Unix Version),
  6. Simple Co-operative Multitasking (AVR Butterfly version)
  7. Timer0 Sample Program
  8. CTC Timer0 Sample Program
  9. Scrambled Preemptive OS Kernel

Datasheets and other Information

  1. AVR Butterfly Datasheet
  2. AVR ATMega 169 Datasheet

Old Exams