Realtime and Embedded Systems

CSE321 Realtime and Embedded Systems

What are RT, EM, RTEM?

What are (i) realtime systems (ii) embedded systems and (iii) realtime and embedded systems? RTEM


Problem first

Let's continue the discussion but focus on design of RTEM. Key phrase for today: Design first.

Design process

Lets solve some problems and explore the design process of RTOS. Here is a demos. Key phrase for today: Design representation.

System structure

Let's look the structure of realtime systems and understand how they are different from regular systems. Sys structure Key phrase for today: system structure.

**Preliminary** Term project and lab guidelines: Labs
Hwk1 is posted

Design and develop C programs

Key phrase for today: Design and develop

Problem: Consider this number guessing game that is played with n number of cards filled with numbers. Consider n=5 or 5 cards. Write the C code solution to play this game online.

Solution:
  • Step 1: Understand the problem. To do that let's play the game in person.
  • Step 2: Analyze the problem: What is the core concept? What are the data structures needed? What are the contraol structures?
  • Step 3: What is the approach: table-driven or function-driven?
  • Step 4: Code the problem in C language. Let's study C program structure. Use an editor to enter the code. What is the editor you are using?
  • Step 5: Use a standard directory structure. at this point you need some Linux commands, assuming that you are working on Linux/Unix machine.
  • Step 6: Compile the code. What is the compiler to use?
  • Step 7: Run the executable and test the output for correctness. Debug, repeat.
  • Step 8: Submit: What is the command? submit_cse321 filename
  • Attend lecture and recitation to get more help. This is how you solve hwk problems.
Now let's look at the problem and go through the steps:
Number game cards
Number game

Let's play and analyze
Number game code

Labs to term Project

Let's discuss the labs and the term project. Key question for today: What's your cool idea?

Analysis and design

Today we will discuss two approaches to getting started with design:
Use case diagram
CRC Card method

Escape room demo

We had a wonderful presentation by Daniel Baker (an alumni) about the escape room he built with household objects and a bunch of Arduinos, sensors and Adafruit devices.

Arduino

Today I will introduce you Arduino Uno board and IDE. Arduino is fantastic device to build RT,EM, and RTEM.
What is Arduino?
What can do with it? Demo

Concurrency models

Today we will discuss two approaches to realizing concurrency in RTEM:
Process model
Thread model

Fork syscall demos

Today we'll demonstrate the use of fork system call:
Fork demos

Pthread demos

Today we'll demonstrate the use of thread model of concurrency using Pthread library:
Thread demos

Pipe Syscall

Today we'll demonstrate the use of pipe() sycall for communication among forked processes:
Pipe demos

Designing cyclic executive

Let's learn how to design a real time cyclic executive.
Cyclic Executive - concepts, code
Design of a cyclic executive

Midterm exam review

Lets prepare for the midterm exam.
Review
Cyclic execute example

Realtime Scheduling

Traditional realtime scheduling.
RT Scheduling
What happened on Mars?

Inter-process communication

Traditional realtime scheduling.
RT Process Communication

Exam stats


Histogram of midterm grades
Boxplot of midterm grades

Signals and Alarms

Signals and alarms
Demos

Memory management

Memory in small footprint systems
Demos

Final Exam Review

Final review
Demos