0% found this document useful (0 votes)
7 views28 pages

W1.1 Introduction To Embedded System

The document provides an introduction to Embedded Systems, defining them as computing systems dedicated to specific tasks within larger electrical or mechanical systems. It discusses their properties, timing characteristics, and the differences between embedded systems and general-purpose computers, as well as various hardware options and the development process. Additionally, it highlights the importance of low-level and high-level programming languages in embedded system applications.

Uploaded by

Andrew Koh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views28 pages

W1.1 Introduction To Embedded System

The document provides an introduction to Embedded Systems, defining them as computing systems dedicated to specific tasks within larger electrical or mechanical systems. It discusses their properties, timing characteristics, and the differences between embedded systems and general-purpose computers, as well as various hardware options and the development process. Additionally, it highlights the importance of low-level and high-level programming languages in embedded system applications.

Uploaded by

Andrew Koh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Introduction to

Embedded System
An Embedded System (ES) is ….

• a computing system that does a specific task


inside a machine or larger electrical system.
(Cambridge Dictionary)

• a computer system that is embedded into a


larger electrical or mechanical system
performing specific dedicated tasks of that
larger system. (Prof. Peter Waszecki)
• a controller with a dedicated function within a
larger mechanical or electrical system, often
with real-time computing constraints. (Wikipedia)
• a combination of computer hardware and
software, either fixed in capability or
programmable, designed for a specific function
or functions within a larger system.
(internetofthingsagenda.techtarget.com)

• …
Embedded Systems?

Cyber-Physical Systems (CPS)

http://www.imm.dtu.dk/~jbjo/cps.html https://www.flickr.com/photos/wilgengebroed/8249565455
Embedded Systems vs General Purpose Computers

Embedded systems General purpose computers


Analogue and Digital World

The human world is


analogue and continuous
while the computer world Embedded systems must use a mix
is digital and discrete. of analogue and digital electronics to
represent the corresponding signals.

