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

TEC

Eng : Khaled Mohsen


Embedded Software Engineer | Integration testing | Integrator | Developer | Instructor |
Mechatronics Engineer

Embedded Software Embedded Software Embedded Software Embedded Software


Instructor Engineer Engineer Engineer
Embedded Software Embedded Software Embedded Software Embedded Software
Instructor at iti and private Engineer at IoTech Engineer at El Araby Engineer at Valeo
training centers in Egypt Solutions

Past Past Past Now


2
Embedded Systems
What is the meaning of system :
Input, process, and output form the basic components of a system.
These three components are interconnected and work together to create a system.

01 02 03
Input Process output

3
Systems
Example of systems :
Stopwatch is a good example of a system that involves input, output, and
processing. Here's how the different components of a stopwatch system work
together:

01 02 03
Input Process output
The user presses a button to
Once the user presses the The display on the stopwatch
start the stopwatch.
button, the stopwatch begins shows the elapsed time to the
This button press is the input
processing the time user. The display is the output
to the system.
of the stopwatch system.

4
Bread preparation is an example of a system that
involves inputs, outputs, and processing
1

Input

3
Process

Output

5
Computer system
There are many different systems
that are used in everyday life, and Input devices Process Output devices
the computer system is one of these
systems.

Input : devices include the keyboard,


mouse, scanner, microphone, and
camera.

Processing : (CPU) is the primary


component responsible for
performing processing operations

Output : devices include the monitor,


printer, speakers, and headphones. 01 02 03
6
Small Computer Systems

Microcontroller
• Microcontroller unit, is a small computer system that is designed to perform specific tasks.
• Used in a wide range of applications like remote controls and automobiles

• An MCU typically consists of :


• Processing unit Memory Input/output (I/O) peripherals

• All integrated onto a single chip. It's designed to be a self-contained system that can perform its task without the need for
external components or hardware.
Embedded Systems
What is the meaning of Embedded :
Embedded systems are computer systems that are designed to perform specific tasks or functions within
a larger system or device.

Constraining Embedded

8
Any Embedded Systems Must Be :
low-cost

Small Size

Advantages

High Performance

Low Power Consumption


9
Microcontroller VS Raspberry pi

Specific Purpose General Purpose

Limited in resources Unlimited in resources

less powerful Microcontroller Raspberry pi R & D Phase

Low Cost more expensive

low-power more power

10
The Raspberry Pi is a big buffet and you choose what you
want from it in order to get the microcontroller that will
spend you and the microcontroller is the dish that you will eat
Raspberry pi Microcontroller

11
Comparison between
MCU Raspberry pi
raspberry pi and MCU
RAM 2KB RAM 4-8GB
90%
Memory:
Raspberry Pi typically has much more
ROM 32KB ROM Up to 2 TB
memory than MCUs. For example, the latest
Raspberry Pi 4 model comes with up to 8GB
of RAM
Speed 16 MHz Speed 1.5- 1.8 GHz
while MCUs typically have only a few
kilobytes to a few hundred kilobytes of
memory.
This difference in memory capacity allows
Raspberry Pi to run more complex software
applications

12
Comparison between
MCU Raspberry pi
raspberry pi and MCU
RAM 2KB RAM 4-8GB
90%
Processor speed:
Raspberry Pi is generally much faster than
ROM 32KB ROM Up to 2 TB
MCUs in terms of processor speed.
The latest Raspberry Pi 4 model has a quad-
core ARM Cortex-A72 CPU with a clock
Speed 16 MHz Speed 1.5- 1.8 GHz
speed of up to 1.5GHz,
while MCUs typically have much slower clock
speeds, ranging from a few megahertz to a
few hundred megahertz.
This difference in processor speed allows
Raspberry Pi to perform more complex
computations and handle more data-
intensive tasks.
Do we embedded a microcontroller or a Raspberry Pi
in the washing machine?
System on board (SoB) VS System on chip (SoC)

