Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

CSC405A

Real Time & Embedded Systems


GIMPA, SCHOOL OF TECHNOLOGY
About the Lecturer
Emmanuel Ayitey Djaba
▪ BSc in Computer Engineering Ghana Technology
University College,
▪ MSc in Information and Communications Technology
GIMPA,
▪ MPhil in Information and Communications Technology,
GIMPA

CSC405A Real Time & Embedded Systems 2019/2020 2


Why are we here?
To understand how computers work

Source: https://www.cise.ufl.edu/~mssz/CompOrg/CDAintro.html

CSC405A Real Time & Embedded Systems 2019/2020 4


So we can create this:

Source: https://www.electronicshub.org/dtmf-mobile-controlled-robot-without-microcontroller/

CSC405A Real Time & Embedded Systems 2019/2020 5


Welcome to the Course
Important Course Information
▪ Course Hours: Thursdays 9am – 12pm
▪ Course Website: https://sites.google.com/gimpa.edu.gh/csc405a
▪ Email : edjaba@gimpa.edu.gh

CSC405A Real Time & Embedded Systems 2019/2020 6


Grading Scheme
▪ Semester project I - 10%

▪ Semester project II - 10%

▪ 1 mid semester quiz - 15%

▪ Attendance and Participation - 5%

▪ End of semester exams - 60%

Academic dishonesty including but not limited to cheating, plagiarism, collaboration is


unacceptable and subject to disciplinary actions. Any student found guilty will have
grade F. Assignments are due in class on the due date. Late assignments will not be
accepted. There would be no retakes for exams you have missed.

CSC405A Real Time & Embedded Systems 2019/2020 7


Course References
▪Book 1: O'Sullivan, D., & Igoe, T. (2004). Physical computing: sensing and controlling the
physical world with computers. Course Technology Press.

▪Book 2: Barrett, S. F. (2013). Arduino microcontroller processing for everyone!. Synthesis


Lectures on Digital Circuits and Systems, 8(4), 1-513.

▪Book 3: Buttazzo, G. C. (2011). Hard real-time computing systems: predictable scheduling


algorithms and applications (Vol. 24). Springer Science & Business Media.

▪ Book 4: Russell, D. J. (2010). Introduction to embedded systems: using ANSI C and the arduino
development environment. Synthesis Lectures on Digital Circuits and Systems, 5(1), 1-275.

CSC405A Real Time & Embedded Systems 2019/2020 8


Course Prerequisites
▪ Electronic Circuits
▪ Computer Organization and Architecture
▪ OOP 1
▪ Your willingness to participate in discussions.
▪ Regular attendance to class.
▪ Timely submission of assignments
▪ Maintaining a general interest in the course

CSC405A Real Time & Embedded Systems 2019/2020 9


Course Objectives
At the end of the course, students should be able to:

▪ Understand what real time & embedded systems are.

▪ Determine what influences the response time of a system.

▪ Evaluate / analyse the response time.

▪ Make / design a time-predictable embedded system using Arduino.

CSC405A Real Time & Embedded Systems 2019/2020 10


Lecture One
Introduction To Real Time Systems
Introduction – What does real time mean?
▪ Often, people say that a control system operates in real time if it is able to quickly react to
external events.

▪ According to this interpretation, a system is considered to be real-time if it is fast. The term


fast, however, has a relative meaning and does not capture the main properties that
characterize these types of systems.

▪ However, the concept of time is not an intrinsic property of a control system. It is always
dependent on the environment / scenario.

▪ Consider the following examples

CSC405A Real Time & Embedded Systems 2019/2020 12


Introduction – Is this real time?
https://www.youtube.com/watch?v=a4c7AwHFkT8

CSC405A Real Time & Embedded Systems 2019/2020 13


Introduction – What about this?
https://www.youtube.com/watch?v=r8G0n5LeJo0

CSC405A Real Time & Embedded Systems 2019/2020 14


What is a real time system?

▪ A system whose correctness depends not only on the correctness of logical results (e.g.,
decisions), but also on the time at which the results are produced.

▪ In fact, whereas the objective of fast computing is to minimize the average response time
of a given set of tasks, the objective of real-time computing is to meet the individual timing
requirement of each task

▪ Consider a more complicated example

CSC405A Real Time & Embedded Systems 2019/2020 15


What is a real time system?

CSC405A Real Time & Embedded Systems 2019/2020 16


Real Time Systems

▪ In fact, whereas the objective of fast computing is to minimize the average response time of a
given set of tasks, the objective of real-time computing is to meet the individual timing
requirement of each task.

▪ When different computational activities have different timing constraints, average performance
has little significance for the correct behaviour of the system.

▪ Rather than being fast, a real time system must be predictable

CSC405A Real Time & Embedded Systems 2019/2020 17


Real Time Systems

CSC405A Real Time & Embedded Systems 2019/2020 18


Real Time Systems

