You are on page 1of 53

Embedded System-EE512

Dr. Udit Satija


Asst. Prof., EE, IIT Patna
References:
Books:
• P. Marwedel: Embedded System Design, Springer, ISBN 978-3-319-56045-8, 2018.
• G.C. Buttazzo: Hard Real-Time Computing Systems. Springer Verlag, ISBN 978-1-
4614-0676-1, 2011.
• Peter Marwedel, “Embedded System Design: Embedded Systems Foundations of
Cyber-Physical Systems”, Springer, 2011.
• Edward A. Lee and Sanjit A. Seshia: Introduction to Embedded Systems, A Cyber-
Physical Systems Approach, Second Edition, MIT Press, ISBN 978-0-262-53381-2,
2017.
• M. Wolf: Computers as Components –Principles of Embedded System Design.
Morgan Kaufman Publishers, ISBN 978-0-128-05387-4, 2016.
• Mazidi & Mazidi, “8051 Microcontroller and Embedded Systems”
• Steve Furber, ― ARM System-On-Chip Architecture, Second Edition, Pearson
Publisher, 2015.

Online Lectures:
• Embedded System Design, By:- Prof. Anupam Basu, IIT KGP
• Embedded System Design, By:- Prof. Indranil, IIT KGP
• Embedded System, By: Prof. Santanu Chaudhury, IIT Delhi
Contents:
• Introduction to ES
• Brief revision of basics of Microprocessors and
Microcontrollers
• Embedded system design and constraints
• Embedded processor and memory architecture
• ARM and its architecture
• PWM, D/A and A/D convertors
• Real-time operating systems
• Scheduling
• Multitasking
• Sensors and Actuators
• Communication protocols
• Interfacing
Evaluation
• Quizzes (4):20%
• Mid Sem Exam:25%
• End Sem Exam: 35%
• Projects:15%
• Day to Day Performance: 5%
Embedded System: Introduction
What is an Embedded System?
• An electronic/electro-mechanical system developed to perform a specific task.

• Any device that includes a computing resource/microcontroller but is not itself a


general-purpose computer.

• is a combination of both hardware and software (firmware)-expected to function


uniquely and highly application-specific.

• Respond, monitor, control external environment using sensors and actuators.

• Essential part of any product or equipment of all application including,


household appliances, telecommunication, healthcare devices, automobiles,
industry control, Internet of things, consumer electronics etc.
Embedded System
Embedded System Architecture
Microcontroller
FPGA/ASIC Memory Software

Sensors A/D CPU D/A Actuators

Human Diagnostic Cooling


Interface Tools System

Detailed ES Architecture

Simple Architecture
Implementing Embedded System
• Hardware:
• Processing Element (Microprocessor or Micro-controller)
• Peripherals
• Inputs and outputs
• Interfacing sensors & actuators
• Interfacing protocols
• Memory
• Buses

• Software:
• System software
• Application software

• Special Operating System:


- Work on cross compilers and cross assemblers
- Code should run on particular Micro-controller, Not on PC
- Emulators & Simulators
Recent Potential Technologies

Source: Manyika, James, et al. Disruptive technologies: Advances that will transform life, business, and the
global economy.
Broad Overview
Embedded System: Fact Sheet
• The global market for ES is projected to reach US $234
billion by 2020. (Expected to grow at 6.4 %)
• Designing of secure ES
• Mobile market
• Smart automobiles
• Expanding role of electronics control
• Advances in healthcare
• Growing use of robots
• Internet of things

• List of ES companies: large pool with high revenue


Difference Between ES and General Purpose
Computer
GPC ES
Combination of generic hardware and Combination of special purpose
general purposed OS for variety of hardware and embedded OS for
applications specific set of applications
Response requirements are not time- Critical
critical
Need not be deterministic in execution It should be deterministic
behavior
Less/not at all tailored towards operating Highly tailored to take advantages of
power requirements, options for power saving modes
different power management
Characteristics of Embedded System

• Sophisticated functionalities
• Real-time operation: Hard/Soft
• Restricted memory
• Low manufacturing cost
• Application-dependent processor
• Low-power dissipation
Types of Embedded Systems
• General computing: PDA, video games, set-top boxes, ATM etc.

• Control system: Feedback control of real-time system, nuclear system

•Signal processing: Radar, Sonar, DVD etc.

•Communication and Networking: Cellular

Nature of System Functions:


• Control laws
• Sequencing logic
• Signal processing
• Interfacing
• Fault response (Graceful degradation)
Embedded System Design
• Multi-objective • Multi-dicipline • Life cycle
• Dependability – Electronic – Requirement
• Affordability
Hardware – Design
• Safety
• Security – Software – Manufacturing
• Scalability – Mechanical – Deployment
• Timeliness Hardware
• Energy efficient
– Logistics
– Society
• High code density
Embedded System: Design Constraints

