SlideShare a Scribd company logo
By: Mostafa El-koumy
Day #1
Embedded
Introduction
?
o Introduction to Embedded C.
o Embedded Software Architecture.
o Memory usage.
o Embedded Development Environment.
o Interrupts.
o Keywords.
o Some Embedded Systems concepts.
By: Mostafa El-koumy
INTRODUCTION
 Embedded Systems is all things around you which have
something called electronic brain to make some sort of
artificial intelligence.
 Embedded C is a prober subset of C language suitable for
Embedded systems, it defines only a new concept of
writing software.
 Using Embedded C, we should handle everything used in
the program like Memory Management, HW Registers,
interrupts, …. Etc.
By: Mostafa El-koumy
MISRA RULES
 Motor Industry Software Reliability Association.
 Collaboration between engineering consultancies which
seeks to promote best practice in developing
Automotive Systems and other embedded systems.
 To this end MISRA publishes documents that provide
accessible information for engineers and management,
and holds events to permit the exchange of experiences
between practitioners.
 URL : www.misra.org.uk
 EX:
By: Mostafa El-koumy
EMBEDDED SOFTWARE ARCHITECTURE
By: Mostafa El-koumy
EMBEDDED SOFTWARE ARCHITECTURE (CON’T)
By: Mostafa El-koumy
CODE FLOW
 All the code is running within infinite loop in main except:
 Initialization code.
 Interrupt handlers, interrupt service routines (ISR).
 The other code runs normally
int main (void)
{
intitializeModule();
sei();
while(1){
startApplication();
}
return 0;
}
By: Mostafa El-koumy
BACKGROUND/FOREGROUND TASKS (LOW COST)
By: Mostafa El-koumy
SOFTWARE MODELING
Function
C file
Module
Project
C file(s) H file(s)
SW
module
Uart.c
Uart.h
Uart_irq.c
Uart_cfg.h
MEMORY USAGE BY LINKER SCRIPT
 The HW Registers
 Stack space that grow down
 Local variables
 Functions return address
 Heap Space that grow up
 Zero default initialized variables
 Initialized with value by developer
By: Mostafa El-koumy
I/O Addresses
Stack (grow down)
Heap (Grow up)
Un-initialized data
(.BSS)
Initialized data
DEVELOPMENT ENVIRONMENT
 IDE which has
 Text editor.
 Cross compiler produce machine language
By: Mostafa El-koumy
DEVELOPMENT ENVIRONMENT
 Development Kit
By: Mostafa El-koumy
DEVELOPMENT ENVIRONMENT
 In circuit Debugger (ICD)
 HW device connects to the microprocessor using JTAG/SWD
interface to support external control of the microprocessor
using debugger.
 Restrictions of debugging capabilities is specified by the
microprocessor.
By: Mostafa El-koumy
DEVELOPMENT ENVIRONMENT
 In circuit Emulator (ICE)
 HW device used to debug embedded SW. it replaces the
microprocessor with control over all the aspects of it and it
usually emulate all the microprocessor family.
By: Mostafa El-koumy
PROGRAMMING PROCESS DIAGRAM
By: Mostafa El-koumy
GPIO MODULE
Exercise
1
By: Mostafa El-koumy
INTERRUPTS
 an interrupt is a signal to the processor emitted by
hardware or software indicating an event that needs
immediate attention. An interrupt alerts the processor
to a high-priority condition requiring the interruption of
the current code the processor is executing.
 Interrupt sources
 Internal peripherals.
 External interrupts.
 SW interrupts.
 Exception thrown by processors.
By: Mostafa El-koumy
INTERACTIVE QUESTIONS
 Mask able interrupt?
 Non-Mask able interrupts?
 Level triggered external interrupt?
 Edge triggered external interrupt?
 Interrupt nesting?
By: Mostafa El-koumy
INTERRUPT TIMING
 Interrupt latency?
 Context?
 Interrupt response?
 Interrupt recovery?
By: Mostafa El-koumy
EMBEDDED KEYWORDS (INTERACTIVE)
 Scope and life time with keywords:
 Static local
 Static global
 Volatile
 Const
 Extern
 register
By: Mostafa El-koumy
FUNCTIONS VS MACROS
 Macros in completely text replacement so it increase the