▪ As we have seen in previous examples, real time systems focus on performing specific tasks within
a specific deadline. Tasks can be categorized into:

▪ Hard: A real-time task is said to be hard if producing the results after its deadline may cause
catastrophic consequences on the system under control

▪ Firm: A real-time task is said to be firm if producing the results after its deadline is useless for
the system, but does not cause damage

▪ Soft: A real-time task is said to be soft if producing the results after its deadline still has some
utility for the system, although causing performance degradation

CSC405A Real Time & Embedded Systems 2019/2020 19


Real Time Systems

▪ Hard tasks are often found in safety-critical systems related to sensing, actuation and control such
as the following:

▪Sensory data acquisition

▪ Data filtering and prediction

▪ Detection of critical conditions

▪ Data fusion and image processing

CSC405A Real Time & Embedded Systems 2019/2020 20


Real Time Systems

▪ Examples of firm tasks: video streaming, on-line image processing, sensory data-transmission.

▪ Soft tasks are typically related to system-user interactions:

▪ Command interpreter of the user interface

▪ Handling input data from the keyboard

▪ Displaying messages on the screen

▪ Saving report data

CSC405A Real Time & Embedded Systems 2019/2020 21


Desirable Features Of Real Time Systems

▪Timeliness: Results have to be correct not only in value but also in the time domain. As a
consequence, the operating system must provide specific kernel mechanisms for time management
and for handling tasks with explicit timing constraints and different criticality.

▪ Predictability: To achieve a desired level of performance, the systems must be analyzable to


predict the consequences of any scheduling decision. In safety critical applications, all timing
requirements should be guaranteed off line, before putting system in operations. If some tasks
cannot be guaranteed within its time constraints, the system must be notified in advance so
alternative actions can be planned to handle the exception

CSC405A Real Time & Embedded Systems 2019/2020 22


Desirable Features Of Real Time Systems
▪ Efficiency: Most of real-time systems are embedded into small devices with sever constraints in
terms of space, weight, energy, memory and computational power. Efficient management of
resources is essential

▪ Robustness: Real-time systems must not collapse when they are subject to peak-load conditions,
so they must be designed to manage all anticipated load scenarios.

▪ Fault tolerance: Single hardware and software failures should not cause the system to crash.

▪ Maintainability: The architecture of a real-time system should be designed according to a modular


structure to ensure that possible system modifications are easy to perform.

CSC405A Real Time & Embedded Systems 2019/2020 23


Achieving Predictability
▪ The reliability of a real time systems, depends on a range of factors, which involve the architectural
features of the hardware and the mechanisms and policies adopted in the kernel, up to the
programming language used to implement the application.

▪ The first component that affects the predictability of the scheduling is the processor itself. The
internal characteristics of the processor, such as instruction prefetch, pipelining, cache memory,
and direct memory access (DMA) mechanisms, are the first cause of nondeterminism.

▪ Other important components that influence the execution of the task set are the internal
characteristics of the real-time kernel, such as the scheduling algorithm, the synchronization
mechanism, the types of semaphores, the memory management policy, the communication
semantics, and the interrupt handling mechanism

CSC405A Real Time & Embedded Systems 2019/2020 24


Taxonomy of Real Time Systems

▪ Real time systems can be grouped into the following:


▪ Cyclic executives (also called “timelines” or frame-based systems)
▪ Event-driven systems with both periodic and aperiodic activities
▪ Client-server systems
▪ State machine systems
▪ Pipelined Systems

CSC405A Real Time & Embedded Systems 2019/2020 25


Cyclic Executives
▪ A cyclic executive consists of continuously repeated task sequences, known as major frames.
Each major frame consists of a number of small slices of time, known as minor frames; tasks are
scheduled into specific minor frames.

▪ A non-repeating set of minor cycles makes up a major cycle.

▪ The operations are implemented as procedures, and are placed in a pre-defined list covering every minor
cycle.

▪ When a minor cycle begins, the timer task calls each procedure in the list.

▪ Concurrency is not used; long operations must be manually broken to fit frames.

CSC405A Real Time & Embedded Systems 2019/2020 26


Cyclic Executives

CSC405A Real Time & Embedded Systems 2019/2020 27


Event Driven System

▪ An event-driven design uses real-time I/O completion or timer events to trigger


schedulable tasks. Many real-time Linux systems follow this model.

▪Tasks can be prioritized in the following ways:

▪ Priorities should be determined by time constraints (rate-monotonic / deadline


monotonic priority assignment)

▪ Task priority can also depend on semantic importance.

CSC405A Real Time & Embedded Systems 2019/2020 28


Client-Server Systems

▪ Client-server systems use inter-task messages in addition to I/O completion and


timers to trigger tasks. Sending tasks, or client block until they receive a response
from receiving tasks, or servers.

CSC405A Real Time & Embedded Systems 2019/2020 29


End of Lecture

CSC405A Real Time & Embedded Systems 2019/2020 30

You might also like