Embedded Systems - An Introduction

Download as pdf or txt
Download as pdf or txt
You are on page 1of 281

Embedded Systems

-An Introduction

Instructor: Dr. Ankur Beohar


School of Electrical and Electronics Engineering
VIT Bhopal University
Embedded Systems
 Suggested Textbooks:
 Raj Kamal, “Embedded systems Architecture, Programming and
Design”, Third Edition, Tata McGraw Hill, 2017.
 Rob Toulson and Tim Wilmshurst, “Fast and Effective Embedded
Systems Design – Applying the ARM mbed”, Elsevier, 2017.
 Arnold S. Berger, “Embedded Systems Design: An Introduction to
Processes, Tools, and Techniques”, CRC Press, 2002.
 Other sources
 Lecture notes
 Handouts
 Blogs
 MOOC courses

ECE4010 Winter 2021-22


Contents
 Definitions
 Characteristics of an Embedded System
 Classifications of Embedded Systems
 Components of an Embedded System
 Examples of Embedded Systems
 Processor Design Criteria
 Embedded System Design Challenges
 Performance and Benchmarking
 Recent Trends

ECE4010 Winter 2021-22


What is a System?
 A black box that takes the input, processes it and
provides the required output
 A way of working, organizing or performing one or many
tasks according to a fixed set of rules, program or plan
 Example
 Time display system – A watch
 Automatic cloth washing system – A washing machine
 Photograph capturing system – A digital camera

ECE4010 Winter 2021-22


What’s an Embedded System?
 An embedded system is an electronic system which is designed to perform
limited task using hardware and software.

 An Embedded system is computing system other than a desktop


computers- Frank Vahid /Tony

 It is any device that includes a programmable computer but is not itself


intended to be a general purpose computer - Wayne Wolf

 Embedded System are electronics systems that contain a Microprocessor,


Micro Controller, but we don’t think of them as computer. The computer is
hidden in the system- Todd D.Mortan

 An embedded system is a System whose principle function is not


computational, but which is controlled by computer embedded within it. –
Tim Wilmshurst
ECE4010 Winter 2021-22
What’s an Embedded System?
 It is a dedicated computer based system for an application(s) or product. It
may be an independent system or a part of large system. Its software
usually embeds into a ROM (Read Only Memory) or flash. – Raj Kamal

 An embedded system is a special-purpose computer system designed to


perform one or a few dedicated functions, sometimes with real-time
computing constraints. - Michael Barr

 Examples

ECE4010 Winter 2021-22


Embedded Systems
 Every embedded system consists of custom built
hardware built around a Central Processing Unit (CPU)
 Memory hardware also contains memory chips onto
which the software is loaded.

HARDWARE SOFTWARE
 CPU APPLICATION
 MEMORY +  OS
 I\O DEVICES DEVICE DRIVERS

EMBEDDED SYSTEMS

ECE4010 Winter 2021-22


Classification of Embedded Systems

ECE4010 Winter 2021-22


Classification
 Small scale embedded systems: Use 8 bit or 16 bit
microcontrollers, and have minimum hardware and
software. They are so small and require little power they
may be powered by a battery.
 Medium scale embedded systems: Use either one or a
few 16 bit or 32 bit microcontrollers, RISCs or DSPs. The
hardware and software is more complex as compared to
small scale embedded systems.
 Sophisticated embedded systems: The most complex of
the three classifications mentioned. Used for cutting-
edge applications that need hardware and software Co-
design.
ECE4010 Winter 2021-22
Classification
 Stand alone embedded systems do not require a host
system like a computer, it works by itself. It takes the
input from the input ports either analog or digital and
processes, calculates and converts the data and gives
the resulting data through the connected device

ECE4010 Winter 2021-22


Classification
 Real time embedded systems gives the required o/p in a
particular time. These types of embedded systems follow
the time deadlines for completion of a task. Classified
into two types such as soft and hard real time systems.

ECE4010 Winter 2021-22


Classification
 Networked Embedded Systems are related to a network
to access the resources. The connected network can be
LAN, WAN or the internet. This type of embedded
system is the fastest growing area in embedded system
applications.

ECE4010 Winter 2021-22


Classification
 Mobile embedded systems are used in portable
embedded devices like cell phones, mobiles, digital
cameras, mp3 players and personal digital
assistants, etc. The basic limitation of these devices is
having limited resources.

ECE4010 Winter 2021-22


Characteristics of Embedded Systems
 Perform a specific task

 Memory constrained

 Time constrained

 Low power consumption

 Highly reliable

 Fault tolerant architecture

 Robust

 Simplified user interface (generally no GUI)

 Less human interaction

ECE4010 Winter 2021-22


Characteristics of Embedded Systems

ECE4010 Winter 2021-22


Components of Embedded Systems
 Analog Components
 Sensors, Actuators, Controllers, …
 Digital Components
Hardware
 Processor, Coprocessors
 Memories
 Controllers, Buses
 Application Specific Integrated Circuits (ASIC)
 Converters – A2D, D2A, …
 Software
 Application Programs Software
 Exception Handlers

ECE4010 Winter 2021-22


ES: Simplified Block Diagram

actuators

ECE4010 Winter 2021-22


Processors
 What is a processor?
 Artifact that computes (runs algorithms)
 Controller and data-path
 General-purpose (GP) processors:
 Variety of computation tasks
 Functional flexibility and low cost at high volumes (maybe)
 Slow and power hungry
 Single-purpose (SP) processors (or ASIC)
 One particular computation task
 Fast and power efficient
 Functional inflexibility and high cost at low volumes (maybe)

ECE4010 Winter 2021-22


General-purpose processors

 Programmable device used in a Controller Datapath


variety of applications Control Register
logic and
 Features State register
file

 Program memory
General
 General datapath with large register file IR PC ALU
and general ALU
 User benefits Program Data
 Low time-to-market and NRE costs memory memory
 High flexibility Assembly code
for:
 Examples
total = 0
 Pentium, Athlon, PowerPC for i =1 to …

ECE4010 Winter 2021-22


Application-specific processors (ASICs)
 Programmable processor optimized for
Controller Datapath
a particular class of applications
 Compromise between general-purpose and Control Registers
logic and
ASIC (custom hardware) State register
 Features Custom
ALU
 Program memory IR PC

 Optimized data path Data


Program memory
 Special functional units memory

 Benefits Assembly code


for:
 Some flexibility, good performance, size and
power total = 0
for i =1 to …
 Examples
 DSPs, Video Signal Processors, Network
Processors,..
ECE4010 Winter 2021-22
GP vs SP Processors
General Purpose System Special Purpose System
• Designed using a microprocessor as • Designed using a microcontroller as
the main processing unit. the main processing unit.
• It contains secondary storage like • It does not require secondary
hard disks etc. memories
• Multiple tasks as per requirement. • A particular predefined task.
• Expensive compared to SP • Cheaper compared to a computer.
• It requires huge number of peripheral • It is cheaper as it requires less no of
devices and their controllers peripheral devices and their
controllers are microcontroller chip
itself.
• OS and other software occupy huge • RTOS occupy very less memory
memory space space

ECE4010 Winter 2021-22


Examples of Embedded System
 Chocolate Vending Machines
 Digital alarm clocks
 Smart watches and digital wrist watches
 Washing machines and dishwashers
 Home security system
 Traffic lights
 Fire alarms and carbon monoxide detectors
 Printers, photocopy, fax machines and scanners
 Digital and video cameras
 Calculators
 Remote control gate keys
ECE4010 Winter 2021-22
Embedded Applications
 Hybrid embedded systems
 Aerospace, automobiles, robotics, process control, and sensor nets

 Consumer electronics
 Appliances, office electronics, and home/office automation

 Medical instruments
 Patient monitoring, MRI, and artificial hearts

 E-Business
 ATM, wending machines

ECE4010 Winter 2021-22


Aerospace
 Flight control
 Stability: real-time
differential feedback loops
 Positioning & navigation
 GPS, INS
 Instrumentation
 Data acquisition, display,
processing, and archive
 Radar
 Communication

ECE4010 Winter 2021-22


Automobiles
 Engine management
 Fuel, ignition, timing
 Emission control
 Instrumentation
 Data acquisition, display,
processing, and archive
 Safety & stability
 Airbags, active control
 Entertainment & comfort
 Radio, A/C, …

ECE4010 Winter 2021-22


Robotics
 Implies autonomous
operation
 N physical degree of
freedom
 Artificial intelligence
 Control heavy
 Mission oriented
 Repair, search, rescue,
investigate, and perform
physically difficult tasks

ECE4010 Winter 2021-22


Process Control
 Industrial automation
 Plant monitoring and production control
 Similar to control systems but with emphasis on
management

ECE4010 Winter 2021-22


Sensor Nets
 Many sensor nodes each
capable of sensing,
Modern Sensor Nodes
computation/ storage,
and communication
 Structure safety UC Berkeley: COTS Dust

UC Berkeley: Smart Dust


UC Berkeley: COTS Dust

 Search and rescue


 Military use
 Self organization UCLA: WINS Rockwell: W INS JPL: Sensor W ebs

 Energy Efficient
 Distributed

ECE4010 Winter 2021-22


Consumer Electronics
 Home appliances
 Yesterday’s appliances: add
computation
 Tomorrow’s appliances: add
networking (Internet)
 Office electronics
 Integration
 Electronic paper (filing, printing,
sending, and receiving)
 Home/office automation
 Lights and appliances that
operate by themselves or with
minimal effort

ECE4010 Winter 2021-22


Medical Instruments
 Perform diagnosis
(screening/evaluation)
 Data collection
 Appraisal of that data
 Developing a plan of action
 Observation or monitoring
 Sensing and instrumentation
 Accuracy and precision
 Other applications:
 Radiation therapy
 Artificial hearts, arms, legs, …

ECE4010 Winter 2021-22


E-Business
 Information processing
systems
 ATM
 Scanners
 Credit-card readers
 Often the interface behind
a database
 Automation and
convenience

ECE4010 Winter 2021-22


Processor Selection Criteria
 Performance considerations
 The performance speed of a processor is dependent primarily on
its architecture and its silicon design.
 presence of cache reduces instruction/data fetch timing.
 Pipelining and super-scalar architectures further improves the
performance of the processor.
 Multi-cores are the new direction in improving the performance.
 Processor architectures with support for extra instruction can help
improving performance for specific applications.
 size of cache, processor architecture, instruction set etc. has to
be taken in to account when comparing the performance.

ECE4010 Winter 2021-22


Processor Selection Criteria
 Power Considerations
 Increasing the logic density and clock speed has adverse impact
on power requirement of the processor.
 A higher clock implies faster charge and discharge cycles leading
to more power consumption.
 More logic leads to higher power density there by making the
heat dissipation difficult.
 SoC comes with advanced power gating techniques that can shut
down clocks and power to unused modules.

ECE4010 Winter 2021-22


Processor Selection Criteria
 Operating Voltages
 Each and every processor will have its own operating voltage
condition.
 The operating voltage maximum and minimum ratings will be
provided in the respective data sheet or user manual.

 Specialized Processing
 Apart from the core, presence of various co-processors and
specialized processing units can help achieving necessary
processing performance.
 Co-processors execute the instructions fetched by the primary
processor thereby reducing the load on the primary.

ECE4010 Winter 2021-22


Processor Selection Criteria
 Price
 Various considerations discussed above can be taken in to
account when a processor is being selected for an embedded
design.
 It is better to have some extra buffer in processing capacities to
enable enhancements in functionality without going for a major
change in the design.
 Price will be the determining factor when designing the system
and choosing the right processor.

ECE4010 Winter 2021-22


Embedded System Design Challenges
 Amount of Hardware Needed
 The amount of hardware depends on the application that has to
be developed .
 Hardware not only indicates the processor, but also memory,
peripherals.
 Hardware selection must satisfy the cost and performance.
 Less hardware – performance issues
 More hardware – Cost problem
 Process Deadlines
 Faster hardware or cleverer software
 Meeting the deadline of all processes in the system while keeping
the memory, power dissipation, processor clock rate and cost at
minimum is a challenge

