Team Emertxe
Introduction to Embedded
Concepts
Communication Protocols
RTOS
Contents
Introduction to Embedded
Contents
●
Concepts
●
Communication Protocols
●
RTOS
●
A Case Study
Embedded System Concepts
Embedded Systems
Concepts
●
What do you understand as Embedded System?
●
How different they are from a General Purpose System (GPS)?
Embedded Systems
Definition
“Any Hardware System which is intended to do a
specific task
can be called as an Embedded System”
Embedded Systems
Components
Embedded Systems
Requirements
●
Reliability
●
Cost-effectiveness
●
Low Power Consumption
●
Efficient Usage of Processing Power
●
Efficient Usage of Memory
●
Appropriate Execution Time
Embedded Systems
Trends
●
Processors
●
Memory
●
Operating Systems
●
Programming Languages
●
Development Tools
Embedded Systems
Common Design Metrics
●
Time to Prototype
●
Power
●
Performance & Correctness
●
Size
●
NRE
●
Maintainability & Flexibility
●
Safety
●
Unit Cost
●
Time to Market
Embedded Systems
Development Environment - Example
Embedded Systems
Development Tools
●
Compilers and its friends
●
Debuggers
●
Simulators
●
Emulators
●
Programmers or Flashers
Communication Protocols
Embedded Systems
Communication Protocols - Serial
●
A bit getting transmitted at a given instance of time
●
Must follow one of the below mode
– Simplex
– Half duplex
– Duplex
●
The type of transfer could be
– Synchronous
– Asynchronous
●
Sync entity has be decided
Communication Protocols - I2
C
Embedded Systems
Communication Protocols - I2
C
●
Two Line Interface
– Synchronous
– Half duplex
– Multi master and multi slaves
●
Software Addressable
●
Multi Master with CD
●
Serial, 8 bit Oriented, Bidirectional with 4 Modes
Embedded Systems
Communication Protocols – I2
C - Example
LCD Driver EEPROM RTC
Temperature
Sensor
ADC
Microcontroller
A
Microcontroller
B
DATA
CLOCK
Embedded Systems
Communication Protocols – I2
C – Wired AND
SCL
SDA
VDD
SCLN1
OUT
SCL
IN
DATA1
OUT
DATA
IN
SCLN2
OUT
SCL
IN
DATA2
OUT
DATA
IN
DEVICE1 DEVICE2
Embedded Systems
Comm... Pro... – I2
C – A complete transfer
SCL
SDA
ADDRESS R/W ACK
1 - 7 8 9
DATA ACK
1 - 8 9
DATA ACK
1 - 8 9
S P
Embedded Systems
Communication Protocols – I2
C – Multi Master
●
Data arbitration
●
Clock Synchronization
Communication Protocols - SPI
Embedded Systems
Communication Protocols - SPI
●
Synchronous
●
Full Duplex
●
Master / Slave
Embedded Systems
Communication Protocols – SPI - Interface Lines
●
SCLK
●
MOSI
●
MISO
●
nSS
Embedded Systems
Communication Protocols – SPI – HW Interfaces
SCLK
MOSI
MISO
SS1
SCLK
MOSI
MISO
SS
Master Slave 1
Single Master and Single Slave
Embedded Systems
Communication Protocols – SPI – HW Interfaces
SCLK
MOSI
MISO
SS1
SCLK
MOSI
MISO
SS
Master Slave 1
Single Master and Three Slaves
SCLK
MOSI
MISO
SS
Slave 2
SCLK
MOSI
MISO
SS
Slave 3
SS2
SS2
Embedded Systems
Communication Protocols – SPI – HW Interfaces
SCLK
MOSI
MISO
SS1
SCLK
MOSI
MISO
SS
Master Slave 1
Single Master and Three Daisy Chained Slaves
SCLK
MOSI
MISO
SS
Slave 2
SCLK
MOSI
MISO
SS
Slave 3
RTOS
Embedded Systems
RTOS – What?
●
Real Time Operating System
●
An scheduling implementation which that guarantees a
certain capability within a specified time constraint
Embedded Systems
RTOS – Why?
●
Most operating systems appear to allow multiple
programs to execute at the same time, known as
multitasking
●
Scheduler gives an illusion of simultaneous execution by
rapidly switching between each program even though its
running in a single core!!
●
So the GPOS scheduler will try and ensure the system
remains responsive to its user
●
But an embedded system which generally designed to
have single purpose, should efficiently handle all its
events fairly, and would require an better scheduler
which could handle its resources
Embedded Systems
RTOS – Why?
●
Most operating systems appear to allow multiple
programs to execute at the same time, known as
multitasking
●
Scheduler gives an illusion of simultaneous execution by
rapidly switching between each program even though its
running in a single core!!
●
So the GPOS scheduler will try and ensure the system
remains responsive to its user
●
But an embedded system which generally designed to
have single purpose, should efficiently handle all its
events fairly, and would require an better scheduler
which could handle its resources
Embedded Systems
RTOS – How it achieve? - Architectural Difference
Mionolithic Kernel
Based Operating System
Micro Kernel
Based Operating System
VFS
IPC, File Systems
Scheduler, Virtual Memory
Device Drivers, Dispatcher... Basic IPC, Virtual Memory, Scheduling
VFS
Application
Device Drivers, Dispatcher...
HardwareHardware
User
Mode
Kernel
Mode
Application
Unix
Server
Device
Driver
File
Server
System Call
Embedded Systems
RTOS – When?
●
RTOS is not a required component of all real-time
application in embedded systems. An embedded system
in a simple electronic semi automatic washing machine
does not require RTOS.
●
But, embedded systems are becoming more complex
hardware-wise with every generation
●
With increase in its complexity, application programs
running on the embedded system platforms will become
increasingly complex to be managed as they strive to
meet the system response requirement
Embedded Systems
RTOS – Classifications
●
Hard real-time: degree of tolerance for missed deadlines
is extremely small or zero. A missed deadline has
catastrophic results for the system
●
Firm real-time: missing a deadline might result in an
unacceptable quality reduction
●
Soft real-time: deadlines may be missed and can be
recovered from. Reduction in system quality is
acceptable
Embedded Systems
RTOS – Features
●
Multitasking and Pre-emptibility
●
Task Priority
●
Reliable and Sufficient Inter Task Communication
Mechanism
●
Priority Inheritance
●
Predefined Short Latencies
●
Control of Memory Management
Embedded Systems
RTOS – Building Blocks
Task Management
Scheduler
Synchronization
IPC
Semaphore
Memory Management
Interrupt Services
Device I/O Management
BSP
Thank You