code size and duplications.
 Function is preferred.
By: Mostafa El-koumy
MACROS VS INLINE FUNCTIONS
 In Inline functions Compiler substitute the function call
by function code like MACROS.
 MACROS is supported by preprocessor so all the IDEs
supports it.
 Inline is supported by some compilers.
 Inline function performs type checking but MACROs not.
 Inline function could be traced but MACROs not.
 Some compiler disable inline function when the its code
is large.
Exercise
2
By: Mostafa El-koumy
UART MODULE
Thank you for
your attention!
Any Questions?
By: Mostafa El-koumy
CONTACT DETAILS
 Mostafa El-koumy
 Embedded SW Developer
 mostafa.elkoumy@gmail.com

More Related Content

What's hot (20)

PDF
非同期ロード画面 Asynchronous Loading Screen
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4のモバイル向け機能や最新情報などを改めて紹介!2019
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
[CEDEC+KYUSHU 2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介! + UE4.18 モバイ...
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPTX
Introduction to kotlin and OOP in Kotlin
vriddhigupta
 
PDF
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
Linaro
 
PDF
Android media framework overview
Jerrin George
 
PPTX
What is Bootloader???
Dinesh Damodar
 
PPTX
Introduction to AVR Microcontroller
Mahmoud Sadat
 
PDF
UE4のローカライズ機能紹介 (UE4 Localization Deep Dive)
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
ARM AAE - System Issues
Anh Dung NGUYEN
 
PPTX
Understand more about C
Yi-Hsiu Hsu
 
PPTX
Intel core i7 processors
Self employed
 
PDF
Programming with PIC microcontroller
Raghav Shetty
 
PPTX
[CEDEC2018] UE4アニメーションシステム総おさらい
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPTX
An AI accelerator ASIC architecture
Khanh Le
 
PPTX
Higher Order Component React
Heber Silva
 
PDF
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPT
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
PPTX
Arm cortex-m4 programmer model
Mohammed Gomaa
 
非同期ロード画面 Asynchronous Loading Screen
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4のモバイル向け機能や最新情報などを改めて紹介!2019
エピック・ゲームズ・ジャパン Epic Games Japan
 
[CEDEC+KYUSHU 2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介! + UE4.18 モバイ...
エピック・ゲームズ・ジャパン Epic Games Japan
 
Introduction to kotlin and OOP in Kotlin
vriddhigupta
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
Linaro
 
Android media framework overview
Jerrin George
 
What is Bootloader???
Dinesh Damodar
 
Introduction to AVR Microcontroller
Mahmoud Sadat
 
UE4のローカライズ機能紹介 (UE4 Localization Deep Dive)
エピック・ゲームズ・ジャパン Epic Games Japan
 
ARM AAE - System Issues
Anh Dung NGUYEN
 
Understand more about C
Yi-Hsiu Hsu
 
Intel core i7 processors
Self employed
 
Programming with PIC microcontroller
Raghav Shetty
 
[CEDEC2018] UE4アニメーションシステム総おさらい
エピック・ゲームズ・ジャパン Epic Games Japan
 
An AI accelerator ASIC architecture
Khanh Le
 
Higher Order Component React
Heber Silva
 
[CEDEC2017] 最新モバイルゲームの実例からみるUE4のモバイル向け機能・Tipsを全部まるっとご紹介!
エピック・ゲームズ・ジャパン Epic Games Japan
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Arm cortex-m4 programmer model
Mohammed Gomaa
 

Viewers also liked (20)

PDF
C Programming For Embedded Systems
Ganesh Samarthyam
 
PPTX
Embedded C
Krunal Siddhapathak
 
PPT
Embedded c programming22 for fdp
Pradeep Kumar TS
 
PPTX
8051 programming skills using EMBEDDED C
Aman Sharma
 
PPTX
Embedded c
Ami Prakash
 
PPT
Manufacturing Automation and Digitization
HCL Technologies
 
PPTX
The Internet of Things. Wharton Guest Lecture by Sandeep Kishore – Corporate ...
HCL Technologies
 
PDF
HCLT Brochure: Embedded Engineering
HCL Technologies
 
PPT
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
PPT
C++ for Embedded Programming
Colin Walls
 
PPTX
States & Capitals 111
Bermanburgh
 
PPTX
Embedded c programming
PriyaDYP
 
ODP
C prog ppt
xinoe
 
PDF
Module 05 Preprocessor and Macros in C
Tushar B Kute
 
PDF
Innovation in Medical Devices – Embedded Blood Glucose Meter in Smartphones
HCL Technologies
 
PDF
Embedded Technology
HCL Technologies
 
PDF
Embedded SW Interview Questions
PiTechnologies
 
PDF
Preprocessor
Learn By Watch
 
PDF
Standard embedded c
Tam Thanh
 
C Programming For Embedded Systems
Ganesh Samarthyam
 
Embedded c programming22 for fdp
Pradeep Kumar TS
 
8051 programming skills using EMBEDDED C
Aman Sharma
 
Embedded c
Ami Prakash
 
Manufacturing Automation and Digitization
HCL Technologies
 
The Internet of Things. Wharton Guest Lecture by Sandeep Kishore – Corporate ...
HCL Technologies
 
HCLT Brochure: Embedded Engineering
HCL Technologies
 
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
C++ for Embedded Programming
Colin Walls
 
States & Capitals 111
Bermanburgh
 
Embedded c programming
PriyaDYP
 
C prog ppt
xinoe
 
Module 05 Preprocessor and Macros in C
Tushar B Kute
 
Innovation in Medical Devices – Embedded Blood Glucose Meter in Smartphones
HCL Technologies
 
Embedded Technology
HCL Technologies
 
Embedded SW Interview Questions
PiTechnologies
 
Preprocessor
Learn By Watch
 
Standard embedded c
Tam Thanh
 
Ad

Similar to Embedded C workshop (20)

PDF
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
PPTX
introduction to embedded system presentation
Amr Rashed
 
PDF
Arm based controller - basic bootcamp
Roy Messinger
 
PPT
Introduction to embedded systems
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PDF
Introduction to Firmware
Caroline Murphy
 
PPTX
Introduction to embedded systems
RAMPRAKASHT1
 
PPT
Embedded systems
Rajanikanth U
 
PDF
ERTS_Unit 1_PPT.pdf
VinothkumarUruman1
 
PPTX
Introduction to Embedded Systems and Microcontrollers
Islam Samir
 
PPTX
Embedded Systems
Benjim Thomas Mathew
 
PPT
UNIT-III ES.ppt
DustinGraham19
 
PPTX
Introduction to embedded system
Revathi Subramaniam
 
PDF
Embedded System -Lyla B Das.pdf
JohnMcClaine2
 
PPTX
Introduction to Embedded Systems
Sandeep Reddy
 
PDF
es1-150721100817-lva1-app6891.pdf
Ashwin180668
 
PDF
Introduction to Embedded Systems a Practical Approach
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PPTX
UNIT 1.pptx
lalithamani sampath
 
PPTX
Introduction to embedded System.pptx
Pratik Gohel
 
PPTX
ESD unit 1.pptx
VamsiReddy171587
 
PPT
Embedded systems
PROVAB TECHNOSOFT PVT. LTD.
 
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
introduction to embedded system presentation
Amr Rashed
 
Arm based controller - basic bootcamp
Roy Messinger
 
Introduction to embedded systems
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to Firmware
Caroline Murphy
 
Introduction to embedded systems
RAMPRAKASHT1
 
Embedded systems
Rajanikanth U
 
ERTS_Unit 1_PPT.pdf
VinothkumarUruman1
 
Introduction to Embedded Systems and Microcontrollers
Islam Samir
 
Embedded Systems
Benjim Thomas Mathew
 
UNIT-III ES.ppt
DustinGraham19
 
Introduction to embedded system
Revathi Subramaniam
 
Embedded System -Lyla B Das.pdf
JohnMcClaine2
 
Introduction to Embedded Systems
Sandeep Reddy
 
es1-150721100817-lva1-app6891.pdf
Ashwin180668
 
Introduction to Embedded Systems a Practical Approach
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
UNIT 1.pptx
lalithamani sampath
 
Introduction to embedded System.pptx
Pratik Gohel
 
ESD unit 1.pptx
VamsiReddy171587
 
Embedded systems
PROVAB TECHNOSOFT PVT. LTD.
 
Ad

Recently uploaded (20)

PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 

Embedded C workshop

  • 2. Introduction ? o Introduction to Embedded C. o Embedded Software Architecture. o Memory usage. o Embedded Development Environment. o Interrupts. o Keywords. o Some Embedded Systems concepts. By: Mostafa El-koumy
  • 3. INTRODUCTION  Embedded Systems is all things around you which have something called electronic brain to make some sort of artificial intelligence.  Embedded C is a prober subset of C language suitable for Embedded systems, it defines only a new concept of writing software.  Using Embedded C, we should handle everything used in the program like Memory Management, HW Registers, interrupts, …. Etc. By: Mostafa El-koumy
  • 4. MISRA RULES  Motor Industry Software Reliability Association.  Collaboration between engineering consultancies which seeks to promote best practice in developing Automotive Systems and other embedded systems.  To this end MISRA publishes documents that provide accessible information for engineers and management, and holds events to permit the exchange of experiences between practitioners.  URL : www.misra.org.uk  EX: By: Mostafa El-koumy
  • 6. EMBEDDED SOFTWARE ARCHITECTURE (CON’T) By: Mostafa El-koumy
  • 7. CODE FLOW  All the code is running within infinite loop in main except:  Initialization code.  Interrupt handlers, interrupt service routines (ISR).  The other code runs normally int main (void) { intitializeModule(); sei(); while(1){ startApplication(); } return 0; } By: Mostafa El-koumy
  • 8. BACKGROUND/FOREGROUND TASKS (LOW COST) By: Mostafa El-koumy
  • 9. SOFTWARE MODELING Function C file Module Project C file(s) H file(s) SW module Uart.c Uart.h Uart_irq.c Uart_cfg.h
  • 10. MEMORY USAGE BY LINKER SCRIPT  The HW Registers  Stack space that grow down  Local variables  Functions return address  Heap Space that grow up  Zero default initialized variables  Initialized with value by developer By: Mostafa El-koumy I/O Addresses Stack (grow down) Heap (Grow up) Un-initialized data (.BSS) Initialized data
  • 11. DEVELOPMENT ENVIRONMENT  IDE which has  Text editor.  Cross compiler produce machine language By: Mostafa El-koumy
  • 12. DEVELOPMENT ENVIRONMENT  Development Kit By: Mostafa El-koumy
  • 13. DEVELOPMENT ENVIRONMENT  In circuit Debugger (ICD)  HW device connects to the microprocessor using JTAG/SWD interface to support external control of the microprocessor using debugger.  Restrictions of debugging capabilities is specified by the microprocessor. By: Mostafa El-koumy
  • 14. DEVELOPMENT ENVIRONMENT  In circuit Emulator (ICE)  HW device used to debug embedded SW. it replaces the microprocessor with control over all the aspects of it and it usually emulate all the microprocessor family. By: Mostafa El-koumy
  • 17. INTERRUPTS  an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing.  Interrupt sources  Internal peripherals.  External interrupts.  SW interrupts.  Exception thrown by processors. By: Mostafa El-koumy
  • 18. INTERACTIVE QUESTIONS  Mask able interrupt?  Non-Mask able interrupts?  Level triggered external interrupt?  Edge triggered external interrupt?  Interrupt nesting? By: Mostafa El-koumy
  • 19. INTERRUPT TIMING  Interrupt latency?  Context?  Interrupt response?  Interrupt recovery? By: Mostafa El-koumy
  • 20. EMBEDDED KEYWORDS (INTERACTIVE)  Scope and life time with keywords:  Static local  Static global  Volatile  Const  Extern  register By: Mostafa El-koumy
  • 21. FUNCTIONS VS MACROS  Macros in completely text replacement so it increase the code size and duplications.  Function is preferred. By: Mostafa El-koumy
  • 22. MACROS VS INLINE FUNCTIONS  In Inline functions Compiler substitute the function call by function code like MACROS.  MACROS is supported by preprocessor so all the IDEs supports it.  Inline is supported by some compilers.  Inline function performs type checking but MACROs not.  Inline function could be traced but MACROs not.  Some compiler disable inline function when the its code is large.
  • 24. Thank you for your attention! Any Questions? By: Mostafa El-koumy
  • 25. CONTACT DETAILS  Mostafa El-koumy  Embedded SW Developer  [email protected]