ECE4010 Winter 2021-22


Embedded System Design Challenges
 Power Dissipation
 Turn off unnecessary logic
 Reduce memory accesses
 Reduce clock rate
 Flexibility and Upgradeability
 Ability to offer the different versions of a product for marketing
and offering the product in advanced versions later on.
 Reliability
 Designing reliable product by appropriate design and thorough
testing, verification and validation is a challenge

ECE4010 Winter 2021-22


Benchmarking
 Benchmark is the act of running a computer program, a
set of programs, or other operations, in order to assess
the relative performance of an object, normally by
running a number of standard tests and trials against it.

 Benchmarking is usually associated with assessing


performance characteristics of computer hardware.

 Benchmarks provide a method of comparing the


performance of different chip/system architectures.

ECE4010 Winter 2021-22


Benchmark Standards Organizations
 Business Applications Performance Corp. (BAPCo)
 A nonprofit consortium that distributes a set of objective
performance benchmarks for PCs based on popular software
applications and operating systems.
 Embedded Microprocessor Benchmark Consortium
(EEMBC)
 Develops meaningful performance benchmarks for the hardware
and software used in embedded systems.
 Focuses on many different usage models, such as automotive,
networking and telecom usage models.
 Futuremark Corporation
 Creates and maintains objective standards of computer and hand
held device performance measurement. This is done in
cooperation with leading hardware and technology companies.
ECE4010 Winter 2021-22
Benchmark Standards Organizations
 Standard Performance Evaluation Corp. (SPEC)
 Formed to establish, maintain and endorse a standardized set of
relevant benchmarks that can be applied to the newest
generation of high performance computers.
 SPEC produced SPEC CPU, SPECviewperf and SPEC HPC
benchmarks.
 Transaction Processing Performance Council (TPC)
 Defines transaction processing and data base benchmarks to
disseminate objective, verifiable TPD performance data to the
industry. TPC produced the TPC-C and TPC-H benchmarks.

ECE4010 Winter 2021-22


Activity
 Research two microcontrollers and provide information about them
from their datasheets. There are several microcontroller
manufacturers which you can investigate including Atmel, Microchip,
Freescale, TI, etc. For each microcontroller, report the following
information.
 Clock frequency
 Bitwidth of the datapath
 Size of Flash memory
 Number of pins
 Does the microcontroller contain an Analog-to-Digital Converter? If so, how many
bits of precision does it have?
 Research the Arduino and Raspberry Pi platforms to determine if
there are operating systems which can be used on each platform. If
there are, list those operating systems and state whether they are
open source or not.

ECE4010 Winter 2021-22


Recent Trends
 System on Chip (SoC)

 Wireless Technology

 Multi Core processor

 Multi language support

 Use of Open source Technology

 Automation

 Security

 Power Consumption

ECE4010 Winter 2021-22


System on Chip (SoC)
 A system on a chip or system on chip (SoC or SOC) is
an integrated circuit that integrates all components of
a computer or other electronic systems.
 SoC integrates a microcontroller (or microprocessor)
with advanced peripherals like graphics processing
unit (GPU), Wi-Fi module, or coprocessor.
 SoC does not necessarily contain built-in memory.

ECE4010 Winter 2021-22


Wireless Technology
 Wireless communications is the transfer of information
between two or more points that are not physically
connected
 Distances can be short, such as a few meters for
television remote control, or as far as thousands or even
millions of kilometers for deep-space radio
communications.

ECE4010 Winter 2021-22


Multi Core processor
 A multi-core processor is a single computing component
with two or more independent processing units called
cores, which read and execute program instructions.

ECE4010 Winter 2021-22


Open source Technology
 The open-source model is a decentralized software-
development model that encourages open collaboration.
A main principle of open-source software development
is peer production, with products such as source code,
blueprints, and documentation freely available to the
public.
 Examples:
OpenRISC: open-source microprocessor family, with architecture
specification licensed under GNU GPL
Arduino: a microcontroller platform for hobbyists, artists and
designers.
Linux: an operating system platform . . .
and many more

ECE4010 Winter 2021-22


Internet of things
 The Internet of things (IoT) is the network of physical
devices, vehicles, home appliances and other items
embedded with electronics, software, sensors, actuators,
and connectivity which enables these objects to connect
and exchange data.

ECE4010 Winter 2021-22