Intro to Embedded OS, RTOS and Communication Protocols

  • 1.
    Team Emertxe Introduction toEmbedded Concepts Communication Protocols RTOS
  • 2.
  • 3.
  • 4.
  • 5.
    Embedded Systems Concepts ● What doyou understand as Embedded System? ● How different they are from a General Purpose System (GPS)?
  • 6.
    Embedded Systems Definition “Any HardwareSystem which is intended to do a specific task can be called as an Embedded System”
  • 7.
  • 8.
    Embedded Systems Requirements ● Reliability ● Cost-effectiveness ● Low PowerConsumption ● Efficient Usage of Processing Power ● Efficient Usage of Memory ● Appropriate Execution Time
  • 9.
  • 10.
    Embedded Systems Common DesignMetrics ● Time to Prototype ● Power ● Performance & Correctness ● Size ● NRE ● Maintainability & Flexibility ● Safety ● Unit Cost ● Time to Market
  • 11.
  • 12.
    Embedded Systems Development Tools ● Compilersand its friends ● Debuggers ● Simulators ● Emulators ● Programmers or Flashers
  • 13.
  • 14.
    Embedded Systems Communication Protocols- Serial ● A bit getting transmitted at a given instance of time ● Must follow one of the below mode – Simplex – Half duplex – Duplex ● The type of transfer could be – Synchronous – Asynchronous ● Sync entity has be decided
  • 15.
  • 16.
    Embedded Systems Communication Protocols- I2 C ● Two Line Interface – Synchronous – Half duplex – Multi master and multi slaves ● Software Addressable ● Multi Master with CD ● Serial, 8 bit Oriented, Bidirectional with 4 Modes
  • 17.
    Embedded Systems Communication Protocols– I2 C - Example LCD Driver EEPROM RTC Temperature Sensor ADC Microcontroller A Microcontroller B DATA CLOCK
  • 18.
    Embedded Systems Communication Protocols– I2 C – Wired AND SCL SDA VDD SCLN1 OUT SCL IN DATA1 OUT DATA IN SCLN2 OUT SCL IN DATA2 OUT DATA IN DEVICE1 DEVICE2
  • 19.
    Embedded Systems Comm... Pro...– I2 C – A complete transfer SCL SDA ADDRESS R/W ACK 1 - 7 8 9 DATA ACK 1 - 8 9 DATA ACK 1 - 8 9 S P
  • 20.
    Embedded Systems Communication Protocols– I2 C – Multi Master ● Data arbitration ● Clock Synchronization
  • 21.
  • 22.
    Embedded Systems Communication Protocols- SPI ● Synchronous ● Full Duplex ● Master / Slave
  • 23.
    Embedded Systems Communication Protocols– SPI - Interface Lines ● SCLK ● MOSI ● MISO ● nSS
  • 24.
    Embedded Systems Communication Protocols– SPI – HW Interfaces SCLK MOSI MISO SS1 SCLK MOSI MISO SS Master Slave 1 Single Master and Single Slave
  • 25.
    Embedded Systems Communication Protocols– SPI – HW Interfaces SCLK MOSI MISO SS1 SCLK MOSI MISO SS Master Slave 1 Single Master and Three Slaves SCLK MOSI MISO SS Slave 2 SCLK MOSI MISO SS Slave 3 SS2 SS2
  • 26.
    Embedded Systems Communication Protocols– SPI – HW Interfaces SCLK MOSI MISO SS1 SCLK MOSI MISO SS Master Slave 1 Single Master and Three Daisy Chained Slaves SCLK MOSI MISO SS Slave 2 SCLK MOSI MISO SS Slave 3
  • 27.
  • 28.
    Embedded Systems RTOS –What? ● Real Time Operating System ● An scheduling implementation which that guarantees a certain capability within a specified time constraint
  • 29.
    Embedded Systems RTOS –Why? ● Most operating systems appear to allow multiple programs to execute at the same time, known as multitasking ● Scheduler gives an illusion of simultaneous execution by rapidly switching between each program even though its running in a single core!! ● So the GPOS scheduler will try and ensure the system remains responsive to its user ● But an embedded system which generally designed to have single purpose, should efficiently handle all its events fairly, and would require an better scheduler which could handle its resources
  • 30.
    Embedded Systems RTOS –Why? ● Most operating systems appear to allow multiple programs to execute at the same time, known as multitasking ● Scheduler gives an illusion of simultaneous execution by rapidly switching between each program even though its running in a single core!! ● So the GPOS scheduler will try and ensure the system remains responsive to its user ● But an embedded system which generally designed to have single purpose, should efficiently handle all its events fairly, and would require an better scheduler which could handle its resources
  • 31.
    Embedded Systems RTOS –How it achieve? - Architectural Difference Mionolithic Kernel Based Operating System Micro Kernel Based Operating System VFS IPC, File Systems Scheduler, Virtual Memory Device Drivers, Dispatcher... Basic IPC, Virtual Memory, Scheduling VFS Application Device Drivers, Dispatcher... HardwareHardware User Mode Kernel Mode Application Unix Server Device Driver File Server System Call
  • 32.
    Embedded Systems RTOS –When? ● RTOS is not a required component of all real-time application in embedded systems. An embedded system in a simple electronic semi automatic washing machine does not require RTOS. ● But, embedded systems are becoming more complex hardware-wise with every generation ● With increase in its complexity, application programs running on the embedded system platforms will become increasingly complex to be managed as they strive to meet the system response requirement
  • 33.
    Embedded Systems RTOS –Classifications ● Hard real-time: degree of tolerance for missed deadlines is extremely small or zero. A missed deadline has catastrophic results for the system ● Firm real-time: missing a deadline might result in an unacceptable quality reduction ● Soft real-time: deadlines may be missed and can be recovered from. Reduction in system quality is acceptable
  • 34.
    Embedded Systems RTOS –Features ● Multitasking and Pre-emptibility ● Task Priority ● Reliable and Sufficient Inter Task Communication Mechanism ● Priority Inheritance ● Predefined Short Latencies ● Control of Memory Management
  • 35.
    Embedded Systems RTOS –Building Blocks Task Management Scheduler Synchronization IPC Semaphore Memory Management Interrupt Services Device I/O Management BSP
  • 36.