D0003E: Real-time Systems


Spring 2013
Old web page from 2012

News

News and updates will always be announced here, with latest news on topmost row:
2013-03-21Tentan kommer att vara på engelska, på samma sätt som alla tidigare tentor.
2013-03-20Notera att i senare tentor än lösningsförslaget har det ofta krävts större detaljrikedom i redovisningen än vad som finns i tentaförslaget. Detta har då naturligtvis framgått i uppgiften och gäller främst uppgifterna där tidsdiagram ska redovisas, där det på senare tentor krävts att man ska redovisa händelsers börja, exekveringstillstånd (block/kör/mutex) osv.
2013-03-15Lösningsförslag till en gammal tenta finns.
2013-03-15Sammanfattningen är uppdaterad med en ny bild på slutet.
2013-03-14 Extra labbpass: pass 3 den 15/3.
2013-03-04 Extra labbpass: pass 3 den 8/3.
2013-02-28 Ny deadline för labb 5 - den 27/3. Det blir dock inga nya labbpass så vi får komma överens om tiden för redovisningen via mejl.
Notera att ingen redovisning kommer att tillåtas efter den 27/3.
2013-02-27 Ny deadline för labb 4 - den 5/3. Deadline för labb 5 blir dock oförändrat.
2013-02-26 Instruktioner för labb 4 har uppdaterats. Lagt till frågor som ni behöver svara på när ni redovisar.
2013-02-26 Något uppdaterade versioner av filer TinyTimber.h och TinyTimber.c finns nu att ladda ner för labb 4.
2013-02-12 Instruktioner för labb 3 (del 1) har uppdaterats.
2013-02-05 Instruktioner för labb 2 har uppdaterats. Följ den nya länken från denna sida.
2013-01-28Jag har uppdaterat beskrivningen av hur man kommer igång med avr studio.
2013-01-25Jag har lagt upp en icke helt färdig drivrutin för i2c till at90can128 (en annan avr mikrokontroller) som exempel på hur källkod kan se ut. Den består av c-fil och h-fil.
2013-01-21Föreläsning 1 uppdaterad med administrativ info.
2013-01-15 Då börjar vi lite smått på 2013 års version av webbsidan...

Schedule

Schedule for luleå

Lectures




Lecture 1:
Introduction to real-time systems and C slides (pdf)
Lecture 2:
Bit manipulation and hardware interfacing
slides (pdf) complementing slides (pdf)
Lecture 3:
Concurrent threads and mutual exclusion
slides (pdf)
Lecture 4:
The inner workings of a kernel
main slides (pdf), extra slides (pdf)
Lecture 5:
Events, interrupts & reactions
slides (pdf)
Lecture 6:
A model of reactive objects
slides (pdf)
Lecture 7:
Continuation of lecture 6

Lecture 8:
Clocks, timers, and periodic execution slides (pdf)
Lecture 9:
Deadlines and priorities slides (pdf), examples (pdf)
Lecture 10:
Scheduling and feasability slides (pdf)
Lecture 11:
Priority Inversion slides (pdf)
Lecture 12:
POSIX threads slides (pdf)
Lecture 13:
More inter-process communication
slides (pdf)
Lecture 14:
Real-Time Languages and synchronization
slides(pdf)
Lecture 15:
Repetition and infamous realtime systems
slides (pdf), infamous systems (pdf)
Lecture 16:
Spare


Course aim

The aim of the course is to give competence in the development of real time systems in high level programming
languages, to discuss various models of synchronization and communication between concurrent processes in such
systems, and to study the characteristics of real time systems and their constructions.  The central concepts of the
course are concurrency - where programs are built using several concurrent threads of execution, reactivity  -
where external input is reacted to rather than requested, and real-time - where the timing behavior of a reactive
system is also of interest.

Course content

Concurrent Programming:
Reactive Programming:
Real Time Systems:
Course description from the course catalog

Course litterature

Alan Burns and Andy Wellings.
Real-Time Systems and Programming Languages.
Addison-Wesley, third edition, 2001.
ISBN: 0-201-72988-1.

Fouth edition is also perfectly usable.

Examiner & lecturer

Fredrik Bengtsson
E-mail: bson@ltu.se
Office: A3308
Phone: 49 24 31

Lab supervisor

Andrey Kruglyak
E-mail: andrey.kruglyak@ltu.se
Office: A2314

Lab assignments

Rules (Must read!)

It is very easy to get started with the new equipment. Just connect the AVR ISP programmer to the computer by USB and to the Butterfly board with the USB cable. Programming is performed in "AVR Studio". Choose to crerate a new GCC C Executable project and select ATmega169P as device. Use tools-device programming to program your device with an elf och hex file. Here, you need to select ATmega169P again. If you're asked to upgrade the formware onm the programmer, choose to do so. Be sure to work in your home directory and not on the local computer.

Lab 1: C programming on bare metal
deadline 31/1
Lab 2: A lightweight multi-threading kernel
deadline 11/2
Lab 3: A threaded reformulation of lab 1
deadline 20/2
Lab 4: Dual pulse generators with a GUI
deadline 5/3 NEW DEADLINE
Lab 5: Traffic light control and simulation
deadline 27/3 NEW DEADLINE
NB: no examination after this date
Extra: Lab 6: Commanding a robot
You will get 5% of total exam points added to your result on the exam.
deadline before exam

Target platform documentation

The AVR Butterfly User's Guide describes the features of the platform (an evaluation kit) in overall terms.

The ATmega169 datasheet gives detailed information about the microcontroller that powers the Butterfly board.

The AVR instruction set explains the assembly language instructions that the ATmega169 uses.

The AVR065 application note provides details about the LCD driver on the Butterfly board.

The ATmega32 datasheet gives detailed information about the microcontroller that powers the miniature robots.

The AVR-P40-USB notes provide an overview of the development circuit board on the miniature robots.

Target platform resources

Lawicel, online supplier of AVR Butterfly cards.

Software Crew, another AVR Butterfly supplier.

Smiley Micros, USA-based supplier of AVR material.

WinAVR, open source C cross-compiler, libraries and download utilities (for Windows).

AVR Studio, optional AVR integrated development environment for Windows that installs on top of WinAVR.

Darwinports avr-gcc, open source C cross-compiler, libraries and download utilities (MacOS X)

AVR freaks, miscellaneous AVR-related info.

Links to related information

Johan Nordlander, Programming with the TinyTimber Kernel

POSIX Threads Programming, Livermore Computer Traning, Lawrence Livermore National Laboratory

Ken Tindell & Hans Hansson, Real-Time Systems by Fixed Priority Scheduling, Tech. report, Uppsala University, 1996

Dave Marshall, Programming in C

Steve Holmes, C Programming

Steve Summit, C Programming Notes

Marshall Brain, How C Programming Works

Lee Tauck, C Tutorial

Mikael Sundström, Some C-tricks and Tips for Real-time Programming

Java and C Comparison Chart

The POSIX specification

POSIX in realtime

UnixWare 7 online manual pages

ANSI terminal control codes

Cygwin documentation

Ariane 5 Launch Failure

Apollo 11 Program Alarms

Mars Pathfinder Priority Inversion

Therac-25 Accidents