Research in Embedded Systems
 Hardware – to improve performance (sensors and
actuators), verification, etc.
 Software – reusability, testing, verification, OS, etc.
 Network – higher connectivity between systems (e.g.
smart homes link many systems together, standardised
protocols, etc.
 Security – protection against attacks
 Design – improved methodology, more automation,
formal verification

ECE4010 Winter 2021-22


Group Activity
 Propose 3 project ideas related to embedded systems

 Make a presentation on 3 ideas in the class out of which


one will be selected

 You need to complete the prototype development by the


end of this semester

ECE4010 Winter 2021-22


Building Embedded Hardware
and Software

Instructor: Dr. Ankur Beohar


School of Electrical and Electronics Engineering
VIT Bhopal University
Embedded Systems
 Suggested Textbooks:
 Raj Kamal, ―Embedded systems Architecture, Programming and
Design‖, Third Edition, Tata McGraw Hill, 2017.
 Rob Toulson and Tim Wilmshurst, ―Fast and Effective Embedded
Systems Design – Applying the ARM mbed‖, Elsevier, 2017.
 Arnold S. Berger, ―Embedded Systems Design: An Introduction to
Processes, Tools, and Techniques‖, CRC Press, 2002.
 Other sources
 Lecture notes
 Handouts
 Blogs
 MOOC courses

ECE4010 Winter 2021-22 2


Syllabus Overview
 Hardware: ADC, DAC, Memory devices, Sensors and
Actuators, PCB design process

 Software: Cross assemblers/compilers, Linker, Runtime


Library, Preprocessor Workflow, make files, Compiler
Tool chains – gcc & ARM, Device Driver, Firmware,
Middleware

 Debugging tools: Emulators, Simulators, In-Circuit


Debuggers, Logic Analyser, Integrated Development
Environment (IDE)

ECE4010 Winter 2021-22 3


Activity 1
 Research two microcontrollers and provide information about them
from their datasheets. There are several microcontroller
manufacturers which you can investigate including Atmel, Microchip,
Freescale, TI, etc. For each microcontroller, report the following
information.
 Clock frequency
 Bitwidth of the datapath
 Size of Flash memory
 Number of pins
 Does the microcontroller contain an Analog-to-Digital Converter? If so, how many
bits of precision does it have?
 Research the Arduino and Raspberry Pi platforms to determine if
there are operating systems which can be used on each platform. If
there are, list those operating systems and state whether they are
open source or not.

ECE4010 Winter 2021-22 4


Activity 2
 Identify two embedded systems which are sold on the
market today and analyze their interfaces.
 Describe all inputs to each system and outputs from
each system.
 Classify the inputs and outputs based on their mode of
interaction:
 Visual - describing data carried by visible light

 Audio - describing data carried by sound

 Tactile - describing data carried by touch

 Electronic - describing data encoded in electrical signals

ECE4010 Winter 2021-22 5


Sensors
 A sensor is a device that receives a stimulus and responds
with an electrical signal
 The terms sensor and detector are synonyms
 Different sensors are IR sensors, proximity sensors,
temperature sensors, tilt sensors, accelerometers, ultrasonic
sensors, RADAR, SONAR, etc.

ECE4010 Winter 2021-22 6


Sensors
 The stimulus is the quantity, property, or condition that
is received and converted into electrical signal.
 Examples of stimuli are light intensity and wavelength,
sound, force, acceleration, distance, rate of motion, and
chemical composition.
 When we say ―electrical‖ we mean a signal which can
be channeled, amplified, and modified by electronic
devices.
 The term sensor should be distinguished from
transducer.
 The transducer is a converter of any one type of energy
or property into another type of energy or property,
whereas the sensor converts it into electrical signal.
ECE4010 Winter 2021-22 7
Sensors
 Transducers may be parts of a hybrid or complex sensor
 There are two types of sensors, direct and hybrid.
 A direct sensor converts a stimulus into an electrical
signal or modifies an externally supplied electrical signal,
whereas a hybrid sensor in addition needs one or more
transducers before a direct sensor can be employed to
generate an electrical output.

ECE4010 Winter 2021-22 8


Sensor Characteristics
 Range
 Span
 Accuracy
 Precision
 Sensitivity
 Linearity
 Hysteresis
 Resolution
 Repeatability
ECE4010 Winter 2021-22 9
Sensor Types
 Temperature Sensors
 Pressure Sensors
 Flow Sensors
 Level Sensors
 Imaging sensors
 Noise Sensors
 Air Pollution Sensors
 Proximity and displacement Sensors
 Infrared Sensors
 Moisture and Humidity Sensors
 Speed Sensors

ECE4010 Winter 2021-22 10


Actuators
 The actuator is actually a device that transforms a certain form
of energy into motion.

 As their mechanism converts energy into motion, we can


categorize them based on energy sources:

 Pneumatic: use compressed air for generating motion.

 Hydraulic: use the liquid for generating motion.

 Thermal: use a heat source for generating motion.

 Electric: use external energy sources such as batteries or other types of


electric energy to generate motion.

ECE4010 Winter 2021-22 11


Analog to Digital Conversion
 3 steps involved
 Sampling
 Quantization
 Encoding

ECE4010 Winter 2021-22 12


Analog to Digital Conversion
Sampling and Holding

 In the process of Sample and hold (S/H), the continuous


signal will gets sampled and freeze (hold) the value at a
steady level for a particular least period of time.

 It is done to remove variations in input signal which can


alter the conversion process and thereby increases the
accuracy.

 The minimum sampling rate has to be two times the


maximum data frequency of the input signal

ECE4010 Winter 2021-22 13


Analog to Digital Conversion
Quantizing and Encoding

 Quantizing: It is the process in which the reference


signal is partitioned into several discrete quanta and then
the input signal is matched with the correct quantum.

 Encoding: A unique digital code is assigned for each


quantum and after that the input signal is allocated with
this digital code.

ECE4010 Winter 2021-22 14


Analog to Digital Conversion

ECE4010 Winter 2021-22 15


Analog-to-Digital Converter

Vmax = 7.5V 1111 4 4


7.0V 1110
6.5V 1101 3 3

analog output (V)


analog input (V)
6.0V 1100
5.5V 1011
2 2
5.0V 1010
4.5V 1001
4.0V 1 1
1000
3.5V 0111
3.0V 0110 time time
t1 t2 t3 t4 t1 t2 t3 t4
2.5V 0101
2.0V 0100 0100 1000 0110 0101 0100 1000 0110 0101
1.5V 0011 Digital output Digital input
1.0V 0010
0.5V 0001
0V 0000

proportionality Analog to Digital Digital to Analog


(A/D) (D/A)

ECE4010 Winter 2021-22 16


Digital to Analog Converter
 Digital input to analog output
 Mainly used in the output stage
 DAC can reconstruct sampled data into an analog signal
with precision
 2 types
 Binary Weighted resistor and R-2R ladder

ECE4010 Winter 2021-22 17


PCB: Printed Circuit Board
 These boards are made up of special
materials that do not conduct electricity
such as fiber and glass.

 The circuits are designed on the boards


with copper tracks instead of wires for the
conduction of electricity between the
electronic components.

 The printed circuit boards used in all


electronic products such as automotives,
wireless devices, Robotic applications, etc.

 Offers quick functioning, access, control,


monitoring and precise and exact results
when compared to other wiring methods
based devices

ECE4010 Winter 2021-22 18


What Are The Parts of a PCB?
Substrate
 The first, and most important, is the substrate, usually made of
fiberglass.
 Fiberglass is used because it provides a core strength to the PCB
and helps resist breakage.
 Think of the substrate as the PCB’s ―skeleton‖.
Copper Layer
 Depending on the board type, this layer can either be copper foil or
a full-on copper coating.
 Regardless of which approach is used, the point of the copper is still
the same — to carry electrical signals to and from the PCB, much
like your nervous system carries signals between your brain and
your muscles.

ECE4010 Winter 2021-22 19


What Are The Parts of a PCB?
Solder Mask

 The third piece of the PCB is the solder mask, which is a layer of
polymer that helps protect the copper so that it doesn’t short-circuit
from coming into contact with the environment.

 In this way, the solder mask acts as the PCB’s ―skin‖.

Silkscreen

 The final part of the circuit board is the silkscreen.

 The silkscreen is usually on the component side of the board used


to show part numbers, logos, symbols switch settings, component
reference and test points.

 The silkscreen can also be known as legend or nomenclature

ECE4010 Winter 2021-22 20


PCB Design Process

ECE4010 Winter 2021-22 21


PCB Design Process
Step 1: Design the PCB Circuit with a Software
 Draw the schematic circuit diagram with the PCB layout
software such as CAD software, Eagle and Multisim
software.
 It is also possible to change the circuit design’s position
and then to modify it according to your convenience and
requirement.

ECE4010 Winter 2021-22 22


PCB Design Process
Step 2: Film generation
 The film is generated from the finalized circuit board
diagram of the PCB layout software which is sent to the
manufacturing unit where the negative image or mask is
printed out on a plastic sheet.
Step 3: Select Raw Material
 The bulk of the printed circuit board is made with an
unbreakable glass or fiberglass having copper foil
bonded unto one or both the sides of the board.
 The PCBs made from unbreakable paper phenolic with a
bonded copper foil are less expensive and are often
used in household electrical devices.

ECE4010 Winter 2021-22 23


PCB Design Process
Step 4: Preparing Drill Holes
 Machines and carbide drills are used to put holes on the
printed circuit board.
 There are two types of machines available to drill the
PCBs;
 Hand machines
 CNC machines.
 The hand machines require human intervention or effort
to drill the holes, whereas CNC machines are computer-
based machines that work-based on the machine
timetables or programs that run both automatic as well
as manually.
ECE4010 Winter 2021-22 24
PCB Design Process
Step 5: Apply Image
 The printed circuit layout can be printed in different ways
on PCBs like a manual pen, dry transfers, pen plotters,
and printers. The laser printers are a better way to print
the layouts on printed circuit boards.

ECE4010 Winter 2021-22 25


PCB Design Process
Step 6: Stripping and Etching
 This process involves
removing the unwired copper
on the PCBs by using
different types of chemicals
like ferric chloride,
ammonium per-sulfate, etc.
 Make the solvent by mixing
1% of sodium hydroxide and
10 grams of sodium
hydroxide pellets to one liter
of water and mix it until
everything is dissolved.
ECE4010 Winter 2021-22 26
PCB Design Process
Step 7: Testing
 After finishing the manufacturing process of the Printed
Circuit Board, the Board undergoes a testing process to
check whether the PCB is working properly. Nowadays
many automatic testing equipments are available for the
high volume testing of the PCBs.

ECE4010 Winter 2021-22 27


Memory Technologies
 A memory whose contents are lost when the power is
cut off is called a volatile memory
 A microcomputer typically includes some amount of
RAM (random access memory), which is a memory
where individual items (bytes or words) can be written
and read one at a time relatively quickly.
 SRAM (static RAM) is faster than DRAM (dynamic
RAM), but it is also larger (each bit takes up more silicon
area). DRAM holds data for only a short time
 DRAM is more volatile than SRAM because it loses its
contents even if power is maintained

ECE4010 Winter 2021-22 28


Non-Volatile Memory
 Embedded systems invariably need to store data even
when the power is turned off
 Contents of ROM (Read Only Memory) is fixed during
manufacture
 Program never changes is called firmware
 There are several variants of ROM that can be
programmed in the field
 Flash memory is a form of non-volatile memory with
reasonably fast read times but not fast as SRAM and
DRAM

ECE4010 Winter 2021-22 29


Storage
 What is a memory?
 Artifact that stores bits
 Storage fabric and access logic
 Write-ability
 Manner and speed a memory can be written
 Storage-permanence
 Ability of memory to hold stored bits after they are written
 Many different types of memories
 Flash, SRAM, DRAM, etc.
 Common to compose memories

ECE4010 Winter 2021-22 30


Write-ability
 Ranges of write ability
 High end
 Processor writes to memory simply and quickly
 E.g., RAM
 Middle range
 Processor writes to memory, but slower
 E.g., FLASH, EEPROM
 Lower range
 Special equipment, ―programmer‖, must be used to write to memory
 E.g., EPROM, OTP ROM
 Low end
 Bits stored only during fabrication
 E.g., Mask-programmed ROM

ECE4010 Winter 2021-22 31


Storage-permanence
 Range of storage permanence
 High end
 Essentially never loses bits
 E.g., mask-programmed ROM
 Middle range
 Holds bits days/months/years after memory’s power source turned off
 E.g., NVRAM
 Lower range
 Holds bits as long as power supplied to memory
 E.g., SRAM
 Low end
 Begins to lose bits almost immediately after written
 E.g., DRAM

ECE4010 Winter 2021-22 32


Activity – Familiarizing Arduino

 How many controllers are there in Arduino UNO board?


Name them?

 Total Number of Analog and Digital Pins available?

 Is it possible to access both the controllers for writing


codes?

ECE4010 Winter 2021-22 33


Software Components
Software Engineer Tools
 There are five main development tools that allows software
engineers to get started on development and testing of their
applications.
 These are first simulators, software that imitates or intended to
hardware's behavior without the actual hardware.
 Emulators, the hardboard platform that imitates the operation of
your intended system.
 Compilers, it's the software that allows developers to pre-
executable code for their intended architecture.
 Installers, a software-hardware combination that allows compiled
executable programs to be installed onto a platform.
 And debuggers, a hardware-software solution that allows
programmers to test and validate their executable programs.
 These tools are important because developing hardware takes time
and it's expensive.

ECE4010 Winter 2021-22 35


Software Engineer Tools
 The software engineer's role includes the design of the
software product, along with its validation of the
hardware platform.
 A complete hardware design and documentation usually
finishes first, with software following.
 Simulators and emulators will allow validation of design
to occur before the arrival of hardware.
 Compilers, Installers, and debuggers will provide a quick
development of features for your embedded target. And
an easy way to fix off our bugs.
 Prototyping software fast is important, but not at the cost
of quality.
ECE4010 Winter 2021-22 36
High quality code
 Write a code that is maintainable, testable, portable,
robust, efficient and consistent.
 A common misconception is that the advanced platform
a general programmer might use. That the advanced
hardware will make up for poorly written software. This
is not true, especially from an embedded perspective.
because even the best hardware cannot make up for
buggy, slow, or inefficient embedded code.
 By putting time into architecting your software, writing
code effectively. Making it modular, you can extend the
lifetime and re-usability of this pieces, of your various
projects and platforms.

ECE4010 Winter 2021-22 37


Embedded Software
 There are many embedded software languages use in
the industry such as C, C++, Java and Ada. But C-
Programming is the most widely used language for
embedded software design.
 C-Programming has benefits for both low level hardware
interactions and high level software language features.
 This provides portability across different embedded
platforms.
 Typical embedded engineers actually write a form of C
called Embedded C.

ECE4010 Winter 2021-22 38


Embedded C
 Embedded C differs from C because it puts a focus on
the following features.
 Efficient memory management

 Timing centric operations

 Direct hardware/IO control

 Code size constraints

 Optimized execution

 You can think of Embedded C as optimum features in


minimum space and time.

ECE4010 Winter 2021-22 39


Language Processing System
 The hardware understands a
language, which humans
cannot understand.
 We write programs in high-
level language, which is easier
for us to understand and
remember.
 These programs are then fed
into a series of tools and OS
components to get the desired
code that can be used by the
machine. This is known as
Language Processing System.

ECE4010 Winter 2021-22 40


Language Processing System
How a program using C compiler is executed on a host
machine.
 User writes a program in C language (high-level
language).
 The C compiler, compiles the program and translates it
to assembly program (low-level language).
 An assembler then translates the assembly program into
machine code (object).
 A linker tool is used to link all the parts of the program
together for execution (executable machine code).
 A loader loads all of them into memory and then the
program is executed.

ECE4010 Winter 2021-22 41


Compilers
 A compiler is a program that translates code from one language
(such as C, C++, or Rust) and outputs it into another language (such
as assembly, object code, or machine code).
 A compiler can be used to create an executable binary directly, or
can generate intermediate files that can be used during other
software construction steps, such as linking.
 The name "compiler" is primarily used for programs that translate
the source code from a highlevel programming language to a low-
level language (e.g., assembly language or machine code).
 The most common compilers used for embedded systems are GCC,
Clang, Keil, and IAR
 A compiler transforms those input files into object files (usually
ending in .o)

ECE4010 Winter 2021-22 42


Compilation Process
 The inputs to a compiler are the source files and header files that
define our program, as well as an array of optional flags that can be
used to control the behavior of the compiler.

 A compiler transforms those input files into object files (usually


ending in .o) or an executable program (usually ending in .bin, .hex,
.out, .exe, .elf; sometimes there is no ending).

ECE4010 Winter 2021-22 43


Cross Compiler
 If the compiled program can run on a system having
different CPU or operating system than the system on
which the compiler compiled the program, then that
compiler is known as a cross-compiler.

ECE4010 Winter 2021-22 44


Cross Assembler
 A cross assembler takes the conversion process a step
further by allowing you to generate machine code for
a different processor than the one the compiler is run on.
 Cross assemblers are generally used to develop
programs which are supposed to run on game consoles,
appliances which are not able to run a development
environment.

ECE4010 Winter 2021-22 45


Linker
 Linker is a program in a system which helps to link a
object modules of program into a single object file.

 It takes object modules from assembler as input and


forms an executable file as output for loader.

 Linking is performed at both compile time, when the


source code is translated into machine code and load
time, when the program is loaded into memory by the
loader.

 Linking is performed at the last step in compiling a


program.

ECE4010 Winter 2021-22 46


Run Time Library
 When the source code of a computer program is translated into the
respective target language by a compiler, it would cause an extreme
enlargement of program code if each command in the program and
every call to a built-in function would cause the in-place generation
of the complete respective program code in the target language
every time.

 When the library files remain out of compilation of the main


executable and comes into use only when required at runtime, it is
called dynamic linking.
 These library files can be custom programmed or provided by the
language compiler for standard functions.
e.g. C compilers provide C-Standard runtime libraries

 For this reason, some programming bugs are not discovered until
the program is tested in a "live" environment – Runtime error

ECE4010 Winter 2021-22 47


PreProcessor
 The preprocessor is a part of the compiler which performs
preliminary operations (conditionally compiling code, including files
etc...) to your code before the compiler sees it.

 Preprocessor directives change the text of the source code and the
result is a new source code without these directives.

 Before the actual compilation of every C program it is passed


through a Preprocessor. The Preprocessor looks through the
program trying to find out specific instructions called Preprocessor
directives that it can understand. All Preprocessor directives begin
with the # (hash) symbol.

 e.g. #include <stdio.h> , #define

ECE4010 Winter 2021-22 48


Make Files
 A Makefile is the set of instructions that you use to tell
compiler how to build your program and are a simple
way to organize code compilation.
 This is present with other files in the parent folder of
source code.
 The make utility requires a file, makefile, which defines
set of tasks to be executed.
 You may have used make to compile a program from
source code. Most open source projects use make to
compile a final executable binary, which can then be
installed using make install.

ECE4010 Winter 2021-22 49


Compiler Tool chains
 A tool chain is a set of tools (chain of tools - compiler, linker,
debugger, standard-libraries etc.) that are used to create an
executable
 Tool chains are used in the embedded world for cross-compiling,
which means creating a program on a host which will eventually run
on a different kind of target platform - therefore there is a need to
create it with a specific compiler, linker, debugger etc.
Popular tool chains
 GCC - GNU Compiler Collection - a free software collection of
compilers, can be set up to cross compile.
 ARMCC - ARM Compiler tool chain – ARM processors are widely
used in smartphones e.g. Qualcomm snapdragon processors
 Intel tool chain – proprietary high performance tool chain for Intel
processors

ECE4010 Winter 2021-22 50


Hardware, Software, Firmware,
Middleware, Device Drivers, OS
& Applications, The Difference?
Hardware
 What is Hardware? Hardware is a system consisting
of electronic devices, designed to work together as a
single unit.
 It is the only tangible ―ware‖ out of our list that you can
physically interact with. Examples include PCBs like
motherboard, RAM, Integrated Circuits, Processor,
Microcontroller, etc.
 For embedded engineers, the assembled system is the
hardware.
 Hardware is named so since it is the hardest part to
change in a given product’s life cycle. If you need to
change it, you need to design the entire PCB.
ECE4010 Winter 2021-22 52
Firmware
 What is Firmware? Firmware is a program that is
specifically designed to work with particular
hardware and it lives in non-volatile memory such a
flash and it is executed directly from it.
 Originally Firmware is written on Masked ROMs, on
which the data cannot be changed once written and they
run for ages till the device goes out of use.
 Nowadays these kinds of firmware can be found in
devices like TVs, washing machines and microwaves.
On your computer, it can be found in the BIOS of your
motherboard.

ECE4010 Winter 2021-22 53


Firmware
 The first replacement of Masked ROMs came in the form
of EPROM which can be erased by exposure to UV light
and then reprogrammed as required. Then came
EEPROMs which used electricity to change the contents.
 Firmware is named so because it is not ―hard‖ to change,
at the same time it is not ―easy/soft‖ to change.
 To change/update the firmware you need to download it,
verify the integrity of the data, reboot the device and go
into boot mode, then rewrite the flash memory and
reboot it again in normal mode.
 It is the job of embedded firmware developers is to write
this program.
ECE4010 Winter 2021-22 54
Software
 What is Software? Software is a program that can
work on a wide variety of hardware and they are
usually copied from non-volatile memory (like hard-
disk or SSD) onto volatile memory (like SRAM and
DRAM) before they can start executing.
 Software is named so since they are very easy to
change. The end-user can do it with no trouble at all.
 Examples of software can include Operating systems, all
the applications that run on them, drivers and
middleware.

ECE4010 Winter 2021-22 55


Middleware
 What is Middleware? Middleware is a computer
program that connects 2 software together. The 2
software that needs to connect can be in the same
machine or in 2 machines in the same room or it can
be in 2 corners of the world.
 The job of middleware is to combine the 2 programs and
make a bigger one.
 The middleware in embedded systems, which is
basically a layer of computer programs that sit between
the Hardware Abstraction Layer and the application layer
to help them communicate with each other.
 Named as this ―ware‖ sits between 2 other ―wares‖

ECE4010 Winter 2021-22 56


Device Drivers
 A program that controls a device attached to a computer.
 Device driver provides a software interface to hardware
devices, enabling operating systems and other computer
programs to access hardware functions without needing
to know precise details about the hardware being used.
 An interface is nothing but a group of functions. All
operating systems talk to hardware via some predefined
software interfaces.
 e.g. NVIDIA graphics drivers, audio drivers in PCs

ECE4010 Winter 2021-22 57


OS & Applications
 What is an operating system? An operating system is a program
that abstracts the underlying software with the aim of
improving the efficiency and ease of use both for the end-users
and application programmers.

 An OS does its job by abstracting the memory, processing power


and I/O such that multiple processes can run simultaneously by
sharing the available hardware resources without the knowledge of
each others’ existence.

 Applications run on top of device drivers and operating systems.


Example of applications include Browsers, Word processors,
Multimedia players, etc.

 These applications cannot talk to the hardware directly. Instead, it


does it through the operating system and its system calls.

ECE4010 Winter 2021-22 58


Some more “wares”!
 What are Adwares?

 What is Bloatware / Fatware?

 What is Vaporware?

System security-related ―wares‖ or computer programs.

 What is Malware?

 What is Spyware?

 What is Ransomware?

ECE4010 Winter 2021-22 59


Debugging Tools
Debugging Tools
 Debugging/Testing is an important part of the overall
development process which involves finding and solving
bugs.
 A Virtual Testing Device is a software program on the
computer, unlike a real device, that provides simulation
for most of the important features of an actual device.
 It mimics the nature of the real device, which helps the
testers to run the software application on it to get an idea
about how it would run on the designated real device.
 These are of two types: Simulators and Emulators

ECE4010 Winter 2021-22 61


Emulators
 An emulator is a software that mimics the hardware and
software of the target device on your computer.
 They do this by translating the ISA (Instruction Set
Architecture) of the target device to the one used by the
computer you are using to conduct testing using binary
translation.
 E.g. Android Emulators are used by Android app
developers

ECE4010 Winter 2021-22 62


Simulators
 A simulator is designed to create an environment that
contains all of the software variables and configurations
that will exist in an application’s actual production
environment.
 Simulators do not attempt to emulate the actual
hardware that will host the application in production.
 Simulators create only software environments, they can
be implemented using high-level programming
languages.
 SPICE simulator for circuit simulation

ECE4010 Winter 2021-22 63


In Circuit Debuggers
 An in-circuit emulator (ICE) provides a window into the
embedded system.
 The programmer uses the emulator to load programs
into the embedded system, run them, step through them
slowly, and view and change data used by the system's
software.
 An emulator gets its name because it emulates (imitates)
the central processing unit (CPU) of the embedded
system's computer.
 Traditionally it had a plug that inserts into the socket
where the CPU integrated circuit chip would normally be
placed.

ECE4010 Winter 2021-22 64


In Circuit Debuggers
 ICEs attach a computer terminal or personal computer
(PC) to the embedded system.
 The terminal or PC provides an interactive user interface
for the programmer to investigate and control the
embedded system.

ECE4010 Winter 2021-22 65


Logic Analyser
 Developed out of the need to be able debug and
undertake fault-finding on microprocessor based
systems, need for simultaneous monitoring of many
lines and test points.
 Widely used to develop and debug complex digital
electronic logic circuits
 Displays traces of multiple logic channels and reveal the
circuit operation.
 Displays relative timing of a large number of signals,
enabling traces of logic signals to be seen in such a way
that the operation of several lines in a digital circuit can
be monitored and investigated.

ECE4010 Winter 2021-22 66


Logic Analyser

ECE4010 Winter 2021-22 67


Logic Analyser
 Multiple channels
 32 - 200+ channels, each channel monitoring one digital line
 Provide a time display of logic states
 Horizontal time axis and a vertical axis to indicate a logic high or
low states
 Display logic states
 Signals entering various channels are converted into a high or
low state for further processing within the analyzer. It provides a
logic timing diagram of the various lines being monitored.
 Does NOT display analog information
 Monitors the logic operation of the system.

ECE4010 Winter 2021-22 68


Logic Analyser Applications
 Verifying and debugging the operation of digital designs
looking a logic states and timings.

 Correlate a large number of digital signals

 Investigate the system operation.

 Detect timing violations

 Trace embedded software operation.

ECE4010 Winter 2021-22 69


Integrated Development Environment
 An IDE, or Integrated Development Environment,
enables programmers to consolidate the different
aspects of writing a computer program.
 IDEs increase programmer productivity by combining
common activities of writing software into a single
application: editing source code, building executables,
and debugging.
 PyCharm for Python language;

 Microsoft visual studio for C, C++, C# etc. languages

ECE4010 Winter 2021-22 70


Thank You
Embedded Networking
Technologies

Instructor: Dr. Ankur Beohar


School of Electrical and Electronics Engineering
VIT Bhopal University
Embedded Systems
 Suggested Textbooks:
 Raj Kamal, “Embedded systems Architecture, Programming and
Design”, Third Edition, Tata McGraw Hill, 2017.
 Rob Toulson and Tim Wilmshurst, “Fast and Effective Embedded
Systems Design – Applying the ARM mbed”, Elsevier, 2017.
 Arnold S. Berger, “Embedded Systems Design: An Introduction to
Processes, Tools, and Techniques”, CRC Press, 2002.
 Other sources
 Lecture notes
 Handouts
 Blogs
 MOOC courses

ECE4010 Winter 2021-2022 2


UART
UART
 Universal Asynchronous Receiver and Transmitter

 It is a single LSI (large scale integration) chip designed


to perform asynchronous communication.

 The function of UART is to convert the incoming and


outgoing data into the serial binary stream.

 An 8-bit serial data received from the peripheral device is


converted into the parallel form using serial to parallel
conversion and parallel data received from the CPU is
converted using parallel to serial conversion.

 When high-speed data transfer is not required UART is


used
ECE4010 Winter 2021-2022 4
UART
 UART is a simple half-duplex, asynchronous, serial
protocol

 Simple communication between two equivalent nodes

 Any node can initiate communication

ECE4010 Winter 2021-2022 5


UART
 What makes it „universal‟ ?
 Its parameters (format, speed ..) are configurable

 Why „asynchronous‟ ?
 It doesn‟t have a clock

 Format of Communication

ECE4010 Winter 2021-2022 6


UART
 Baud Rate

 In telecommunication and electronics, baud is a common


measure of the speed of communication over a data channel.
Technically speaking, it is the unit for symbol rate or modulation
rate in symbols per second or pulses per second.

 If the baud rate is 4800 and there are 2 bits per symbol, then bit
rate R = 4800 * 2 = 9600 bits/sec

 Sequence of Transmission

Stop Parity Data Data Data Data Data Data Data Data Start
Bit Bit Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit

ECE4010 Winter 2021-2022 7


UART Advantages
 Only uses two wires

 No clock signal is necessary

 Has a parity bit to allow for error checking

 The structure of the data packet can be changed as long


as both sides are set up for it

 Well documented and widely used method

ECE4010 Winter 2021-2022 8


UART Disadvantages
 The size of the data frame is limited to a maximum of 9
bits

 Doesn‟t support multiple slave or multiple master


systems

 The baud rates of each UART must be within 10% of


each other

ECE4010 Winter 2021-2022 9


SPI
SPI
 SPI stands for „Serial Peripheral Interface‟.
 The SPI standard was developed by Motorola.
 It is a serial data transfer protocol, which is synchronous and
full duplex.
 Full duplex – data can be sent in both directions
simultaneously between the controller unit and a peripheral.
 It is a single master and multi-slave system, in which one of
the slaves to be enabled at a time.
 It is a master – slave protocol, where the master is the unit
that generates clock signal and initiates data transfer.
 When the master does this, data transfer occurs in both
direction.

ECE4010 Winter 2021-2022 11


SPI Signals
 The SPI bus specifies four logic signals.
 SCLK - Serial Clock (output from master)

 MOSI - Master Output, Slave Input (output from master)

 MISO - Master Input, Slave Output (output from slave)

 SS - Slave Select (active low; output from master)

 Alternative naming conventions


 SCK, CLK - Serial Clock (output from master)

 SDI, DI, SI - Serial Data In

 SDO, DO, SO - Serial Data Out

 SSEL - Slave Select


ECE4010 Winter 2021-2022 12
TYPICAL SPI CONFIGURATION

1. The master pulls the slave select low and then issues clock
cycles.
2. The clock frequency is not specified in the SPI protocol and
can be anything from 0 up to 70MHz depending on the
characteristics of the slave device.
3. The data transfer then takes place.
4. The master then de-selects the slave.

ECE4010 Winter 2021-2022 13


SPI Protocol
 The transfer of data using a SPI interface can be thought of as a
large shift register shared between the master and the slave
devices.
 Data is clocked IN at the same time as it is clocked OUT of the
device.
 This is only possible if these devices share common clock.
 In addition to this, there should be a transmit buffer register at the
transmitter side and a receive buffer register at the receiver side.
 The SPI protocol behaves like a ring buffer, so that whenever the
master sends a byte to the slave, the slave sends a byte back to the
master.
 Essentially two action takes place in a SPI clock cycle
1) Master sends a bit on the MOSI line which the slave reads from
the same line.
2) Slave sends a bit on the MISO line and the master reads it from
the same line.
ECE4010 Winter 2021-2022 14
SPI Protocol
 There are shift registers in the master and slave which are serially
