Special Lecture
By
N.SHANMUGASUNDARAM
Asst. Professor – ECE Department
Mahendra Engineering College
13/4/2009 1
What is an Embedded System?
Embedded system is a
Microcontroller based
Software driven
Reliable
Real time control system
Autonomous or Human interactive
Operating on diverse physical variables
In diverse environments
13/4/2009 2
What is an Embedded System?
DRIVES
13/4/2009 3
SMART Embedded Systems …
13/4/2009 4
SMART Embedded Systems …
13/4/2009 5
SMART Embedded Systems …
13/4/2009 6
3 MAIN COMPONENTS of Embedded System
HARDWARE
Processor, RAM, ROM, ADC, DAC, Timers, Ports, etc.
APPLICATION SOFTWARE
written in Assembly, C, C++, Java, etc.
13/4/2009 7
CLASSIFICATION of Embedded Systems
• SMALL SCALE:
8/16 bit CPU, little H/w, less S/w complexity, No RTOS,
Battery operated.
• MEDIUM SCALE:
16/32 bit µC or DSPs, Complex H/w & S/w design, RTOS
Source code Engg tools, IDE.
• SOPHISTICATED:
Configurable processors, Cutting edge applications,
Highly complex H/w and S/w design,
13/4/2009 8
SKILLS for Embedded System Engineer
• HARDWARE:
µP / µC, DSPs, Memories, Peripheral devices, sensors,
Computer architecture, Digital electronics, Electronic system design,
Control system, Data communication.
• SOFTWARE:
IDE - Editor, Assemblers, Compilers, Linkers, Debuggers, Simulator.
Programming languages - Assembly, C, C++, Java
RTOS – Vxworks, Win CE, RTLinux, etc.
13/4/2009 9
COMPONENTS of Embedded System Hardware
13/4/2009 10
PROCESSORS for Embedded Systems
PROCESSOR
ALU
Control
Unit
Types of Processor
• General Purpose Processor (µc, µP, DSP, EP,MP)
• Application Specific System Processor
• Multiprocessor system
• GPP/ASIP core with other hardware integrated in ASIC chip.
13/4/2009 11
OTHER HARDWARE for Embedded Systems
13/4/2009 12
SOFTWARE Components in Embedded Systems
13/4/2009 13
Software Development Chain
13/4/2009 14
HARDWARE in Exemplary Embedded Systems
MOBILE PHONE
Processor Multi processor on a Chip
Bus Size 32
Architecture RISC
Cache Memory Yes
ROM 1 MB
EEPROM 32 KB
RAM 1 MB
I/O Ports KBD & Display ports
DAC & ADC Yes
Modulation / Demodulation Yes
DSP instructions Yes
13/4/2009 15
SOFTWARE in Exemplary Embedded Systems
MOBILE PHONE
Editor yes
Interpreter No
Assembler No
Cross Assembler No
Compiler yes
Locator yes
Simulator yes
Source code Engg tools yes
RTOS yes
IDE yes
Stethoscope yes
13/4/2009 16
Exemplary SOC for Mobile Phone
13/4/2009 17
Types of I/O Devices
13/4/2009 18
Structure of Serial Port
13/4/2009 19
Structure of Parallel Port
13/4/2009 20
BUSES for Communication
Buses
Serial Parallel
ISA, EISA, PCI are standard buses for parallel communication used in
PCs, computer network devices, etc.
13/4/2009 21
Types of TIMERS
Timers
Hardware Software
Timer Timer
13/4/2009 22
Structure of Hardware Timer
13/4/2009 23
Usage of TIMERS
13/4/2009 24
Programming Embedded Systems in Assy & C
Assembly C, C++
1. Full use of processor specific 1. Software development cycle is short
instructions. due to usage of functions, std library
functions, modular programming
approach, Top down design, etc.
2. Machine codes are Compact. 2. Data type declarations make
programming easy.
3. Device driver code needs only 3. Type checking eliminates errors.
few assembly instructions.
4. Usage of Control structures
like if-then, do-while, for, etc.
5. Portability to different hardware
and OS.
13/4/2009 25
Programming Embedded Systems using C++
13/4/2009 26
Phases of Software Development
13/4/2009 27
S/w development of Typical application (Automobiles)
Watch 1254
Recording data of usage / malfunction 168
Engine speed 399
Vehicle speed 557
Odometer 999
Wake-up / Sleep down 252
Fuel 376
Alarms 4781
Coolant Temperature 537
Light Control 1925
Automatic gear box 207
(Total 11643 LOC)
13/4/2009 28
Source Code Engineering tool
Features of SNiFF+
• Comprehension, Navigation and Browsing
• Editing
• Configuring (selective disabling of C++ features)
• Compiling
• Debugging
13/4/2009 29
Code / Memory Optimization
13/4/2009 30
Process / Tasks / Threads
13/4/2009 31
Comparison of Function / ISR / Task
13/4/2009 32
Inter Process Communication (IPC)
13/4/2009 33
Inter Process Communication (IPC)
Types: 1) Signal
2) Semaphores (flags, mutex, resource key, counting)
3) Queues, Pipes or Mailbox (eg. LCD display in Mobile – Time, Ph No.)
4) Sockets (eg. COM port in PC to connect modem, port 80 –
web server)
5) Remote Procedure Calls (RPC) – for distributed processes
13/4/2009 34
Shared Data Problem & its Solutions
13/4/2009 35
Semaphore & its types
13/4/2009 36
GOALS of Operating System
13/4/2009 37
STRUCTURE of Operating System
Application Software
API
System Software
(with functions other than in OS) Eg. Device driver for Multimedia device
OS interface
OS Consists of KERNEL
(Operated in User and Supervisory modes)
Hardware – OS
Interface
Hardware
13/4/2009 38
KERNEL of Operating System
KERNEL Services
Process Management
Memory Management
Inter Process Communication
I/O management
Interrupt Control
Device drivers
13/4/2009 39
Process Management in OS
13/4/2009 40
Memory Management in OS
13/4/2009 41
Device Management in OS
13/4/2009 42
File System Organization & Implementation
13/4/2009 43
Real Time Operating System (RTOS)
RTOS Services:
• Basic OS functions - PM, RM, MM, DM, FSM, I/o, etc.
• RTOS main functions - RT task scheduling and latency control
• Time management - Time Allocation, time slicing & monitoring for efficiency.
• Predictability - Predicting time behaviour and initiation of task
synchronization
• Priorities Management - Allocation and Inheritance
• IPC - Synchronization of Tasks using IPC.
13/4/2009 44
Why need RTOS?
13/4/2009 45
RTOS Task Scheduling Models
13/4/2009 46
Co-operative Round robin Scheduling
13/4/2009 47
Pre-emptive Scheduling
13/4/2009 48
Other Scheduling techniques and Critical Section
Other Scheduling
Techniques: 1) Fixed real time scheduling of Tasks
2) Probabilistic timed Petrinets
3) Multi Thread Graphs (MTG)
13/4/2009 49
RTOS - Real Time Operating
System
13/4/2009 50
Basic functions of RTOS
13/4/2009 51
Need for Tested RTOS
13/4/2009 52
Options in RTOS
Options
for
RTOS
PSoS
Linux VxWorks
Own RTOS Based µC/ OS-II Nucleus
(Freeware)
RTOS Win CE
Palm OS
13/4/2009 53
µC/OS-II (MUCOS)
µC/OS-II codes are in C and few CPU specific modules are in ASSY.
13/4/2009 54
Features of µC/OS-II
13/4/2009 55
Source code files of µC/OS-II
13/4/2009 56
Source code files of µC/OS-II
(contd..)
13/4/2009 57
RTOS System level functions
13/4/2009 58
Task Service functions
These functions are used to create task, suspend and resume, and
time setting and retrieving functions.
Unsigned int OSTimeGet (void) Find present count when time is read
13/4/2009 59
Time Delay functions
13/4/2009 60
Memory related functions
13/4/2009 61
Semaphore related functions
13/4/2009 62
Other functions
Apart from the previous said functions, MUCOS has functions related to
• Mailbox
• Queue
13/4/2009 63
Automatic Chocolate Vending Machine (ACVM)
13/4/2009 64
Applications
Medical instrumentation
Military applications
Aerospace research
Robotics
Consumer Electronics
Industrial Applications
Automobiles
Telecommunication
13/4/2009 65
Breakthrough in Embedded System Designs
13/4/2009 66
Market Potential for Embedded Systems
Experts also predict that there will be a ten-fold increase in the number of
people employed in the embedded systems industry,
from the current 60,000 professionals to over six lakh people by 2015.
- Source: NASSCOM
13/4/2009 67
Embedded Systems Companies in Bangalore
Sadhanasoft Click Technologies (I) Pvt. Ltd. Nihar Infoway Ltd. Infobahn (India) Pvt. Ltd.
Vision Comptech Datamation Koenig Solutions Pvt. Ltd. Convergent Communications (India) Pv
Integrators Ltd Consultants Pvt. Ltd.
Optimal Infotech Pvt. Ltd. Compucom Software Ltd. Surya Soft-Tech Ltd Kale Consultants Ltd
Virgosys Software Pvt. Ltd. Polaris Software Lab Ltd Cybersol Technologies Pvt Ltd SolutionNet India Pvt. Ltd.
IQura Technologies Pvt. Ltd. SDI Infotech Pvt. Ltd. Datum Technologys Gateway WebSystems
(India) Ltd Pvt. Ltd.
Worldwide Infotech Inc. Java Softech Pvt. Ltd. Binary Semantics Ltd. Learnet India Ltd.
iBilt Technologies Ltd iTech Workshop Pvt. Ltd. Datum Technologys Perfect E Com Solution Pvt
(India) Ltd Ltd.
13/4/2009 68
References
3. www.embedded.com
4. www.micrcontroller.com
13/4/2009 69
Thank You
13/4/2009 70
Thank You
for your PATIENCE.
13/4/2009 71