[https://en.wikipedia.org/wiki/Digital_audio]
Properties of Embedded Systems

• …are an embedded or integral part of a device, often including


hardware and electromechanical parts.
• ...are dedicated to handle specific tasks that are known and
assigned to them at design-time.
• …use sensors and actuators to interact with the real world.
• …have strict timing constraints due to their interaction with the
physical world in a safety-critical environment.
• …use limited resources (e.g. memory, processing power, power,
etc.) compared to general-purpose computers.
• …are based on microcontrollers (i.e. CPUs with integrated
memory and/or peripheral interfaces).

[https://www.efxkits.us/classification-of-embedded-systems]
Timing characteristics

Many embedded systems have real-time constraints…but what is real-time?

A real-time system is one in which the correctness of the


application depends on both their functional and temporal
results (the time at which the result is produced).
In other words, a late answer is a wrong answer.
Consequences of tasks missing their deadlines helps to classify real-time systems:
Non real-time constraints Soft real-time constraints Hard real-time constraints
▪ Tasks have no deadlines ▪ Tasks are allowed to miss deadlines ▪ It is imperative that tasks meets their
A late response usually does not occasionally deadlines at all times
significantly affect the performance and ▪ A late response can degrade the system ▪ A late response is not considered even if
functionality performance its value is correct
▪ A late response causes no danger ▪ A missed deadline causes no significant ▪ Missed deadline can have catastrophic
▪ E.g., TV remote control, lawn sprinkler, danger consequences
window lifter ▪ E.g., mobile phone, air-conditioning, ▪ E.g., nuclear reactor temperature, air-
refrigerator bag controller, flight control system
How many processors can be found in a modern car?

• Engine Control Unit (ECU)


• Transmission Control Module
• Anti-lock Braking System (ABS) Controller
• Airbag Control Module
• Body Control Module
• Infotainment System Controller
• Climate Control System Controller
• Power Steering Control Module
• Parking Sensor and Camera Controllers
• Electronic Stability Control (ESC) Module
• Tire Pressure Monitoring System (TPMS) Controller
• Adaptive Cruise Control (ACC) Module
• Lane Departure Warning System (LDWS) Controller
• Keyless Entry System Controller
• Lighting Control Module (for headlights, taillights, etc.)
• Electric Seat Control Module
• Battery Management System (BMS) Controller (in
hybrid/electric vehicles)
Different Embedded Systems Hardware Options

Microcontroller (µC) System on Chip (SoC) Application Specific Neural Processing


Integrated Chip (ASIC) Unit (NPU)

Microprocessor (µP) Digital Signal Field-Programmable Graphics Processing


Processor (DSP) Gate Array (FPGA) Unit (GPU)
Microprocessor Microcontroller
System on Chip (SoC)

Apple A16 Bionic

Other SoC
• Qualcomm - Snapdragon • Google - Tensor
• Samsung - Exynos • Broadcom - BCM series
• Huawei - Kirin (used in Raspberry Pi)
• MediaTek - Dimensity, Helio • Intel - Atom, Movidius
• Apple - A-series (e.g., A16 • AMD - Ryzen Embedded
Bionic), M-series (e.g., M1, • Rockchip - RK series
M2) • Unisoc - Tiger series
• NVIDIA - Tegra • Allwinner - A-series
Microcontroller SoC
FPGA

• Reconfigurable digital systems.


• Distinct advantage for data-driven and fine-grained parallel computations.
Graphics Processing Unit (GPU)

512

512

262,144 pixels!!
Different Embedded Systems Hardware Options

Microcontroller (µC) System on Chip (SoC) Application Specific Neural Processing


Integrated Chip (ASIC) Unit (NPU)

Microprocessor (µP) Digital Signal Field-Programmable Graphics Processing


Processor (DSP) Gate Array (FPGA) Unit (GPU)
Building an Embedded System Application

https://xkcd.com/303/
‘Typical’ Product Development Process
• Requirements (ISO/IEC/IEEE 29148:2011)
• Constraints
• Specifications • Block Diagrams (UML)
• Constraints High level • Data Flow Graph
Analyze Design
the problem
Engineering
• New requirements Design
• New constraints
Not done

Done
• System Hardware
Deployment Testing • Code Software
Implementation • Call graph
• Data structures
• I/O interfaces (e.g. drivers)

Valvano, J. W. (2015). Embedded Systems. Jonathan W. Valvano.


Low-level languages for different ES H/W

• Low-level language
• good for squeezing the best performance from the underlying hardware

• compact and more optimized code

• High-level language required to improve:


• Productivity

• Code abstraction

• Portable

• Machine only understands low level language


• need a compiler to translate the high-level language

*Assembly vs Machine Code: https://www.youtube.com/watch?v=Mv2XQgpbTNE


Assembly vs C

Assembly C

str fp, [sp, #-4]!


add fp, sp, #0
sub sp, sp, #12
int add() mov r3, #6
{ str r3, [fp, #-8]
mov r3, #6 int a = 6; ARM ldr r3, [fp, #-8]
add r3, r3, #5 a = 5 + a; GCC 8.2 add r3, r3, #5
return 0; str r3, [fp, #-8]
} mov r3, #0
mov r0, r3
add sp, fp, #0
ldr fp, [sp], #4
bx lr
C/Assembly Code into Binary File
C Library (.a) / C-SDK
compiler

C Files (.c) Object Files (.o)

Loader /
LINKER Locator

Reset Code (reset.s) Binary File Memory


(.bin)

assembler

Assembly Files (.s) Object Files (.o) Linker Script (.ld)

Startup Code (crt0.s)


Compiler / Assembler

• Compiler
• Translate programs written in human-readable language into an
equivalent set of opcode for a particular processor

• Cross compiling - compiling on a host for a target platform

• Native compiling - compiling for the same architecture you're running under

• Example: GCC, KEIL, IAR, CCS, etc.

• Assembler cross compiling


• One-to-one translation
• https://www.youtube.com/watch?v=Mv2XQgpbTNE
C/Assembly Code into Binary File
C Library (.a) / C-SDK
compiler

C Files (.c) Object Files (.o)

Loader /
LINKER Locator

Reset Code (reset.s) Binary File Memory


(.bin)

assembler

Assembly Files (.s) Object Files (.o) Linker Script (.ld)

Startup Code (crt0.s)


Startup code

• A small block of assembly language code that prepares the way for the execution of
software written in a high-level language.
• Most cross-compilers for embedded systems include an assembly language file called
startup.asm or crt0.s (short for C runtime).
• Typical startup code:
• Disable interrupt
• Copy data into RAM
• Zero uninitialized data area
• Allocate space and initialize the stack
• Create and initialize the heap
• Enable interrupt
• Call main
C/Assembly Code into Binary File
C Library (.a) / C-SDK
compiler

C Files (.c) Object Files (.o)

Loader /
LINKER Locator

Reset Code (reset.s) Binary File Memory


(.bin)

assembler

Assembly Files (.s) Object Files (.o) Linker Script (.ld)

Startup Code (crt0.s)


Linker

• takes one or more object files generated by a compiler/assembler


and combines them into a single executable file.

• cross-file dependencies are resolved properly, e.g. if you define a variable/function


in one .c file, and use it in another .c file, the linker connects the two together.

• link `reuse’ library files; static and dynamic

• every link is controlled by a linker script, that describes how the executable are mapped
onto the memory during execution.
Prof, Explain It to Me in Plain English
C SDK Compiler Bootloader
The C SDK (Software Development Kit) for The compiler is a tool that translates the user's The bootloader is a small program pre-installed
the Raspberry Pi Pico provides a collection C source code into machine code (binary) that on the Raspberry Pi Pico. It is responsible for
of libraries, functions, and tools that simplify the Raspberry Pi Pico can understand. The loading the compiled binary into the
hardware interaction. It abstracts the low- compiler processes the source code, linking it microcontroller's flash memory and executing it.
level details of the microcontroller, allowing with the necessary libraries from the C SDK, When the Raspberry Pi Pico is powered on or
the user to focus on writing high-level and generates an executable binary file. This reset, the bootloader checks for the presence of
application code. The SDK offers pre-written binary file is typically in the form of a .uf2 or .bin a new binary file (e.g., via USB) and writes it to
code to manage peripherals, such as GPIO, file. flash memory if found. If no new binary is
PWM, UART, and others. detected, it simply runs the existing program

Similar Terms: stored in flash.


• Application Programming Interface (API) SOURCE
• Development Framework, e.g. Arduino CODE
• Board Support Package (BSP)
BOOTLOADER/
• Toolkit / Toolchain COMPILER .UF2
DEBUGGER
• Middleware
• Library
C SDK
What are the Current Trends
Summary

▪ Introduction to Embedded Systems


▪ The properties and characteristics of Embedded Systems
▪ Different types of processors
▪ The difference between microprocessors and microcontrollers
▪ Embedded System Development Cycle
▪ Building an Embedded System application

You might also like