connected using MISO and MOSI pins.

 In this interconnection, a bit is shifted from master to slave and slave


to master simultaneously ( full duplex).

 If individual shift registers are 8 bit long, after 8 clock cycles data is
transferred from master to slave.

 The length of the shift register is decided by the manufacturer of SPI


controller.

ECE4010 Winter 2021-2022 15


Basic Serial Data Transfer

 The registers within the master and slave act like shift
registers shifting one bit on every cycle of the SCLK.

ECE4010 Winter 2021-2022 16


Basic Serial Data Transfer
 Once a set of data has been transmitted, the buffer at
the transmitter side should get a fresh data to be sent.
 Similarly the receiver data should be copied and saved
at the receiver side.
 This process continues till the required block of data is
transferred.

ECE4010 Winter 2021-2022 17


Multiple Slaves
 If multiple slave devices exist, the master normally
generates a separate slave select signal for each slave. -
Star connection.

SS

Alternative daisy chain


connection -requires only
one slave select signal

ECE4010 Winter 2021-2022 18


Multiple Slaves
 The master is usually a controller which has an SPI
controller with the specified pins.
 The SPI controller in the master has three SS pins, but
one slave is selected at a time.
 Slaves that are currently not selected should have their
MOSI and MISO tri stated and thus isolated from the
system.

