Embedded System Lec - Week2
Embedded System Lec - Week2
Semester 2
Embedded Systems
Software Engineering
Point of view
Dr. Ahmed Ezz
Reference
Chapter 20
What is Embedded System
• An embedded software system is part of a hardware/software
system that reacts to events in its environment.
• The software is ‘embedded’ in the hardware.
• Embedded systems are normally real-time systems.
Embedded system characteristics
• Embedded systems generally run continuously and do not terminate.
• Interactions with the system’s environment are uncontrollable and
unpredictable.
• There may be physical limitations (e.g. power) that affect the design of a
system.
• Direct hardware interaction may be necessary.
• Issues of safety and reliability may dominate the system design.
Reactive systems
• Given a stimulus, the system must produce a
reaction or response within a specified time.
• In a real-time system, the correctness depends both on the response to an input and
the time taken to generate that response. If the system takes too long to respond,
then the required response may be ineffective.
A General Model of an embedded
Real-Time System
• Sensor is a device used for the conversion of physical events or
characteristics into the electrical signals.
This is a hardware device that takes the input from environment and gives
to the system by converting it.
For example, a thermometer takes the temperature as physical
characteristic and then converts it into electrical signals for the system.
Actuator is a device that converts the electrical signals into the physical
events or characteristics.
It takes the input from the system and gives output to the environment.
For example, motors and heaters are some of the commonly used
actuators.
Sensor and actuator processes
System elements
• Sensor control processes
• Collect information from sensors. May buffer information
collected in response to a sensor stimulus.
• Data processor
• Carries out processing of collected information and
computes the system response.
• Actuator control processes
• Generates control signals for the actuators.
Real-time system modelling
• The effect of a stimulus in a real-time system may trigger a transition
from one state to another.
• UML state diagrams may be used to show the states and state
transitions in a real-time system.
State machine model of a petrol (gas) pump
Real-time programming
• Programming languages for real-time systems development have to include
facilities to access system hardware, and it should be possible to predict the timing
of particular operations in these languages.
• ROTS are specialised operating systems which manage the processes in the
Real Time Systems (RTS).
• Responsible for process management and resource (processor and memory)
allocation.
• May be based on a standard kernel which is used unchanged or modified for a
particular application.
• Do not normally include facilities such as file management.
Operating system components
• Real-time clock
• Provides information for process scheduling.
• Interrupt handler
• Manages aperiodic requests for service.
• Scheduler
• Chooses the next process to be run.
• Resource manager
• Allocates memory and processor resources.
• Dispatcher
• Starts process execution.
Non-stop system components
• Configuration manager
• Responsible for the dynamic reconfiguration of the system software and hardware.
• Hardware modules may be replaced and software upgraded without stopping the
systems.
• Fault manager
• Responsible for detecting software and hardware faults and taking appropriate
actions (e.g. switching to backup disks) to ensure that the system continues in
operation.
Components of a RTOS
Process priority
• The processing of some types of stimuli must sometimes take priority:
• Interrupt level priority. Highest priority which is allocated to processes
requiring a very fast response.
• Clock level priority. Allocated to periodic processes.
• Within these, further levels of priority may be assigned.
Interrupt Servicing
• Control is transferred automatically to a pre-determined memory location.
• Further interrupts are disabled, the interrupt serviced and control returned to
the interrupted process.