• Speed
• Packaging
• Power consumption
• The amount of RAM and ROM on chip
• The number of I/O pins and the timer on chip
• How easy to upgrade to higher performance or lower
power-consumption versions
• NRE and cost per unit
• Time to market
• Real-time response
Design Metrics
➢Non-recurring cost
➢Unit cost
Speed
➢Size
➢Performance
➢Power dissipation
➢Flexibility
Quality Cost
➢Maintainability
➢ Time to prototype
➢Time to market
➢Safety
Time to market design metric
• Crucial Metric which should be strictly
followed to make product commercially
viable

• Demand detailed study of market

• Define a “Market Window” in which


maximum sale is possible. If delayed, a
drastic loss is possible
Loss due to late entry in market
• Assume a simplified revenue model:
✓ Product life is 2W
✓ Maximum sale at time W
✓ Rise and fall of market is
defined by a triangle mentioned
in revenue graph.
✓ Area of triangle defines the total
revenue

•For late entry, estimated loss:


✓ Difference in triangle areas of
actual and estimated triangles.

• Area of a triangle = ½*B*H


✓ Area (Actual) = 1/2*2W*W • Examples:
✓ Area(Late) = ½*(2W-D)*(W-D) •2W=52Weeks,D=4Weeks Loss=22%
✓ % revenue loss = D(3W- • 2W=52Weeks,D=10Weeks Loss=50%
D)/2W^2 *100
NRE and unit cost metric
• If CNR represents the non recurring engineering cost, and Cunit represents the unit cost. Then
for manufacturing N units of the product the total cost will be:

Total Cost = CNR + N * Cunit.

• Hence, per unit cost is given by:

(CNR / N) + Cunit.

• Example:
CNR = 500000 INR and Cunit = 5000 INR
For manufacturing 100 units the total cost = 500000 + 5000*100 = 1000000
Per unit cost = 500000 / 100 + 5000 = 10000
Performance Design Metric
• Normally, these are used for evaluating processor performances/Speed.

• Clock frequency (MIPS) – Not good for comparison


• Latency (response time)
• Throughput

• One can choose design alternatives based on speed (using above measures)
Hardware Evolution:
➢General Purpose Microprocessors and Microcontrollers

➢DSP Processor

➢Application Specific Processors

➢System on Chip
Software Specifications:
• Code should be efficient or compact

• Accurate

• Fault tolerant
Basics of Microprocessors and Microcontrollers
The unit of data size:
• Bit : a binary digit that can have the value 0 or 1
• Byte : 8 bits
• Nibble : half of a bye, or 4 bits
• Word : two bytes, or 16 bits
The terms for amounts of memory:
• Kilobyte (K): 2^10 bytes
• Megabyte (M) : 2^20 bytes, over 1 milli
• Gigabyte (G) : 230 bytes, over 1 billion
• Terabyte (T) : 240 bytes, over 1 trillion
Basics of Microprocessors and Microcontrollers
General-purpose microprocessors contains
• No RAM
• No ROM
• No I/O ports

Microcontroller has
• CPU (microprocessor)
• RAM
• ROM
• I/O ports
• Timer
• ADC and other peripherals
Basics of Microprocessors and Microcontrollers

• CPU (Central Processing Unit)


• Execute information stored in memory
• I/O (Input/output) devices
• Provide a means of communicating with CPU
• Memory
• RAM (Random Access Memory) –temporary storage of programs that
computer is running
• The data is lost when computer is off

• ROM (Read Only Memory) – contains programs and information essential to


operation of the computer
• The information cannot be changed by use, and is not lost when power is off
• It is called nonvolatile memory
Basics of Microprocessors and Microcontrollers
The CPU is connected to memory and I/O through strips of wire called a
bus
• Carries information from place to place
o Address bus
oData bus
oControl bus
Basics of Microprocessors and Microcontrollers
Microprocessors/Microcontrollers
• Basic operation of computer system

• Instruction set of CPU


• Complex instruction set computer (CISC): Typically, used in PCs
• Reduced instruction set computer (RISC): Typically, used in
microcontrollers
• Memory:
• Random Access Memory (RAM): Volatile, mostly used for data memory
• Read only memory (ROM) : Non volatile, used for program memory
CPU Architecture
• Von Neumann:
• Both instructions and data
are stored in the same memory
• This model was used in GPCs

• Harvard:
• Instructions and data are stored
in separate memories
• Typically, followed in microcontrollers
• Instructions are stored in ROM, while
data are stored in RAM.
Microprocessors
• CPU fabricated within a single integrated circuit or IC chip
• Consists of a set of registers to store temporary data
• Consists of an ALU,
• Provide an interface to connect with external device (memory or
I/O) through buses
• Control unit for synchronization
Microcomputer
• It is computer system built using a microprocessor
• Since microprocessor itself doesn’t contain I/O and
memory, it needs to interfaced using a
microcomputer
Microcontrollers and Embedded System
• An embedded product uses a microprocessor (or microcontroller)
to do one task and one task only

• There is only one application software that is typically burned into ROM

• A PC, in contrast with the embedded system, can be used for any
number of applications

• It has RAM memory and an operating system that loads a variety of


applications into RAM and lets the CPU run them

• A PC contains or is connected to various embedded products. Each one