ECE4010 Winter 2021-2022 19


SPI Bus Characteristics
 It is up to the master and slave devices to know whether
a received byte is meaningful or not.
 No Acknowledgement
 Master doesn't even know if slave is present!
 Slaves can be thought of as IO devices of the master.

ECE4010 Winter 2021-2022 20


SPI Advantages & Limitations
Advantages
 Full duplex communication
 Higher throughput than I2C
 Not limited to 8-bit word in case of bit transfer
 Slaves use masters clock
 Low power requirement than I2C circuit

Limitations
 Require more pins in the IC package
 No slave acknowledge
 Multi master buses are rare and awkward. Normally
limited to single slave.
ECE4010 Winter 2021-2022 21
I2C Protocol
I2C
 I2C : Inter - Integrated Circuit

 Bus Developed and patented by Philips for connecting low speed


peripherals

 On – board Bus protocol

 Has become a worldwide industry standard and used by all major IC


manufacturer

 I2C is a serial protocol for two wire interface to connect low speed
devices

 I2C combines best features from SPI and UART.

 Today, a variety of devices are available with I2C Interfaces

 Microcontroller, EEPROM, Real-Timer, interface chips, LCD driver, A/D


converter
ECE4010 Winter 2021-2022 23
Terminology
 Transmitter
 The device that puts data on the bus
 Receiver
 The device that receives data from the bus
 Master
 Initiates and terminates a transfer by generating start and stop
conditions
 Generates the clock
 A master can be either a transmitter or a receiver
 Slave
 Responds only when addressed
 A slave can be either receiver or transmitter

ECE4010 Winter 2021-2022 24


Why I2C?
 Data transfer between ICs and systems at relatively low
rates
 “Classic Mode” - up to 100K bits/second

 “Fast Mode” - up to 400K bits/second

 “High Speed Mode - up to 3.4M bits/second

 Reduces Board Space and Cost By


 Allowing use of ICs with fewer pins and smaller packages

 Greatly reducing interconnect complexity

 Allowing digitally controlled components to be located close to


their point of use

ECE4010 Winter 2021-2022 25


I2C Characteristics
 Includes electrical and timing specifications, and an
associated bus protocol
 Simple bi-directional 2-wire bus hence also called TWI
 serial data (SDA) line
 serial clock (SCL) line
 It is synchronous, half duplex, serial protocol
 Unique start and stop condition
 Slave selection protocol uses a 7/10 - Bit slave address
 Acknowledgement after each transferred byte
 No fixed length of transfer

ECE4010 Winter 2021-2022 26


I2C Configuration Example

ECE4010 Winter 2021-2022 27


Addressing, 7-bit and 10 bit format

ECE4010 Winter 2021-2022 28


Data Formats
 Master writing to a Slave

 Master reading from a Slave

ECE4010 Winter 2021-2022 29


Data Formats
 Combined Write and Read Format

 A repeated start avoids releasing the bus and therefore


prevents another master from taking over the bus

ECE4010 Winter 2021-2022 30


Start and Stop Conditions
 A transition of the data line while the clock line is high is
defined as either a start or a stop condition.
 Both start and stop conditions are generated by the bus
master
 The bus is considered busy after a start condition, until
a stop condition occurs

SDA SDA

SCL SCL

Start Stop
Condition Condition

ECE4010 Winter 2021-2022 31


How I2C Works?

ECE4010 Winter 2021-2022 32


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 33


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 34


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 35


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 36


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 37


Steps of I2C Data Transmission

ECE4010 Winter 2021-2022 38


I2C Advantages & Disadvantages
Advantages
 Simple Hardware standard
 Supports multiple masters and multiple slaves
 Only uses two wires
 Acknowledgement bit confirms the data transmission
 Well known and widely used protocol
Disadvantages
 Slower data transfer rate than SPI
 The size of the data frame is limited to 8 bits
ECE4010 Winter 2021-2022 39
Assignment

 Write down different functions in Arduino


program along with its use?

ECE4010 Winter 2021-2022 40


Activity

 Use Arduino UNO for blinking LED


 Interface temperature sensor with Arduino UNO

ECE4010 Winter 2021-2022 41


CAN
Controller Area Network
 CAN is a protocol developed to reduce the wiring inside
vehicles.

 It was developed by Bosch during 1984.

 There are different standard versions for CAN

1) Low Speed CAN – 125kbps – 11 bit identifier.

2) Standard CAN 2.0 A – 1 Mbps – 11 bit identifier

3) Extended CAN 2.0 B – 1 Mbps – 29 bit identifier.

ECE4010 Winter 2021-2022 43


CAN
 CAN uses a differential signal with two logic states,
called recessive and dominant.
 Recessive indicates that the differential voltage is less
than a minimum threshold voltage.
 Dominant indicates that the differential voltage is greater
than this minimum threshold.
 Interestingly, the dominant state is achieved by driving a
logic '0' onto the bus, while the recessive state is
achieved by a logic '1'.
 This is inverted from the traditional high and low used in
most systems.

ECE4010 Winter 2021-2022 44


CAN

ECE4010 Winter 2021-2022 45


CAN

ECE4010 Winter 2021-2022 46


CAN

ECE4010 Winter 2021-2022 47


CAN in Vehicles
 In one vehicle itself there are different CAN buses of
different data rate.
 There can be other kind of buses also in a vehicle.
 To connect between buses of different speed bridges are
used.
 CAN bus connects different nodes.
 A CAN node is one which has a MCU, a CAN controller
and transceiver connected to a CAN bus.
 To the MCU i/o pins, sensors and actuators are
connected.

ECE4010 Winter 2021-2022 48


CAN Network

ECE4010 Winter 2021-2022 49


CAN Network

ECE4010 Winter 2021-2022 50


CAN Working
 CAN is a message based protocol.

 One node “broadcasts” the message and every other node uses it.
Unlike I2C , none of the nodes have address.

 Which node receives the broadcasted message that depends on the


content of the message.

 The message has a field with identifier, which indicates priority. The
receiving node do an acceptance test for the identifier of the
message to verify if the message is relevant for it.

 If not the message is neglected. This selection procedure is called


as “ acceptance filtering” which is done at each node.

ECE4010 Winter 2021-2022 51


CAN Working
 When many nodes send message simultaneously, it is necessary
that only one node is allowed to do a “ valid broadcast”.

 Other transmitters should retreat and try again later. Arbitration is a


mechanism that handles bus access conflicts.

 The identifier ( 11 bit or 29 bit) have a dominant bit (0) and recessive
bit (1). The logic is wired AND.

ECE4010 Winter 2021-2022 52


CAN Standard Data Frame

ECE4010 Winter 2021-2022 53


CAN Standard Data Frame
 The first bit is the start of frame (SOF). This dominant bit represents
the start of a CAN message.

 Next is the 11-bit identifier, which establishes the priority of the CAN
message. The smaller the identifier, the higher the priority of the
message.

 The remote transmission request (RTR) bit is normally dominant, but


it goes recessive when one node is requesting data from another.

 The identifier extension (IDE) bit is dominant when a standard CAN


frame is being sent and not an extended one.

 The r bit is reserved and not currently used.

 The data length code (DLC) nibble signifies how many bytes of data
are in this message.

ECE4010 Winter 2021-2022 54


CAN Standard Data Frame
 Next is the data itself, being as many bytes as represented in the
DLC bits.

 The cyclic redundancy check (CRC) is a 16-bit checksum for


detecting errors in the transmitted data.

 If the message is properly received, the receiving node overwrites


the recessive acknowledge bit (ACK) with a dominant bit. The ACK
also contains a delimiter bit to keep things synchronized.

 The end of frame (EOF) signifies the end of the CAN message and
is 7 bits wide, for detecting bit-stuffing errors.

 The last part of a CAN message is used as a time delay. This time
delay is precisely the amount of time needed for a CAN controller to
move the received message into a buffer for further processing.

ECE4010 Winter 2021-2022 55


Advantages & Disadvantages
Advantages
 It support multi master and multicast features.
 The CAN bus has maximum length of 40 meters.
 The CAN provides the ability to work in different electrical
environment.
 The CAN reduces wiring since it is a distributed control and this
ensures enhancing of the system performance.
 It has single serial bidirectional line to achieve half duplex
communication.
 It has standard bus in distributed network.
Disadvantages
 It has high software expenditure.
 Undesirable interaction more probable.
ECE4010 Winter 2021-2022 56
USB
Universal Serial Bus (USB)
 Universal Serial Bus (USB) is a set of interface specifications for
high speed wired communication between electronics systems
peripherals and devices with or without PC/computer.
 The USB was originally developed in 1995 by many of the industry
leading companies like Intel, Compaq, Microsoft, Digital and IBM
 USB allows hot swapping which allows devices can be plugged and
unplugged without rebooting the computer or turning off the device.
 USB sends data in serial mode i.e. the parallel data is serialized
before sends and deserialized after receiving.

ECE4010 Winter 2021-2022 58


Versions of USB
USB1.0

 USB 1.0 is the original release of USB having the capability of


transferring 12Mbps, supporting up to 127 devices.

 This USB 1.0 specification model was introduced in January 1996.

USB1.1

 USB 1.1 came out in September 1998. USB 1.1 is also known as
full-speed USB.

 This version is similar to the original release of USB; however, there


are minor modifications for the hardware and the specifications.

 USB version 1.1 supported two speeds, a full speed mode of


12Mbits/s and a low speed mode of 1.5Mbits/s.

ECE4010 Winter 2021-2022 59


Versions of USB
USB2.0
 Hewlett-Packard, Intel, LSI Corporation, Microsoft, NEC, and Philips
jointly developed a higher data transfer rate than the 1.1 version.
 Supporting three speed modes (1.5, 12 and 480 Mbps), USB 2.0
supports low-bandwidth devices such as keyboards and mice, as
well as high-bandwidth ones like high-resolution Webcams,
scanners, printers and high-capacity storage systems.
 USB 2.0, also known as hi-speed USB. This hi-speed USB is
capable of supporting a transfer rate of up to 480 Mbps, compared
to 12 Mbps of USB 1.1.
USB3.0
 It is also called as Super-Speed USB having a data transfer rate of
4.8Gbps
 It can deliver over 10x the speed of today's Hi-Speed USB
connections.
ECE4010 Winter 2021-2022 60
USB tiered star topology

ECE4010 Winter 2021-2022 61


USB Connectors
 The USB standard uses "A" and "B" connectors mainly
to avoid confusion:
 "A" connectors head "upstream" toward the computer.
 "B" connectors head "downstream" and connect to
individual devices.

ECE4010 Winter 2021-2022 62


Data Transfer
 USB can support 4 data transfer types or transfer modes.
 Control
 Isochronous
 Bulk
 Interrupt
 Control transfers exchange configuration, setup and command
information between the device and host. The host can also send
commands or query parameters with control packets.
 Isochronous transfer is used by time critical, streaming device