System on board = System on module System on chip

Ex : Raspberry Pi Ex : Microcontroller

Size : Size :

Cost : Cost :

Performance : Performance :

Power : Power :

Configurability : Configurable Configurability : Fixed


Instructions :

• to talk to computer you need to give it instructions in a way that it can understand.

Machine language
consists of binary code, which is a series of 0s and 1s that represent the basic instructions that a computer can execute.
Each machine language instruction corresponds to a specific operation that the computer can perform,
such as adding two numbers represent as : 010 10 110
Operations-Operand1-Operand2

Operations : Operations can include arithmetic (e.g. addition, subtraction, multiplication, division),
logical (e.g. AND, OR, NOT), comparison (e.g. equal to, less than, greater than), and others.
Operand is a value or variable that is used in an operation.
Example : "5 + 3", the operands are the values 5 and 3, and the operation is addition.
Assembly Language :
Machine language is difficult to write and understand, so programmers developed other languages called
low-level programming languages to make programming easier.
Among these languages is Assembly language, which is closer to human language and easier to
understand than machine language.

Assembly language is a low-level programming language

To convert assembly language code to machine code, you need an assembler.

Assembly language, while being a low-level programming language that is closer


to machine language than high-level programming languages,
has some disadvantages compared to high-level programming languages.
Assembly Language :
Assembly language code written for one computer architecture :
For example, the assembly language code written for an Intel x86 processor cannot be executed on an
ARM processor without modification, because the instruction sets and memory architectures of these
processors are different.
Then If you want to learn assembly language, you don't necessarily need to learn it for all computer
architectures.
C Language :
C language is considered to be a target-independent programming language, which means that C code can be
compiled to machine code for a variety of different computer architectures without modification.
Assembly language is a low-level programming language
To convert C code to machine language, you need to use a C compiler.
A C compiler is a program that translates the human-readable source code written in C into machine code that can be
executed by a computer.
The process of converting C code to machine language involves several steps, including:
Compilation: In this step, the C compiler takes the pre-processed source code and generates assembly code, which is
a low-level representation of the source code.
Assembly: In this step, the assembly code is translated into machine code by
an assembler.
An example C program that adds two numbers:
Execution Process
File.c

Tool Chain

Machine languge

.bin .Hex .elf .exe

20 20
Why C in Embedded Systems
Portability
C is a portable language that can be compiled to machine code for a
01 wide range of hardware platforms, making it an ideal choice for
embedded systems that need to run on different hardware
architectures.

Intermediate language

C is closer to hardware compared to high-level languages.


02 For example, C allows programmers to directly access memory,
processors, and other devices
In Embedded Systems we aim to Limit in resources

Low Foot Print

03 C is considered a low-footprint language. This means that C programs


tend to use less memory and have smaller executable file sizes
compared to programs written in other language

21
Tool chain
What is the Tool chain :
A tool chain in the context of C programming refers to a set of software tools used in the development of C
programs. The tool chain typically includes a compiler, linker, assembler, and various other tools for building
and debugging C programs.

There are several popular tool chains used in C programming, depending on the specific needs and
requirements of the project.
Some of the popular tool chains are:

Clang/LLVM
GCC toolchain: GCC Keil toolchain
toolchain
(GNU Compiler Collection)

22
GCC
GNU Compiler Collection
The GNU Compiler Collection (GCC) is a popular open-source compiler system that supports several
programming languages, including C, C++

The abbreviation GNU stands for "GNU's Not Unix".

GCC
GNU

Not GNU Compiler Collection

Unix

23
Native tool chain VS cross tool chain
Native tool chain Cross tool chain

A native toolchain is a Cross-toolchain is a


toolchain that is installed Native Cross tool toolchain that is installed
and run on the same tool chain chain and run on a different
platform as the target platform than the target
system system.

24
TEC

THANK

You might also like