G H RAISONI COLLEGE OF ENGINEERING
(An Autonomous Institute affiliated to Rashtrasant Tukdoji Maharaj Nagpur University, Nagpur)
Accredited by NAAC with "A+" Grade & NBA (Tier-l)
CRPF Gate No. 3, Hingna Road, Digdoh Hills, Nagpur - 440 016. (lNDlA)
Phone: +91 9604787184, 9689903286, E-mail: [Link]@[Link] , Web: [Link]
Department of Electronics Engineering
Embedded Systems Design
Subject Code: BECL218
Session 2020-21
Mrs. Sonali Joshi
Subject Teacher
System
•A system is an arrangement in which all its unit assemble work
together according to a set of rules.
•It can also be defined as a way of working, organizing or doing one or
many tasks according to a fixed plan.
•For example, a watch is a time displaying system.
•Its components follow a set of rules to show time.
•If one of its parts fails, the watch will stop working. So we can say, in a
system, all its subcomponents depend on each other.
Embedded System
•As its name suggests, Embedded means something that is attached to
another thing.
•An embedded system can be thought of as a computer hardware system
having software embedded in it.
•An embedded system can be an independent system or it can be a part of a
large system.
•An embedded system is a microcontroller or microprocessor based system
which is designed to perform a specific task.
•For example, a fire alarm is an embedded system; it will sense only smoke.
An embedded system has three components −
•It has hardware.
•It has application software.
•It has Real Time Operating system (RTOS) that supervises the application
software and provide mechanism to let the processor run a process as per
scheduling by following a plan to control the latencies. RTOS defines the way
the system works. It sets the rules during the execution of application
program. A small scale embedded system may not have RTOS.
So we can define an embedded system as a Microcontroller based, software
driven, reliable, real-time control system.
Characteristics of an Embedded System
•Single-functioned − An embedded system usually performs a specialized operation and does the same repeatedly. For example: A
pager always functions as a pager.
•Tightly constrained − All computing systems have constraints on design metrics, but those on an embedded system can be
especially tight. Design metrics is a measure of an implementation's features such as its cost, size, power, and performance. It must
be of a size to fit on a single chip, must perform fast enough to process data in real time and consume minimum power to extend
battery life.
•Reactive and Real time − Many embedded systems must continually react to changes in the system's environment and must
compute certain results in real time without any delay. Consider an example of a car cruise controller; it continually monitors and
reacts to speed and brake sensors. It must compute acceleration or de-accelerations repeatedly within a limited time; a delayed
computation can result in failure to control of the car.
•Microprocessors based − It must be microprocessor or microcontroller based.
•Memory − It must have a memory, as its software usually embeds in ROM. It does not need any secondary memories in the
computer.
• Connected − It must have connected peripherals to connect input and output devices.
• HW-SW systems − Software is used for more features and flexibility. Hardware is used for performance and security.
Advantages
•Easily Customizable
•Low power consumption
•Low cost
•Enhanced performance
Disadvantages
•High development effort
•Larger time to market
Teaching & Evaluation scheme
Evaluation Scheme
Teaching Scheme Total
Sub. Name of the Credit Theory Practical
Code Course s
(TAE) (CAE) ESE
Th. Tu. Pr. Total Int. Ext.
(10) (15) (25)
Embedded
BECL218
Systems 2 - 2 4 3 10 15 25 25 25 100
BECP218
Design
Course Objectives:
•To study and understand various microcontrollers and embedded systems.
•To understand the design parameters of embedded systems applications.
•To study and impart different tools for embedded system and IoT application design.
Course Outcomes:
•Demonstrate the principle of embedded systems and Microcontroller
•Develop programming for applications develop real time applications
•Design the interfacing of devices and peripherals
•Make Use of ARM7 Controller for Designing of Embedded Applications
•Develop Different IoT platform for Embedded applications
•Design and Develop different embedded system and IoT applications.
Syllabus:
•CO-I:
•Embedded Systems: Introduction to embedded Systems, Requirements /Components of Embedded Systems, Design Process in Embedded
System
•Microcontrollers: Introduction to microcontrollers, 8051 architecture, addressing modes and instruction set, 8051 programming in Assembly
language and Embedded C.
•CO-II:
•Programming: Timer, Interrupts and serial communications, Serial I/O, Programming Tools
•Interfacing with 8051: ADC and DAC interfaces for microcontrollers, Real time interfacing with LED, Keypad, LCD display, Sensors interfacing
(LDR, IR, PIR ,GSM, GPS, GPRS, [Link].)
•CO-III:
•Introduction of 32-bit Microcontroller: Advanced devices and peripheral interfacing with ATmega16:ARM7 Processors, ARM Architecture,
Register and Memory organization, addressing modes, Arm Thumb and instruction sets, Basic Assembly Programming,
•CO-IV :
•Embedded IoT Applications: Introduction to Raspberry PI and Intel Galileo& STM32 Board, introduction to Python Programming, OOP’s and
Modules in Python Programming, Design and perform different embedded system and IoT Applications: Robotic, Industrial Automations&
Health care.
Text Books:
•Muhammad Ali Mazidi, the 8051 Micro-controller & Embedded System using assembly & C,
Pearson Education,2008, Second
•Muhammad Ali Mazidi, ARM Assembly language programming and Architecture, Second
•Raj Kamal, Microcontrollers: Architecture, Programming, Interfacing and System Design, Pearson
Education India, 2009, Second
Reference Books:
•Shibu K. V. Introduction to Embedded System, The McGraw Hill, 2011,
•Ajay V. Deshmukh, Micro-controllers - Theory and Applications, Tata McGraw Hill,
•Kenneth J. Ayala, The 8051 Micro-controller – Architecture, Programming & Applications, Penram
International & Thomson Asia, 1996, Second
TAE Activity 5 Marks 4 Marks 3 Marks 2 Marks
Good technical Average technical
Submission on time, High Poor technical
content, good content less
technical content, Clarity Content, Data
TAE 1 Review on Datasheets knowledge but knowledge about
of understanding , Data sheet not
improper way of processor without
Sheet & good explanation explained properly
explanation data sheet
Activity Based
Learning: Perform Submission on time, High Good technical Average technical
Poor technical
Interfacing of Sensors technical content, Clarity content, good content less
Content, results
TAE 2 or peripherals using of understanding , correct knowledge but knowledge about
controller (Design not explained
results & good improper way of processor without
Using Proteus/ properly
explanation explanation results
MpLab)
TAE-1 Datasheet
List of Microcontroller Manufacturers
Basic Structure of an Embedded System
The following illustration shows the basic structure of an embedded system −
•Sensor − It measures the physical quantity and converts it to an electrical signal which can be read by an
observer or by any electronic instrument like an A2D converter. A sensor stores the measured quantity to the
memory.
•A-D Converter − An analog-to-digital converter converts the analog signal sent by the sensor into a digital
signal.
•Processor & ASICs − Processors process the data to measure the output and store it to the memory.
•D-A Converter − A digital-to-analog converter converts the digital data fed by the processor to analog data
•Actuator − An actuator compares the output given by the D-A Converter to the actual (expected) output stored
in it and stores the approved output.
Processor is the heart of an embedded system. It is the basic unit that takes inputs and
produces an output after processing the data. For an embedded system designer, it is
necessary to have the knowledge of both microprocessors and microcontrollers.
Processors in a System
A processor has two essential units −
•Program Flow Control Unit (CU)
•Execution Unit (EU)
The CU includes a fetch unit for fetching instructions from the memory. The EU has circuits
that implement the instructions pertaining to data transfer operation and data conversion
from one form to another.
The EU includes the Arithmetic and Logical Unit (ALU) and also the circuits that execute
instructions for a program control task such as interrupt, or jump to another set of
instructions.
A processor runs the cycles of fetch and executes the instructions in the same sequence as
they are fetched from memory.
Types of Processors
•Processors can be of the following categories −
•General Purpose Processor (GPP)
• Microprocessor
• Microcontroller
• Embedded Processor
• Digital Signal Processor
• Media Processor
•Application Specific System Processor (ASSP)
•Application Specific Instruction Processors (ASIPs)
•GPP core(s) or ASIP core(s) on either an Application Specific Integrated Circuit (ASIC) or a Very
Large Scale Integration (VLSI) circuit.
Microprocessor with Company Name
Block Diagram of Microcomputer
Microcontroller
• Microcontroller is a computer on chip optimized
to control electronic devices.
• It is designed specifically for specific
tasks such as controlling a specific system .
• A microcontroller (sometimes abbreviated µC, uC or
MCU) is basically a specialized form of
microprocessor that is designed to be self -
sufficient and cost -effective.
• Also, a microcontroller is part of an embedded
system, which is essentially the whole circuit
board.
• An embedded system is a computer system designed
to perform one or a few dedicated functions
often with real time computing constraints.
• It is embedded as part of a complete device
often including hardware and mechanical parts.
Difference between Microprocessor &
Microcontroller
• Microprocessor is an IC which has only the CPU inside
them i.e. only the processing powers such as Intel’s
Pentium 1,2,3,4, core 2 duo, i3, i5 etc.
• These microprocessors don’t have RAM, ROM, and
other peripheral on the chip.
• A system designer has to add them externally to
make them functional.
• Application of microprocessor includes Desktop PC’s,
Laptops, notepads etc.
• But this is not the case with Microcontrollers.
Microcontroller has a CPU, in addition with a fixed
amount of RAM, ROM and other peripherals all
embedded on a single chip.
• At times it is also termed as a mini computer or a
computer on a single chip.
• Today different manufacturers produce
microcontrollers with a wide range of features
available in different versions.
• Some manufacturers are ATMEL, Microchip, TI,
Freescale, Philips, Motorola etc.
• Microcontrollers are designed to perform specific
tasks. Specific means applications where the
relationship of input and output is defined.
• Depending on the input, some processing needs to be
done and output is delivered.
• For example, keyboards, mouse, washing machine,
digicam, pendrive, remote, microwave, cars, bikes,
telephone, mobiles, watches, etc.
• Since the applications are very specific, they need
small resources like RAM, ROM, I/O ports etc and
hence can be embedded on a single chip.
• This in turn reduces the size and the cost.
• Microprocessor find applications where tasks are
unspecific like developing software, games, websites,
photo editing, creating documents etc.
• In such cases the relationship between input and
output is not defined.
• They need high amount of resources like RAM, ROM,
I/O ports etc.
• The clock speed of the Microprocessor is quite high as
compared to the microcontroller.
• Whereas the microcontrollers operate from a few
MHz to 30 to 50 MHz, today’s microprocessor
operate above 1GHz as they perform complex tasks.
• Comparing microcontroller and microprocessor in
terms of cost is not justified.
• Undoubtedly a microcontroller is far cheaper than a
microprocessor.
• However microcontroller cannot be used in place of
microprocessor and using a microprocessor is not
advised in place of a microcontroller as it makes the
application quite costly.
• Microprocessor cannot be used stand alone.
• They need other peripherals like RAM, ROM, buffer,
I/O ports etc and hence a system designed around a
microprocessor is quite costly.
Features of Micro-controller
• A micro-controller is a single integrated circuit.
• Central processing unit - ranging from small and simple 4-
bit processors to complex 32- or 64-bit processors
• volatile memory (RAM) for data storage
• ROM, EPROM, EEPROM or Flash memory for program and
operating parameter storage
• Discrete input and output bits, allowing control or
detection of the logic state of an individual package pin
• Serial input/output such as serial ports (UARTs)
• Other serial communications interfaces like I²C, Serial
Peripheral Interface and Controller Area Network for
system interconnect
• Peripherals such as timers, event counters, PWM generators, and
watchdog
• Clock generator - often an oscillator for a quartz timing crystal,
resonator or RC circuit
• Many include analog-to-digital converters, some include digital-to-
analog converters
• In-circuit programming and debugging support.
Types of Microcontrollers
• Embeded (Self-contained) 8 bit
• 16-32 bit
• Digital Signal Processors
• An embedded microcontroller is a chip which
a computer processor with all it’s support
functions (clocking and reset), memory, and
i/O built into the device.
Control
Power dist
store
Reset
control
Clock and
timing RAM
Microcontroller block diagram
types of microcontrollers
• Embedded
– All the hardware required to run the application is
provided on the chip. typically: power, reset, clock,
memory and IO.
• External memory
– some microcontrollers allow the connection of external
memory.
• Microcontroller primarily differ from a microprocessor
in the areas of built-in peripheral features. These
features could include memory device selection,
timers, interrupt controllers, DMA, and IO devices like
serial ports.
How to Classify Processors
• Categorized by memory organization
• Von-Neumann architecture
• Harvard architecture
• Categorized by instruction type
• CISC
• RISC
• VLIW
von Neumann architecture
• Memory holds data, instructions.
• Central processing unit (CPU) fetches instructions from memory.
• Separate CPU and memory distinguishes programmable computer.
• CPU registers help out: program counter (PC), instruction register (IR),
general-purpose registers, etc.
Von-Neumann architecture
• Combine program and data in 1 chunk of memory
• Example : 80x86 architecture
CPU + memory
address
200
PC
data
memory
CPU
200 ADD r5,r1,r3 ADD r5,r1,r3
IR
The von Neumann model
CPU Buses
So where is the
here
Input/Output? Input Output
Harvard architecture A d d re ss
P ro ce sso r D a ta P ro gra m
R ead
W rite
Read
D a ta
Harvard architecture
address
data memory
data PC
CPU
address
program memory data
Harvard Architecture
From [Link]
Harvard architecture
• Separate memory into 2 types
• Program memory
• Data memory
• Used in MCS-51, MIPS etc.
The Harvard Architecture (1)
• Harvard architecture is a computer architecture with
physically separate storage and signal pathways for
instructions and data.
• The term originated from the Harvard Mark I relay-based
computer, which stored instructions on punched tape (24
bits wide) and data in electro-mechanical counters (23
digits wide).
• These early machines had limited data storage, entirely
contained within the data processing unit, and provided no
access to the instruction storage as data, making loading
and modifying programs an entirely offline process.
The Harvard Architecture (2)
• In a computer with a von Neumann architecture (and no
cache), the CPU can be either reading an instruction or
reading/writing data from/to the memory.
• Both cannot occur at the same time since the
instructions and data use the same bus system.
• In a computer using the Harvard architecture, the CPU
can read both an instruction and perform a data memory
access at the same time, even without a cache.
• A Harvard architecture computer can thus be faster for a
given circuit complexity because instruction fetches and
data access do not contend for a single memory
pathway.
The Harvard Architecture (3)
• In a Harvard architecture, there is no need to make
the two memories share characteristics. In
particular, the word width, timing, implementation
technology, and memory address structure can
differ.
• In some systems, instructions can be stored in read-
only memory while data memory generally requires
read-write memory.
• Instruction memory is often wider than data
memory.
Harvard Architecture Example
Block Diagram of the PIC16C8X
Modified Harvard Architecture
• The Modified Harvard architecture is very like the Harvard
architecture but provides a pathway between the instruction memory
and the CPU that allows words from the instruction memory to be
treated as read-only data.
• This allows constant data, particularly text strings, to be accessed
without first having to be copied into data memory, thus preserving
more data memory for read/write variables.
• Special machine language instructions are provided to read data from
the instruction memory.
• Standards-based high-level languages, such as the C language, do not
support the Modified Harvard Architecture, so that in-line assembly or
non-standard extensions are needed to take advantage of it.
• Most modern computers that are documented as Harvard
Architecture are, in fact, Modified Harvard Architecture.
von Neumann vs. Harvard
• Harvard can’t use self-modifying code.
• Harvard allows two simultaneous memory fetches.
• Most DSPs use Harvard architecture for streaming data:
• greater memory bandwidth;
• more predictable bandwidth.
Processor Architecture
• CISC
Complex Instruction Set Computers
Large amount of instructions each carrying out a different permutation of the
same operation
Functionality of the instructions is more dependent upon the processor’s
designer
Processor Architecture
• RISC
Reduced Instruction Set Computers
Fundamental set of instructions
More control for users to design their own operations
Memory Organization
• Program Memory
• Register File Memory
Program Memory
• Used for storing compiled code
• Each location is 14 bits long
• Every instruction is coded as a 14 bit word
• Addresses H’000’ and H’004’ are treated in a special way
• PC can address up to 8K addresses
Register File Memory
• Consist of 2 Components
General Purpose Register (GPR) Files (RAM)
Special Purpose Register (SPR) files
• This portion of memory is separated into banks of 128 bytes long
Microcontroller memory types
• control store
– program memory or firmware. this memory space is
the maximum size of the application that can be
loaded into the microcontroller and that the
application also includes all the low-level code and
device interface necessary to execute an application.
– nonvolatile
– 8051 has 5 different types of control store : none,
mask ROM, PROM, EPROM and EEPROM/Flash
• variable area
– 4 types variable data storage: bits, registers,
variable RAM, PC stack.
– in 8051 they are implemented as SRAM.
– program counter stack
– part of the RAM.
– LIFO memory.
– must be initialized by the starting address of the
stack area.
• Hardware interface registers (I/O space)
– could be memory mapped or IO mapped.
– mostly in variable memory space.
memory separate IO
mapped IO space
IO
program registers
ROM program
ROM
IO registers
IO in Princeton architecture
variable variable
RAM RAM
Stack Stack
Counter Counter
• IO in Harvard architecture
IO registers in IO registers in IO registers in
program ROM register space separate space
registers registers register
space space space
IO
program registers IO
ROM registers
program program
ROM ROM
IO
registers