such as speakers and video cameras. It is time sensitive information
so, within limitations, it has guaranteed access to the USB bus.
 Bulk transfer is used by devices like printers & scanners, which
receives data in one big packet.
 Interrupt transfer is used by peripherals exchanging small amounts
of data that need immediate attention.
ECE4010 Winter 2021-2022 63
Data Transfer
 All USB data is sent serially.

 USB data transfer is essentially in the form of packets of data, sent


back and forth between the host and peripheral devices.

 Initially all packets are sent from the host, via the root hub and
possibly more hubs, to devices.

Each USB data transfer consists of a…

1. Token packet (Header defining what it expects to follow)

2. Data Packet (Containing the payload)

3. Status Packet (Used to acknowledge transactions and to provide a


means of error correction)

ECE4010 Winter 2021-2022 64


Advantages
 Low cost
 Expandability
 Auto-configuration
 Hot-plugging
 Outstanding performance
 It also provides power to the bus, enabling many
peripherals to operate without the added need for an AC
power adapter.

ECE4010 Winter 2021-2022 65


Bluetooth
Bluetooth
 Bluetooth is a standardized protocol for sending and receiving data
via a 2.4GHz wireless link.
 It‟s a secure protocol, and it‟s perfect for short-range, lowpower, low-
cost, wireless transmissions between electronic devices.
 Bluetooth serves as an excellent protocol for wirelessly transmitting
relatively small amounts of data over a short range (<100 m)
 The Bluetooth protocol operates at 2.4GHz in the same unlicensed
ISM frequency band where RF protocols like ZigBee and WiFi also
exist.

ECE4010 Winter 2021-2022 67


Bluetooth Working
 Bluetooth networks (commonly referred to as piconets) use a
master/slave model to control when and where devices can send
data.

 A single master device can be connected to up to seven different


slave devices.

 Any slave device in the piconet can only be connected to a single


master.

 The master coordinates communication throughout the piconet.

 It can send data to any of its slaves and request data from them as
well.

 Slaves are only allowed to transmit to and receive from their master.
They can‟t talk to other slaves in the piconet.

ECE4010 Winter 2021-2022 68


Bluetooth Piconets

ECE4010 Winter 2021-2022 69


Bluetooth Connection Process
 Inquiry – If two Bluetooth devices know absolutely nothing about
each other, one must run an inquiry to try to discover the other. One
device sends out the inquiry request, and any device listening for
such a request will respond with its address, and possibly its name
and other information.

 Paging (Connecting) – Paging is the process of forming a


connection between two Bluetooth devices. Before this connection
can be initiated, each device needs to know the address of the other
(found in the inquiry process).

 Connection – After a device has completed the paging process, it


enters the connection state. While connected, a device can either be
actively participating or it can be put into a low power sleep mode.

ECE4010 Winter 2021-2022 70


Bluetooth Modes
 Active Mode – This is the regular connected mode, where the
device is actively transmitting or receiving data.

 Sniff Mode – This is a power-saving mode, where the device is less


active. It‟ll sleep and only listen for transmissions at a set interval
(e.g. every 100ms).

 Hold Mode – Hold mode is a temporary, power-saving mode where


a device sleeps for a defined period and then returns back to active
mode when that interval has passed. The master can command a
slave device to hold.

 Park Mode – Park is the deepest of sleep modes. A master can


command a slave to “park”, and that slave will become inactive until
the master tells it to wake back up.

ECE4010 Winter 2021-2022 71


Bonding and Pairing
 When two Bluetooth devices share a special affinity for each other,
they can be bonded together.

 Bonded devices automatically establish a connection whenever


they‟re close enough.

 Bonds are created through one-time a process called pairing. When


devices pair up, they share their addresses, names, and profiles,
and usually store them in memory.

 The also share a common secret key, which allows them to bond
whenever they‟re together in the future.

 Pairing usually requires an authentication process where a user


must validate the connection between devices.

ECE4010 Winter 2021-2022 72


Comparison

ECE4010 Winter 2021-2022 73


Advantages
 It avoids interference from other wireless devices.

 It has lower power consumption.

 It is easily upgradeable.

 It has range better than Infrared communication.

 The Bluetooth is used for voice and data transfer.

 Bluetooth devices are available at very cheap cost.

 No line of sight hence can connect through any obstacles.

 Free to use if the device is installed with Bluetooth.

 The technology is adopted in many products such as head set, in


car system, printer, web cam, GPS system, keyboard and mouse.

ECE4010 Winter 2021-2022 74


Disadvantages
 It can lose connection in certain conditions.

 It has low bandwidth as compared to Wi-Fi.

 It allows only short range communication between devices.

 Security is a very key aspect as it can be hacked.

ECE4010 Winter 2021-2022 75


NFC
NFC
 Based on the 13.56 MHz wireless communication protocol, Near
Field Communication (NFC) uses contactless connectivity to build
key enablers that greatly facilitate the adoption of new innovative
applications.

 Currently found in contactless payment, e-government (passports),


access control, public transport ticketing systems and e-government
(passports).

 NFC is a convenient, always-on radio link that is driving the growth


for simple pairing, diagnostic readout, parameter programming and
much more.

 NFC‟s unique features will have a positive impact on many of our


activities in areas such as smart living, industrial, and mobile
devices.

ECE4010 Winter 2021-2022 77


NFC Features
 Fast and intuitive, no training required

 Already widely used in mobile, cards and tags

 Short operating distance guarantees privacy and security

 Perfect for secure transactions, such as payments or


access control

 Greatly facilitates Bluetooth pairing and Wi-Fi hotspot


registration

ECE4010 Winter 2021-2022 78


What is so special about NFC?
 Triggered by a simple tap; NFC transactions are short, lasting just a
fraction of a second, with no need for any preliminary steps. The
result is a very intuitive gesture.

 In NFC, only one device needs to be powered (except for Peer-to-


peer mod). The possibility to have inexpensive, completely passive
tags is a true enabler for IoE (Internet of Everything) scenarios.

 NFC is a proximity technology based on an intentional action that


makes obvious the NFC device is present and identifiable by its
owner.

 The NFC software stack is fully integrated into Android, iOS and
Windows, mobile operating systems that natively provide a number
of services, creating the opportunity for many applications to use
NFC without the need to install any specific software

ECE4010 Winter 2021-2022 79


NFC Applications

ECE4010 Winter 2021-2022 80


NFC Passive Communication

ECE4010 Winter 2021-2022 81


NFC Active Communication

ECE4010 Winter 2021-2022 82


Range Vs Data rate

ECE4010 Winter 2021-2022 83


Advantages
 Convenient: The convenience of payment is one of this system‟s
greatest advantages.

 Versatile: NFC is very versatile, in that it covers a range of different


industries and services.

 Better User Experience: This system is beneficial for enterprises


too companies that readily adopt the latest technology are viewed
by customers as being dynamic and progressive.

 Seamless: The high level of encryption enables institutions to


employ it as a sort of a security system, which does an accurate ID
on students entering and exiting the premises.

ECE4010 Winter 2021-2022 84


Zigbee
Zigbee
 ZigBee is the most popular industry wireless mesh networking
standard for connecting sensors, instrumentation and control
systems.
 ZigBee, a specification for communication in a wireless personal
area network (WPAN), has been called the "Internet of things."
 ZigBee is an open, global, packet-based protocol designed to
provide an easy-to-use architecture for secure, reliable, low power
wireless networks.
 ZigBee and IEEE 802.15.4 are low data rate wireless networking
standards that can eliminate the costly and damage prone wiring in
industrial control applications.
 Flow or process control equipment can be place anywhere and still
communicate with the rest of the system.
 It can also be moved, since the network doesn't care about the
physical location of a sensor, pump or valve

ECE4010 Winter 2021-2022 86


How Zigbee Works?
 ZigBee basically uses digital radios to allow devices to communicate with
one another.

 Every ZigBee network must contain a network coordinator. Other Full