peripheral has a microcontroller inside it that performs only one task
Microcontroller: Important component of ES
• Typically, a computer on a single chip
• Cheap, small and low power
• Convenient for ES design
• It operates on data that are fed through its serial and parallel input
ports which are controlled by the software stored in on-chip
memory.
• Mostly, it has built-in analog pins, timers, and other utility circuitry
Difference between Microcontroller and PC
• If a PC executes a program, the program is first loaded from
disk/SSD into memory (allocation)
• Program loaded in partition to save memory space
• Complicated OS which handles all low-level operations
(even for interfacing with devices)

• In microcontroller
• No disk
• On-chip memory (ROM) stores the program
• Size of ROM limits the maximum size of the application
• No OS. Only low-level program/subroutine is running
stored in ROM
Microcontrollers
• Usage:
Typically used in power critical applications e.g.
household, automobile etc.

• Evolution of Microcontrollers:
• Evolved from microprocessor-based level design on a single chip
in the mid-70’s
• In mid 80’s, microcontrollers got embedded in ASIC

• Advantages of Microcontrollers:
• Fast, effective in particular application
• Low cost/Low power
• Compatibility: Opcodes and binaries same as in
PICs/80x51/ARM/PIC variants
Microcontrollers and Embedded System

• 8-bit microcontrollers
• Motorola’s 6811
• Intel’s 8051
• Microchip’s PIC

• There are also 16-bit and 32-bit microcontrollers made


by various chip makers
ES Design and Development Process

Requirements Specifications Architecture Component System


Integration

Requirements:
✓ End process of the product? The real world I/O? Operator interface?
✓In large companies, market or major customer drive the requirement
✓In small companies, engineers draw the requirement

• Functional: o/p is a function of i/p (objective of the system)

• Nonfunctional: Time requirement, size, weight, power, reliability, scalability

•Additional Requirements: EMI/EMC, certification, safety approval,


environmental
ES Design and Development Process

Requirements Specifications Architecture Component System


Integration

Specifications:

• Engineering Specifications: An approach to Implement the design and to met


the requirements

• Hardware Specifications: Selection of particular application-specific hardware

• Firmware (Software) Specifications: which program environment will be


selected based on processors

•Test Specifications: Includes test environment


ES Design and Development Process

Requirements Specifications Architecture Component System


Integration

Architecture: CPU architecture

• Von Neumann Architecture: Both instructions and data in same memory


(Typically conventional computer)

• Harvard Architecture:
✓ Instruction and data in separate memories
✓Typically followed in microcontroller
✓Instructions are stored in ROM, data in RAM.
ES Design and Development Process

Requirements Specifications Architecture Component System


Integration

✓ development of individual
modules e.g. Memory, I/O
Interfaces, etc.
✓ Optimization Problem

Complete system integration


Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment
• Processing speed
• Memory architecture
• Power requirement
• Environmental requirement
• Life cycle cost
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins: To control external I/O devices

Example:
Manufacturer Processor I/O Pins
Intel & Others 8031/8051 family 32
Microchip PIC17G42 33
Motorola 68HG05 Varying
Zilog ZB (ZB6E40) 32
Signetics/Philips 83G751 19
Atmel AT90S8515 32
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces: Various USBs, serial interfaces, PWM, HDMI,
Auxiliary
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM): Suitable estimation is
highly appreciable as over estimation can increase cost and
underestimation limits the futuristic development.
• RAM Estimation: Number of variables + sum of all internal buffers +
FIFO’s, stacks. E.g. 8031 4 reg. * 32 bytes =96 usable bytes RAM,
• 8052 256 bytes of general purpose RAM but upper 128 bytes
are accessible only using indirect addressing
• Good compiler use less RAM
• ROM Estimation: Program code (size) + any ROM based tables
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM)
• Number of interrupts
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces: Various USBs, serial interfaces, PWM, HDMI,
Auxiliary
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment:
• Integrated development environment or cross compiler
• PROM programmer
• Debug hardware (e.g. Emulators)
Selection of Microprocessor/Microcontroller
According to functionality of final product, following requirements are
to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment
• Processing speed:
• Sums up the interrupt latencies. Fast enough to handle stackup of worst-
case interrupts
• The length of the polling loop must be short so it shouldn’t miss a byte of
serial data or a byte from other interface
• In some cases, there is no use of higher speeds if wait states do not meet the
memory access time requirements.
• Relation of clock speed and processor speed
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces:
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment
• Processing speed
• Memory architecture: Von Neumann or Harvard
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces:
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment
• Processing speed
• Memory architecture
• Power requirement:
• Low power mode or sleep mode
• Turns off internal peripherals to save power
Selection of Microprocessor/Microcontroller
According to functionality of final product, following
requirements are to be considered:
• Number of I/O pins
• Interfaces
• Memory requirements (ROM/ RAM)
• Number of interrupts
• Real-time considerations
• Development environment
• Processing speed
• Memory architecture
• Power requirement
• Environmental requirement: Cooling, space, harmful gases etc.
• Life cycle cost: Production and servicing

You might also like