Function Devices (FFD's) may be found in the network, and these devices
support all of the 802.15.4 functions.

 They can serve as network coordinators, network routers, or as devices that


interact with the physical world.

 Several topologies are supported by ZigBee, including star, mesh, and


cluster tree. Star topology is most useful when several end devices are
located close together and they can communicate with a single router node.

 Mesh networking allows for redundancy in node links, so that if one node
goes down, devices can find an alternative path to communicate with one
another.

ECE4010 Winter 2021-2022 87


Zigbee Features
 There are three different states defined for the devices:
Transmitting, receiving and sleeping. This allows to the device to
save energy when duty cycles are defined and the device sleeps.

 Mainly used for Wireless Sensor Networks

 Users expect batteries to last many months to years

 Even mains powered equipment needs to be conscious of energy.

 ZigBee devices will be more ecological than its predecessors saving


megawatts at it full deployment.

 ZigBee provides ultra low consumption and efficiency (thanks to the


adaptable duty cycle, the low rate rates and the low coverage radio),
and enable large scale networks for the WSN, making it one of the
most convenient standards for this purpose.

ECE4010 Winter 2021-2022 88


ZigBee Communication
 ZigBee Coordinator: responsible for initializing, maintaining and
controlling the network. There is one and only one per network
 ZigBee Router: connected to the coordinator or other routers. It can
have zero or more children nodes. Participate in multi hop routing
 ZigBee End Devices: does not participate in routing

ECE4010 Winter 2021-2022 89


Zigbee Applications

ECE4010 Winter 2021-2022 90


Advantages
 ZigBee is standardized at all layers, this ensures that products from
different manufacturers are compatible with each other.

 The power of the mesh, devices tend to connect with every near
device, that makes every node of the network reachable from every
other node and expanding the network geographically, also
providing self healing, if the preferable path to a node fails there are
other path to reach the node. The more devices you have the more
reliable the network is.

 Low consumption of energy and working in the network even without


the necessity of a battery (Green Power). Energy-harvesting devices
lack batteries, getting it by extracting the energy they need from the
environment.

 High scalability, ZigBee networks can to thousand of devices and


they will communicate with each other using the best available path.

ECE4010 Winter 2021-2022 91


Activity
EEPROM Library

 The microcontroller on the Arduino and Genuino AVR


based board has EEPROM: memory whose values are
kept when the board is turned off (like a tiny hard drive).

 This library enables you to read and write those bytes.

 EEPROM available in UNO – 1024 bytes (1Kb)

 #include <EEPROM.h>

ECE4010 Winter 2021-2022 92


Activity
 EEPROM Clear: Clear the bytes in the EEPROM.

 EEPROM Read: Read the EEPROM and send its values to the computer.

 EEPROM Write: Stores values from an analog input to the EEPROM.

 EEPROM Crc: Calculates the CRC of EEPROM contents as if it was an


array.

 EEPROM Get: Get values from EEPROM and prints as float on serial.

 EEPROM Iteration: Understand how to go through the EEPROM memory


locations.

 EEPROM Put: Put values in EEPROM using variable semantics.

 EEPROM Update: Stores values read from A0 into EEPROM, writing the
value only if different, to increase EEPROM life.

ECE4010 Winter 2021-2022 93


Activity
 Write a sketch that allows a user to access data in
EEPROM using the serial monitor. In the serial monitor
the user should be able to type one of two commands:
“read” and “write. "Read" takes one argument, an
EEPROM address. "Write" takes two arguments, an
EEPROM address and a value.

 For example, if the user types “read 3” then the contents


of EEPROM address 3 should be printed to the serial
monitor. If the user types “write 3 10” then the value 10
should be written into address 3 of the EEPROM.

ECE4010 Winter 2021-2022 94


PCI
PCI
 PCI(Peripheral Component Interconnect) bus is based on ISA
(Industry Standard Architecture) Bus and VL (VESA Local) Bus.

 Introduced by Intel in 1992

 Revised twice into version 2.1 which is the 64-bit standard that it is
today.

 Great feature of PCI Bus was that it was invented as an industry


standard

 PCI provides direct access to system memory for the devices that
are connected to the bus which is then connected through a bridge
that connects to the front side bus.

 This configuration allowed for higher performance without slowing


down the processor

ECE4010 Winter 2021-2022 96


PCI Features
 The maximum theoretical transfer rate of the base configuration is 132
Mbytes/sec.

 Extensions to the base PCI specification can boost this by a factor of four to
528 Mbytes/sec.

 The PCI-X enhancements extend potential bandwidth to over 4 gigabytes


per second.

 Any device on the bus can be a bus master and initiate transactions. One
consequence of this is that there is no need for the traditional notion of
DMA.

 The transfer protocol is optimized around transferring blocks of data. A


single transfer is just a block transfer with a length of one.

ECE4010 Winter 2021-2022 97


PCI Features
 Although PCI is officially processor-independent, it inevitably reflects its
origins with Intel and its primary application in the PC architecture. Among
other things it uses little-endian byte ordering.
 PCI implements Plug-and-Play configurability.
 Every device in a system is automatically configured each time the system
is turned on.
 The configuration protocol supports up to 256 devices in a system.
 The electrical specifications emphasize low power use including support for
both 3.3 and 5 volt signaling environments.

ECE4010 Winter 2021-2022 98


PCI Bus Block diagram

ECE4010 Winter 2021-2022 99


PCI Signals
 A PCI interface requires a minimum of 47 pins for a target-only
device and 49 pins for a master.
 This is sufficient for a 32-bit data path running at up to 33 MHz and
is mandatory for all devices claiming PCI compatibility.
 An additional 51 pins define optional features such as 64-bit
transfers, interrupts and a JTAG interface.
A note about notation:
 A # sign at the end of a signal name, such as FRAME#, indicates
that the signal is active or asserted in the low voltage state.
 Signal names without a # are asserted in the high voltage state.
 The notation [n::m], where n and m are integers such that n is
greater than m, represents an “array” of signals with n – m + 1
members. Thus, AD[31::0] represents the 32-bit data bus consisting
of signal AD[0] to AD[31] with AD[0] being the least significant bit.
ECE4010 Winter 2021-2022 100
PCI Signals

ECE4010 Winter 2021-2022 101


Evolution of PCI bus

ECE4010 Winter 2021-2022 102


PCI Read Write Operation
 All signals sampled on rising edge
 Centralized Parallel Arbitration
 overlapped with previous transaction

 All transfers are (unlimited) bursts


 Address phase starts by asserting FRAME#
 Next cycle “initiator” asserts cmd and address
 Data transfers happen on when
 IRDY# asserted by master/initiator when ready to transfer data
 TRDY# asserted by target when ready to transfer data
 transfer when both asserted on rising edge

 FRAME# deasserted when master intends to complete only one


more data transfer

ECE4010 Winter 2021-2022 103


Advantages & Disadvantages
Advantages

 Very high speed

 Plug & Play

 Dominant board-level bus

Disadvantages

 Incompatible with older systems

 Can cost more

ECE4010 Winter 2021-2022 104


Ethernet
Ethernet
 Most popular packet-switched LAN technology
 Bandwidths: 10Mbps, 100Mbps, 1Gbps
 Max bus length: 2500m
 500m segments with 4 repeaters
 Bus and Star topologies are used to connect hosts
 Hosts attach to network via Ethernet transceiver or hub or switch
 Detects line state and sends/receives signals
 Hubs are used to facilitate shared connections
 All hosts on an Ethernet are competing for access to the medium
 Switches break this model

 Ethernet operates at the link layer in TCP/IP model


architecture.
ECE4010 Winter 2021-2022 106
Ethernet
 Ethernet by definition is a broadcast protocol
 Any signal can be received by all hosts
 Switching enables individual hosts to communicate

 Network layer packets are transmitted over an Ethernet


by encapsulating
 Frame Format

64 48 48 16 32

Preamble Dest Src Type Body CRC


addr addr

ECE4010 Winter 2021-2022 107


Ethernet
 Ethernet and Wi-Fi are both “multi-access” technologies
 Broadcast medium, shared by many hosts
 Simultaneous transmissions will result in collisions
 Media Access Control (MAC) protocol required
 Rules on how to share medium
 The Data Link Layer is divided into two Parts: MAC (Media Access
Control) Sub layer and LLC (Logic Link Control) Sub layer

ECE4010 Winter 2021-2022 108


Ethernet CSMA/CD
 CSMA/CD (carrier sense multiple access with collision
detection) media access protocol is used.
 Data is transmitted in the form of packets.
 Sense channel prior to actual packet transmission.
 Transmit packet only if channel is sensed idle; else, defer the
transmission until channel becomes idle.
 After packet transmission is started, the node monitors its own
transmission to see if the packet has experienced a collision.
 If the packet is observed to be undergoing a collision, the
transmission is aborted and the packet is retransmitted after a
random interval of time using Binary Exponential Back off
algorithm.

ECE4010 Winter 2021-2022 109


Switched Ethernet
 Switches forward and filter frames based on LAN
addresses
 It‟s not a bus or a router (although simple forwarding tables are
maintained)
 Very scalable
 Options for many interfaces
 Full duplex operation (send/receive frames simultaneously)
 Connect two or more “segments” by copying data frames
between them
 Switches only copy data when needed
 key difference from repeaters
 Higher link bandwidth
 Collisions are completely avoided
 Much greater aggregate bandwidth
 Separate segments can send at once
ECE4010 Winter 2021-2022 110
Ethernet Frame Structure
 Preamble:
 7 bytes with pattern 10101010 followed by one byte with pattern
10101011
 Used to synchronize receiver, sender clock rates

 Addresses: 6 bytes, frame is received by all adapters on


a LAN and dropped if address does not matched
 CRC: 4 bytes generated using CR-32, checked at
receiver, if error is detected, the frame is simply dropped
 Data Payload: Maximum 1500 bytes, minimum 46 bytes
 If data is less than 46 bytes, pad with zeros to 46 bytes

ECE4010 Winter 2021-2022 111


Classifications
 Basic ethernet is slowest among all, which provide the s
speed of 10Mbps.

 Fast Ethernet provides the speed of 100Mbps, which is


intermediate between basic and Gigabit network

 Gigabit Ethernet has the highest data transfer speed of


1Gbps. This speed is 10 times more than Fast Ethernet.

ECE4010 Winter 2021-2022 112


Ethernet BUS Topology

Repeater

ECE4010 Winter 2021-2022 113


Ethernet STAR Topology

Hub

ECE4010 Winter 2021-2022 114


Advantages
 To form an Ethernet, we do not need much cost. It is relatively
inexpensive. It is costless as compare to other systems of
connecting computers.
 In Ethernet, all the node have the same privileges. It does not
follow client-server architecture.
 It does not require any switches or hubs
 Maintenance and administration are simple.
 The cable used to connect systems in ethernet is robust to noise.
 As it is robust to the noise, the quality of the data transfer does not
degrade. The data transfer quality is good.
 With a Gigabit network, users can transfer data with the speed of 1-
100Gbps.

ECE4010 Winter 2021-2022 115


Disadvantages
 It does not hold good for real-time applications as it requires
deterministic service.

 As the network cannot set priority for the packets, it is not suitable
for a client-server architecture.

 In ethernet, there is a limit of the minimum size of the frame to 46B.


The result of that, it is not a good choice for interactive applications.

 Not suitable for traffic-intensive applications. If the traffic on the


Ethernet increases, the efficiency of the Ethernet goes down.

 After receiving a packet, the receiver doesn‟t send any


acknowledge.

 If there is any problem in ethernet, it is difficult to troubleshoot what


cable or node in the network causing an actual problem.

ECE4010 Winter 2021-2022 116


Activity
 About Arduino Shields
 https://learn.sparkfun.com/tutorials/arduino-shields
 Arduino Shield List (Don't memorize, just reference)
 http://playground.arduino.cc/Main/SimilarBoards
 Ethernet Shield
 https://www.arduino.cc/en/Main/ArduinoEthernetShield
 WiFi Shield
 https://www.arduino.cc/en/pmwiki.php?n=Main/Arduino
WiFiShield

ECE4010 Winter 2021-2022 117


Thank You
Design Challenges and
Technologies for
Embedded Systems
• Design challenge of Embedded Systems – optimizing design metrics
• Technologies
• Processor technologies
• IC technologies
• Design technologies
1
Some common characteristics of
embedded systems

• Single-functioned
• Executes a single program, repeatedly
• Tightly-constrained
• Low cost, low power, small, fast, etc.
• Reactive and real-time
• Continually reacts to changes in the system’s
environment
2
• Must compute certain results in real-time without delay
An embedded system example -- a
digital camera
Digital camera chip
CCD

CCD preprocessor Pixel coprocessor D2A


A2D

lens

JPEG codec Microcontroller Multiplier/Accum

DMA controller Display ctrl

Memory controller ISA bus interface UART LCD ctrl

• Single-functioned -- always a digital camera 3


• Tightly-constrained -- Low cost, low power, small, fast
• Reactive and real-time -- only to a small extent
Design challenge –
optimizing design metrics
• Obvious design goal:
• Construct an implementation with desired functionality
• Key design challenge:
• Simultaneously optimize numerous design metrics
• Design metric
• A measurable feature of a system’s implementation
• Optimizing design metrics is a key challenge
4
Design challenge – optimizing
design metrics
Common metrics
•Unit cost: the monetary cost of manufacturing each copy of the
system, excluding NRE cost

•NRE cost (Non-Recurring Engineering cost): The


one-time monetary cost of designing the system
•Size: the physical space required by the system
•Performance: the execution time or throughput of the system
•Power: the amount of power consumed by the system
•Flexibility: the ability to change the functionality of the system without
incurring heavy NRE cost
5
Design challenge – optimizing design
metrics
Common metrics (continued)
• Time-to-prototype: the time needed to build a working version of the system
• Time-to-market: the time required to develop a system to the point that it can
be released and sold to customers
• Maintainability: the ability to modify the system after its initial release
• Correctness,
• Safety,
• Testability,
• Manufacturability,
• many more

6
Design metric competition -- improving
one may worsen others •Expertise with both
Power software and
hardware is needed to
Performance Size
optimize design
metrics
• Not just a hardware
NRE cost or software expert,
as is common
• A designer must be
CCD
Digital camera chip comfortable with
A2D
CCD preprocessor Pixel coprocessor D2A various technologies
lens
JPEG codec Microcontroller Multiplier/Accum
in order to choose
DMA controller Display ctrl Hardware the best for a given
application and
Software
Memory controller ISA bus interface UART LCD ctrl constraints 7
Time-to-market: a
demanding design metric
•Time required to develop a
product to the point it can be
sold to customers
•Market window
• Period during which the
product would have highest
Revenues ($)

sales
•Average time-to-market
constraint is about 8 months
Time (months) •Delays can be costly 8
Losses due to delayed market
entry
•Simplified revenue model
Peak revenue
• Product life = 2W, peak at W
Peak revenue from
• Time of market entry defines a
Revenues ($)

delayed entry
On-time triangle, representing market
Market rise Market fall penetration
Delayed • Triangle area equals revenue
•Loss
D W 2W • The difference between the on-
On-time Delayed Time time and delayed triangle areas
entry entry

9
Losses due to delayed market entry
(cont.)
•Area = 1/2 * base * height
Peak revenue • On-time = 1/2 * 2W * W
Peak revenue from
• Delayed = 1/2 * (W-D+W)*(W-D)
Revenues ($)

On-time
delayed entry
•Percentage revenue loss = (D(3W-
Market rise Market fall D)/2W2)*100%
Delayed •Try some examples
– Lifetime 2W=52 wks, delay D=4 wks
D W 2W
– (4*(3*26 –4)/2*26^2) = 22%
On-time Delayed Time – Lifetime 2W=52 wks, delay D=10 wks
entry entry – (10*(3*26 –10)/2*26^2) = 50%
– Delays are costly!
10
NRE and unit cost metrics
•Costs:
• Unit cost: the monetary cost of manufacturing each copy of the system, excluding NRE
cost
• NRE cost (Non-Recurring Engineering cost): The one-time monetary cost of designing the
system
• total cost = NRE cost + unit cost * # of units
• per-product cost = total cost / # of units
= (NRE cost / # of units) + unit cost

• Example
– NRE=$2000, unit=$100
– For 10 units
– total cost = $2000 + 10*$100 = $3000
– per-product cost = $2000/10 + $100 = $300
Amortizing NRE cost over the units results in an
additional $200 per unit 11
NRE and unit cost metrics
•Compare technologies by costs -- best depends on quantity
• Technology A: NRE=$2,000, unit=$100
• Technology B: NRE=$30,000, unit=$30
• Technology C: NRE=$100,000, unit=$2
$200,000 $200
A A
B B
$160,000 $160
C C
tota l c ost (x1000)

p er p rod uc t c ost
$120,000 $120

$80,000 $80

$40,000 $40

$0 $0
0 800 1600 2400 0 800 1600 2400
Numb er of units (volume) Numb er of units (volume)

• But, must also consider time-to-market 12


The performance design
• metric
Widely-used measure of system, widely-abused
• Clock frequency, instructions per second – not good measures
• Digital camera example – a user cares about how fast it processes images, not
clock speed or instructions per second
• Latency (response time)
• Time between task start and end
• e.g., Camera’s A and B process images in 0.25 seconds
• Throughput
• Tasks per second, e.g. Camera A processes 4 images per second
• Throughput can be more than latency seems to imply due to concurrency, e.g.
Camera B may process 8 images per second (by capturing a new image while
previous image is being stored).
• Speedup of B over S = B’s performance / A’s performance
• Throughput speedup = 8/4 = 2
13
Three key embedded system
technologies
What is “Technology”?
• A manner of accomplishing a task, especially using
technical processes, methods, or knowledge

Three key technologies for embedded


systems
• Processor technology
• IC technology
14
• Design technology
Processor technology
Processor is the architecture of the computation engine used to
implement a system’s desired functionality
Processor does not have to be programmable
• “Processor” not equal to general-purpose processor

Controller Datapath Controller Datapath Controller Datapath


Control index
Control Register Control logic Registers
logic
logic and file and State total
State register register State
Custom +
ALU register
General
IR PC ALU IR PC
Data Data
memory memory
Program Data Program memory
memory memory
Assembly code Assembly code
for: for:

total = 0 total = 0
for i =1 to … for i =1 to …
15
General-purpose (“software”) Application-specific Single-purpose (“hardware”)
Processor technology
• Processors vary in their customization for the problem at hand

total = 0
for i = 1 to N loop
total += M[i]
end loop
Desired
functionality

General-purpose Application-specific Single-purpose


processor processor processor
16
General-purpose processors
• Programmable device used in a variety of
Controller Datapath
applications
• Also known as “microprocessor” Control
logic and
Register
file
• Features State register

• Program memory General


• General datapath with large register file and IR PC ALU

general ALU
• User benefits Program
memory
Data
memory
• Low time-to-market and NRE costs
Assembly code
• High flexibility for:

• “Pentium” the most well-known, but total = 0


for i =1 to …
there are hundreds of others
17
Single-purpose processors
• Digital circuit designed to execute exactly Controller Datapath
one program Control index
• a.k.a. coprocessor, accelerator or peripheral logic
total
• Features State
register +
• Contains only the components needed to
execute a single program Data
• No program memory memory

• Benefits
• Fast
• Low power
• Small size
18
Application-specific processors
• Programmable processor optimized for a Controller Datapath
particular class of applications having Control Registers
common characteristics logic and
State register
• Compromise between general-purpose and Custom
single-purpose processors ALU
IR PC
• Features
Data
• Program memory Program memory
• Optimized datapath memory
• Special functional units Assembly code

• Benefits
for:

total = 0
• Some flexibility, good performance, size and for i =1 to …
power
19
IC technology
The manner in which a digital (gate-level) implementation is mapped
onto an IC
• IC: Integrated circuit, or “chip”
• IC technologies differ in their customization to a design
• IC’s consist of numerous layers (perhaps 10 or more)
• IC technologies differ with respect to who builds each layer and when

20
gate
IC package IC oxide
source channel drain
Silicon substrate
IC technology
• Three types of IC technologies
• Full-custom/VLSI
• Semi-custom ASIC (gate array and standard cell)
• PLD (Programmable Logic Device)

Here PLD is a generic


name that includes
FPGAs, FPAAs, etc
21
Full-custom/VLSI
• All layers are optimized for an embedded system’s particular digital
implementation
• Placing transistors
• Sizing transistors
• Routing wires
• Benefits
• Excellent performance, small size, low power
• Drawbacks
• High NRE cost (e.g., $300k), long time-to-market

22
Semi-custom
• Lower layers are fully or partially built
• Designers are left with routing of wires and maybe placing some
blocks
• Benefits
• Good performance, good size, less NRE cost than a full-custom
implementation (perhaps $10k to $100k)
• Drawbacks
• Still require weeks to months to develop

23
PLD (Programmable Logic
Device)
All layers already exist
• Designers can purchase an IC
• Connections on the IC are either created or destroyed to implement
desired functionality
• Field-Programmable Gate Array (FPGA) very popular
Benefits
• Low NRE costs, almost instant IC availability
Drawbacks
• Bigger, expensive (perhaps $30 per unit), power hungry, slower

24
Moore’s law
Moore’s law Moore’s law
• The most important trend in embedded systems
• Predicted in 1965 by Intel co-founder Gordon Moore
IC transistor capacity has doubled roughly every 18 months for the past several
decades

10,000

1,000

Logic transistors per 100


chip 10
(in millions)
1
Note: 0.1
logarithmic scale
0.01

0.001
26
Moore’s law
• Wow
• This growth rate is hard to imagine, most people underestimate
• How many ancestors do you have from 20 generations ago
• i.e., roughly how many people alive in the 1500’s did it take to make you?
• 220 = more than 1 million people
• (This underestimation is the key to pyramid schemes!)

27
Graphical illustration of Moore’s
law
1981 1984 1987 1990 1993 1996 1999 2002

10,000 150,000,000
transistors transistors

Leading edge Leading edge


chip in 1981 chip in 2002

• Something that doubles frequently grows more quickly than most


people realize!
• A 2002 chip can hold about 15,000 1981 chips inside itself

28
Design Technology
• The manner in which we convert our concept of desired system
functionality into an implementation

Compilation/ Libraries/ Test/


Synthesis IP Verification

System System Hw/Sw/ Model simulat./


Compilation/Synthesis: specification synthesis OS checkers
Automates exploration and
insertion of implementation
details for lower level.
Behavioral Behavior Cores Hw-Sw
specification synthesis cosimulators
Libraries/IP: Incorporates pre-
designed implementation from
lower abstraction level into
higher level. RT RT RT HDL simulators
specification synthesis components

Test/Verification: Ensures correct


functionality at each level, thus
reducing costly iterations Logic Logic Gates/ Gate
between levels. specification synthesis Cells simulators

To final implementation 29
Design productivity exponential
increase
100,000

10,000

(K) Trans./Staff – Mo.


1,000

Productivity
100

10

0.1

0.01

2005
2003
1987

2001
1983

1993
1985

1991
1989

1999
1997
1995

2007

2009
• Exponential increase over the past few decades
30
The co-design ladder
• In the past: Sequential program code (e.g., C, VHDL)

• Hardware and software Compilers


Behavioral synthesis
(1990's)
(1960's,1970's)
design technologies were very
Register transfers
different Assembly instructions RT synthesis
• Recent maturation of Assemblers, linkers
(1980's, 1990's)

synthesis enables a unified (1950's, 1960's) Logic equations / FSM's


Logic synthesis
view of hardware and (1970's, 1980's)
Machine instructions
software Logic gates

• Hardware/software
Implementation
“codesign” Microprocessor plus
program bits: “software”
VLSI, ASIC, or PLD
implementation: “hardware”

The choice of hardware versus software for a particular function is simply a tradeoff among various
design metrics, like performance, power, size, NRE cost, and especially flexibility; there is no
fundamental difference between what hardware or software can implement. 31
Independence of processor and IC
technologies
• Basic tradeoff
• General vs. custom
• With respect to processor technology or IC technology
• The two technologies are independent

General- Single-
purpose ASIP purpose
General, processor processor Customized,
providing improved: providing improved:

Flexibility Power efficiency


Maintainability Performance
NRE cost Size
Time- to-prototype Cost (high volume)
Time-to-market
Cost (low volume)

PLD Semi-custom Full-custom 32


Design productivity gap
• While designer productivity has grown at an impressive rate
over the past decades, the rate of improvement has not kept
pace with chip capacity
10,000 100,000
1,000 10,000

Logic transistors 100 1000


per chip 10 Gap 100 Productivity
IC capacity (K) Trans./Staff-Mo.
(in millions) 1 10
0.1 1
productivity
0.01 0.1
0.001 0.01

33
Design productivity gap
• 1981 leading edge chip required 100 designer months
• 10,000 transistors / 100 transistors/month
• 2002 leading edge chip requires 30,000 designer months
• 150,000,000 / 5000 transistors/month
• Designer cost increase from $1M to $300M
10,000 100,000
1,000 10,000
Logic transistors 100 1000
10 Gap 100 Productivity
per chip IC capacity
(in millions) 1 10 (K) Trans./Staff-Mo.
0.1 1
productivity
0.01 0.1
0.001 0.01

34
The mythical man-month
The situation is even worse than the productivity gap indicates
In theory, adding designers to team reduces project completion time
In reality, productivity per designer decreases due to complexities of team management
and communication
In the software community, known as “the mythical man-month” (Brooks 1975)
At some point, can actually lengthen project completion time! (“Too many cooks”)
Team
60000 15
• 1M transistors, 1 16 16
18
50000 19
designer=5000
40000 24 23
trans/month
30000
Months until completion
• Each additional designer 20000 43
reduces for 100 10000 Individual
trans/month
0 10 20 30 40
• So 2 designers produce Number of designers 35
4900 trans/month each
Microelectronic Circuits
• General-purpose processors:
• High-volume sales.
• High performance.
• Application-Specific Integrated Circuits (ASICs):
• Varying volumes and performances.
• Large market share.
• Prototypes.
• Special applications (e.g. space).
Microelectronics Design Styles
• Adapt circuit design style to market requirements
• Parameters:
• Cost.
• Performance.
• Volume.
• Full custom
• Maximal freedom
• High performance blocks
• Slow
• Semi-custom
• Standard Cells
• Gate Arrays
• Mask Programmable (MPGAs)
• Field Programmable (FPGAs)) • Silicon Compilers & Parametrizable Modules
(adder, multiplier,
• memories)
• Standard Cells
• Cell library:
• Cells are designed once.
• Cells are highly optimized.
• Layout style:
• Cells are placed in rows.
• Channels are used for wiring.
• Over the cell routing.
• Compatible with macro-cells (e.g. RAMs).
• Macro-cells
• Module generators:
• Synthesized layout.
• Variable area and aspect-ratio.
• Examples:
• RAMs, ROMs, PLAs, general logic blocks.
• Features:
• Layout can be highly optimized.
• Structured-custom design.
Array-based design
Pre-diffused arrays:
• Personalization by metalization/contacts.
• Mask-Programmable Gate-Arrays.
Pre-wired arrays:
• Personalization on the field.
• Field-Programmable Gate-Arrays.
MPGAs & FPGAs
MPGAs:
• Array of sites:
• Each site is a set of transistors. • Batches of wafers can be pre-fabricated.
• Few masks to personalize chip.
• Lower cost than cell-based design.
FPGAs:
• Array of cells:
• Each cell performs a logic function. • Personalization:
• Soft: memory cell (e.g. Xilinx).
• Hard: Anti-fuse (e.g. Actel). • Immediate turn-around (for low volumes).
• Inferior performances and density.
• Good for prototyping.
Semi-custom style
trade-off
Example: DEC AXP Chip designed using Macro Cells
Example: Field Programmable
Gate Array from Actel
Summary
Embedded systems are everywhere

Key challenge: optimization of design metrics


• Design metrics compete with one another

A unified view of hardware and software is necessary to improve


productivity

Three key technologies


• Processor: general-purpose, application-specific, single-purpose
• IC: Full-custom, semi-custom, PLD
• Design: Compilation/synthesis, libraries/IP, test/verification

43

You might also like