UNIT- 1
System Definition:
A way of working, organizing or performing one or many tasks according to a fixed set of rules,
program or plan. Also an arrangement in which all units assemble and work together according
to a program or plan. Time display system – A watch Automatic cloth washing system – A
washing machine
Embedded System Definitions:
An embedded system is a system that has software embedded into computer-hardware, which
makes a system dedicated for an application (s) or specific part of an application or product or
part of a larger system.” An embedded system is one that has dedicated purpose software
embedded in computer hardware. It is any device that includes a programmable computer but is
not itself intended to be a general purpose computer. Embedded Systems are the electronic
systems that contain a microprocessor or a microcontroller, but we do not think of them as
computers – the computer is hidden or embedded in the system.”
An embedded system is an electronic system that has a software and is embedded in computer
hardware. It is programmable or non- programmable depending on the application.
An Embedded system is defined as a way of working, organizing, performing single or multiple
tasks according to a set of rules. In an embedded system, all the units assemble and work
together according to the program. Examples of embedded systems include numerous products
such as microwave ovens, washing machine, printers, automobiles, cameras, etc. These systems
use microprocessors, microcontrollers as well as processors like DSPs. This article gives an
overview of what is an embedded system and types of embedded system.
The Components of Embedded System:
Processor
The main part of an embedded system is the processor, which could also be a generic
microprocessor or a microcontroller and programmed to perform the specific tasks for which the
integrated system has been designed.
Memory:
Electronic memory is an important part of embedded systems and three essential types of
memory can be described: RAM, or random access memory, ROM, or read only memory, and
Cache. The RAM is one of the hardware components where data are temporarily stored during
execution of the system. The ROM contains input output routines that are needed for the system
at boot time. The cache, instead, is used by the processor as a temporary storage during the
processing and transferring of data.
System Clock
The system clock is used for all processes is running on an embedded system and requires
precise timing information. This clock is generally composed of an oscillator and some
associated digital circuitry.
Peripherals:
The peripheral devices are provided on the embedded system boards for an easy integration.
Typical devices include serial port, parallel port, network port, keyboard and mouse ports, a
memory unit port and monitor port. Some specialized embedded systems also have other ports
such as CAN-bus.
Classification of Embedded Systems:
Embedded systems can be classified into different types based on performance, functional
requirements and performance of the microcontroller. Embedded systems are classified into four
categories based on their performance and functional requirements:
 Stand alone embedded systems
 Real time embedded systems
 Networked embedded systems
 Mobile embedded systems
Embedded Systems are classified into three types based on the performance of
the microcontroller such as
 Small scale embedded systems
 Medium scale embedded systems
 Sophisticated embedded systems
Stand Alone Embedded Systems
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-Which either controls,drives
and displays the connected devices. Examples for the stand alone embedded systems are mp3
players, digital cameras, video game consoles, microwave ovens and temperature measurement
systems.
Real Time Embedded Systems
A real time embedded system is defined as, a system which gives a required o/p in a particular
time.These types of embedded systems follow the time deadlines for completion of a task. Real
time embedded systems are classified into two types such as soft and hard real time systems.
Networked Embedded Systems
These types of embedded systems are related to a network to access the resources. The connected
network can be LAN, WAN or the internet. The connection can be any wired or wireless. This
type of embedded system is the fastest growing area in embedded system applications. The
embedded web server is a type of system wherein all embedded devices are connected to a web
server and accessed and controlled by a web browser. Example for the LAN networked
embedded system is a home security system wherein all sensors are connected and run on the
protocol TCP/IP
Mobile Embedded Systems
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 the other resources and limitation of memory.
Small Scale Embedded Systems
These types of embedded systems are designed with a single 8 or 16-bit microcontroller,
that may even be activated by a battery. For developing embedded software for small scale
embedded systems, the main programming tools are an editor, assembler, cross assembler and
integrated development environment (IDE).
Medium Scale Embedded Systems
These types of embedded systems design with a single or 16 or 32 bit microcontroller, RISCs or
DSPs. These types of embedded systems have both hardware and software complexities. For
developing embedded software for medium scale embedded systems, the main programming
tools are C, C++, JAVA, Visual C++, RTOS, debugger, source code engineering tool, simulator
and IDE.
Sophisticated Embedded Systems
These types of embedded systems have enormous hardware and software complexities, that may
need ASIPs, IPs, PLAs, scalable or configurable processors. They are used for cutting-edge
applications that need hardware and software Co-design and components which have to
assemble in the final system.
Characteristics of Embedded System:
Most embedded systems are designed to perform a continued action at a low cost. Most of these
systems also have constraints on the performance in terms of hardware and software, such as
require operating in real time when a system needs high sped while executing some functions,
but may tolerate lower speed for other activities. It is difficult to characterize the speed or the
cost of a generic embedded system, especially for systems that have to process a large quantity
of data.
Typical characteristics of embedded systems can be the following:
1. Processing: ability to process the analog/digital signals.
2. Communication: ability to transfer signals (“Information”) from/to the outside world.
3. Storage: the ability to preserve the temporary information within the embedded system.
4. Each specific application made by an embedded system has different requirements for
processing, power supply, storage and communication.
5. Final Cost: The cost of the final product is a very important parameter for the design
choices.
6. Time to market: in the design of an embedded system must always keep in mind the timing
you want the product listed on the market; taking too long to design a device means that it’s
difficult to overcome the fast changes in the market.
7. Life time: Another important factor is the expected lifetime for the product; which can vary
from a few days to several years or decades.
8. Communication interfaces: typically the sale price of an embedded system is low, the
choice of communication interfaces is critical because it greatly affects the final price of the
product.
9. User Interface: In many embedded systems the user interface consists of a few buttons
and/or LEDs; in others, it uses the user interface of a host system.
10. Power management: is a crucial factor to be considered for all embedded systems are
powered by batteries.
11. Dimensions and weight: in many cases, the physical characteristics are another critical
factor; usually the embedded system must be small, very light or with a particular form (for
example, very thin).
12. Code size: the storage capacity of embedded systems is limited, so the size of the internal
program (e.g. firmware) is a important factor.
13. Reliability: realistic assessment of the probability that the system fails.
14. Maintainability: the system can be repaired or replaced within a certain time interval.
15. Availability: probability that the system is working; essentially depends on the reliability
and maintainability.
16. Safety: properties related to the possibility that in the event of system failure are caused
damages to people or things.
Embedded systems requirements:
1. Dedicated functions
2. Dedicated complex algorithms
3. Dedicated (GUIs) and other user interfaces for the application
4. Real time operations.
5. Multi-rate operations.
6. Software requirements analysis.
7. Requirements and software architecture design.
8. Requirements and detailed software design.
9. Requirements and software coding.
10. Requirements and software testing.
11. Requirements change management.
12. Impact analysis.
13. Change management tools.
14. Requirements tracing.
15. Consistency management.
Constraints of an Embedded System Design:
1. Available system-memory
2. Available processor speed
3. Limited power dissipation when running the system continuously in cycles of the system
start, wait for event, wake-up and run, sleep and stop.
4. Performance,
5. power,
6. size,
7. non-recurring design cost,
8. manufacturing costs.
Applications of Embedded Systems:
Embedded systems are used in different applications like automobiles, telecommunications,
smart cards, missiles, satellites, computer networking and digital consumer electronics.
1. Embedded Systems in Automobiles and in telecommunications
 Motor and cruise control system
 Body or Engine safety
 Entertainment and multimedia in car
 E-Com and Mobile access
 Robotics in assembly line
 Wireless communication
 Mobile computing and networking
2. Embedded Systems in Smart Cards, Missiles and Satellites
 Security systems
 Telephone and banking
 Defense and aerospace
 Communication
3. Embedded Systems in Peripherals & Computer Networking
 Displays and Monitors
 Networking Systems
 Image Processing
 Network cards and printers
4. Embedded Systems in Consumer Electronics
 Digital Cameras
 Set top Boxes
 High Definition TVs
 DVDs
UNIT – 2
Timing and clocks in embedded systems:
Counter/timer hardware is a crucial component of most embedded systems. In some cases, a
timer measures elapsed time (counting processor clock ticks). In others, we want to count or time
external events. The names counter and timer can be used interchangeably when talking about
the hardware. The difference in terminology has more to do with how the hardware is used in a
given application.
Figure 1: A simple counter/timer
Semi-automatic
A timer with automatic reload capability will have a latch register to hold the count written by
the processor. When the processor writes to the latch, the count register is written as well. When
the timer later overflows, it first generates an output signal. Then, it automatically reloads the
contents of the latch into the count register. Since the latch still holds the value written by the
processor, the counter will begin counting again from the same initial value.
Input capture
An input capture timer, like the one shown in Figure 2, has a latch connected to the timer's count
register. The timer is run at a constant clock rate (usually a derivative of the processor clock), so
that the count registers is constantly incrementing (or decrementing, for a down counter). An
external signal latches the value of the free-running timer into the processor-visible register and
generates an output signal (typically an interrupt).
Figure 2: An input capture timer
Real Time Clock (RTC)
A clock, which is based on the interrupts at preset intervals. An interrupt service routine executes
on each timeout (overflow) of this clock. This timing device once started never resets or never
reloaded with another value. Once it is set, it is not modified later.
 A real time clock (RTC) provides the system clock to generate the system interrupts
 An interrupt service routine executes on each tick (timeout or overflow) of this clock.
 This timing device once started is generally never reset or never reloaded to another
value.
The purpose of an RTC or a real time clock is to provide precise time and date which can be
used for various applications.
 RTC is an electronic device in the form of an Integrated Chip (IC) available in various
packaging options.
 It is powered by an internal lithium battery.
 As a result of which even if the power of the system is turned off, the RTC clock keeps
running.
 It plays a very important role in the real time systems like digital clock, attendance
system, digital camera etc.
 In applications where time stamp is needed, RTC is a good option. Using RTC for
designing such application has always been a good designer’s choice although the
beginning might be a bit difficult.
 While designing any real time system which deals with time, there are two ways of
handling the time factor.
 One is to generate the time internally which is done by programming the timers of the
controller; and the other is to use an RTC.
 The following table shows the comparison of these methods while designing a real time
application.
S.No. Parameter Internal Timers RTC
1. Error High and keeps
increasing with time
Almost negligible. Of
the order of 1 sec in
100 years
2. Memory space usage High Low
3. CPU usage High Low
4. Ease of Interfacing Easy Difficult
5. Program complexity High Low
6. Efficiency of system Low High
7. Achieving goals of
the system
Difficult Easy
8. Cost Low High
DS12C887 is a commonlyusedRTCby DallasSemiconductors.Itcanbe easilyinterfacedwith8051
microcontroller(AT89C51).
Timer
Timer is a very common and useful peripheral. It is used to generate events at specific times or
measures the duration of specific events which are external to the processor. It is programmable
device, i.e. the time period can be adjusted by writing specific bit patterns to some of the
registers called timer-control registers.
Counter
A counter is a more general version of the timer. It is used to count events in the form of pulses
which is fed to it. Fig.1. shows the block diagram of a simple timer. This has a 16-bit up counter
which increments with each input clock pulse. Thus the output value Cnt represents the number
of pulses since the counter was last reset to zero. An additional output top indicates when the
terminal count has been reached. It may go high for a predetermined time as set by the
programmable control word inside the timer unit. The count can be loaded by the external
program.
1. Block diagram of a simple timer
Fig.2 provides the structure of another timer where a multiplexer is used to choose between an
internal clock or external clock. The mode bit when set or reset decided the selection. For
internal clock(Clk) it behaves like the timer in Fig.2. For the external count in (cnt_in) it just
counts the number of occurrences.
Fig.2
Fig.3 shows a timer with the terminal count. This can generate an event if a particular
Interval of time has been elapsed. The counter restarts after every terminal count.
Fig. 3Timer Count and Output.
Timing Diagram Notation Conventions
Timing notation is illustrated in Figure 4 below. The timing notation used in manufacturers’ data
sheets may vary from this notation but is usually very similar. It is also important to notice that
although the diagrams are reasonably standard, there is a wide variation in the selection of
symbols for each timing parameter.
The purpose of timing analysis is to determine the sequence of events in each of the bus cycles
so that we can delimit, among other things, the time available for each of the components to
respond to changes. This time is compared to the requirements as specified in the manufacturers’
data sheets to determine whether they are compatible and by what margin.The most important
timing specifications for interfacing components to a bus-oriented design are:
• Rise/fall time
• Propagation delay time
• Setup time
• Hold time
• Tri-state enable and disable delays
• Pulse width
• Clock frequency
There are two general classes of logic: combinatorial and sequential. Combinatorial logic has no
memory and its output is some logical function of its current inputs, after some delay. Examples
of combinatorial logic include gates, buffers, inverters, multiplexers, and decoders. Sequential
logic has memory, which means that its outputs are a function of both current and past inputs.
Examples of sequential logic are flip-flops, registers, microprocessors, and counters. There are
two types of sequential logic. Synchronous logic is synchronized to change only when there is a
clock transition. In contrast, asynchronous logic does not use a clock signal.
Almost all the logic used in a microcomputer design will either be unclocked asynchronous logic
(gates, decoders) or clocked synchronous logic (counter, latch or microprocessor). Some types of
devices are available in either form. Each of the timing specifications in the following discussion
is described using simple logic devices as they are typically used in embedded computer designs.
Rise and Fall Times
The rise time of a signal is usually defined as the time required for a logic signal voltage to
change from 20% to 80% of its final value. The fall time is from 80% to 20%, as shown
in Figure5 below. These times are also commonly defined by some manufacturers as the
transitions between the 10% and 90% levels.
Propagation Delays.
The propagation delay is the time it takes for a change at the input of a device to cause a change
at the output. All devices—even wires—exhibit some propagation delay. Some devices do not
have symmetrical delays for positive and negative transitions. In Figure 6 below, the propagation
times for a high to low transition are shorter than for a low to high transition.
Figure 6. Propagation delay
This asymmetrical delay is common for TTL and open collector and open drain outputs because
they are better at sinking current than sourcing it. Thus, the load capacitance is charged more
slowly when the current is being supplied from the weaker “high side” or pull-up device.
Propagation delays are usually measured from the 50% amplitude points, as shown in Figure 6
Task Modeling and management:
The goal of task modeling and management is to understand the requirements of embedded
software for application programming as well as for the operating system needs.
Tasks: An embedded system typically has many activities (or tasks) occurring in parallel.
l. A task represents an activity in the system.
2. Historically, one task represents one sequential thread of execution;
3. The principles of concurrency are fundamental regardless of the granularity of the concurrent
units (processes, tasks, or threads).
Concurrent tasking means structuring a system into concurrent tasks.
Tasks Categories:
1. Invocation
 Periodic (time-triggered)
 Aperiodic (event-triggered)
2. Creation
 Static
 Dynamic
3. Multi-Tasking System
 Preemptive: higher-priority process taking control of the processor from a lower-
priority
 Non-Preemptive: Each task can control the CPU for as long as it needs it.
Real-Time modeling Algorithms:
Task Modeling Issues:
Variations in the task models of concurrent programming languages are based on
1. structure
2. level of parallelism
3. granularity
4. initialization
5. termination
6. representation
Task Management:
A task can be in one of the states shown: l task creation n In general, all tasks should be created
before run time and remain dormant until needed. n This guarantees that the resource demands
will be known and that performance can be evaluated with respect to real-time deadlines. l Issues
related to tasks such as task structuring methods are covered in a companion course: ICS 213:
Software for Embedded Systems. Non existing Created Initializing Terminated Executing
Waiting dependent.
Real-Time Operating Systems:
Three groups
– Small, fast, proprietary kernels
– Real-time extensions to commercial operating systems
– Research operating systems
OperatingSystems Issuesfor Real-Time:
 Timing,SchedulingLatencies,andPreemption(example:Linux)
• SchedulingPolicies(example:Solaris)
• Device DriverArchitecturesforReal-Time (example:Windows)
• Integrationof Hard Real-Time andGeneral-PurposeOSArchitectures (example:
Windows/Linux)
 Realtime Response
 Recovering from Failures
 Working with Distributed Architectures
 Asynchronous Communication
 Race Conditions and Timing
UNIT-3
Signals:
A signal is a function representing a physical quantity, and typically it contains information
about the behavior or nature of the phenomenon. From a communication point of view a signal is
any function that carries some information.
Types of Signals:
1. Determinist and Random Signals:
The deterministic signal is a signal for which at any time instant t the value of x(t) are given as a
real or complex number. The deterministic signal can be described by mathematical expression,
diagram or look up table. For example, the exponential signal (10)t are deterministic
signals.x(t)=e-2t and x(t)=sin2.
2. Periodic and Non-periodic Signals:
A periodic signal is a signal x(t) that satisfies the property x(t) = x(t+kT0) or all t, and all
integers k. T0 is called the period of signal.
Frequency spectrum:
Sampling:
“A band limited signal can be reconstructed exactly if it is sampled at a rate atleast twice the
maximum frequency component in it.”
ADC:
An electronic integrated circuit which transforms a signal from analog (continuous) to digital
(discrete) form. Analog signals are directly measurable quantities. Digital signals only have two
states.
Why ADC is needed:
Microprocessors can only perform complex processing on digitized signals. When signals are in
digital form they are less susceptible to the deleterious effects of additive noise. ADC Provides
a link between the analog world of transducers and the digital world of signal processing and
data handling.
Application of ADC:
1. ADC is used virtually everywhere where an analog signal has to be processed,
stored, or transported in digital form.
2. Some examples of ADC usage are digital volt meters, cell phone,
thermocouples, and digital oscilloscope.
3. Microcontrollers commonly use 8, 10, 12, or 16 bit ADCs, our micro controller
uses an 8 or 10 bit ADC.
Accuracy of A/D Conversion:
There are two ways to best improve the accuracy of A/D conversion:
1. Increasing the resolution which improves the accuracy in measuring the amplitude of
the analog signal.
2. Increasing the sampling rate which increases the maximum frequency that can be
measured.
Types of A/D Converters:
1. Dual Slope A/D Converter
2. Successive Approximation A/D Converter
3. Flash A/D Converter
4. Delta-Sigma A/D Converter
Dual Slope A/D Converter:
Fundamental components
1. Integrator
2. Electronically Controlled Switches
3. Counter
4. Control Logic
5. Comparator
Working:
dual-slope ADC (DS-ADC) integrates an unknown input voltage (VIN) for a fixed amount of
time (TINT), then "de-integrates" (TDEINT) using a known reference voltage (VREF) for a
variable amount of time. The key advantage of this architecture over the single-slope is that the
final conversion result is insensitive to errors in the component values. That is, any error
introduced by a component value during the integrate cycle will be cancelled out during the de-
integrate phase.
.At t<0, S1 is set to ground, S2 is closed, and counter=0.
At t=0 a conversion begins and S2 is open, and S1 is set so the input to the integrator is Vin.
S1 is held for TINT which is a constant predetermined time interval.
When S1 is set the counter begins to count clock pulses, the counter resets to zero after TINT
Vout of integrator at t=TINT is VINTINT/RC is linearly proportional to VIN
At t=TINT S1 is set so -Vref is the input to the integrator which has the voltage VINTINT/RC
stored in it.
The integrator voltage then drops linearly with a slop -Vref/RC.
A comparator is used to determine when the output voltage of the integrator crosses zero
When it is zero the digitized output value is the n state of the counter.
Flash A/D Converter:
Fundamental Components (For N bit Flash A/D)
2N-1 Comparators
2N Resistors
Control Logic
Uses the 2N resistors to form a ladder voltage divider, which divides the reference voltage into
2N equal intervals.
1. Uses the 2N-1 comparators to determine in which of these 2N voltage intervals
the input voltage Vin lies.
2. The Combinational logic then translates the information provided by the output of
the comparators
3. This ADC does not require a clock so the conversion time is essentially set by the
settling time of the comparators and the propagation time of the combinational
logic.
PROS
1. Very Fast (Fastest)
2. Very simple operational theory
3. Speed is only limited by gate and comparator propagation delay
CONS
1. Expensive
2. Prone to produce glitches in the output
3. Each additional bit of resolution quires twice the comparators.
DAC:
A digital-to-analog converter (DAC or D-to-A) is a device for converting a digital (usually
binary) code to an analog signal (current, voltage or charges). Digital-to-Analog Converters are
the interface between the abstract digital world and the analog real life. Simple switches, a
network of resistors, current sources or capacitors may implement this conversion.
A DAC inputs a binary number and outputs an analog voltage or current signal. In block diagram
form, it looks like this:
DAC types:
 The Pulse Width Modulator the simplest DAC type. A stable current (electricity) or
voltage is switched into a low pass analog filter with a duration determined by the digital
input code. This technique is often used for electric motor speed control, and is now
becoming common in high-fidelity audio.
 Oversampling DACs such as the Delta-Sigma DAC, a pulse density conversion
technique. The oversampling technique allows for the use of a lower resolution DAC
internally. A simple 1-bit DAC is often chosen, as it is inherently linear. The DAC is
driven with a pulse density modulated signal, created through negative feedback. The
negative feedback will act as a high pass filter for the quantization (signal processing)
noise, thus pushing this noise out of the pass-band. Most very high resolution DACs
(greater than 16 bits) are of this type due to its high linearity and low cost. Speeds of
greater than 100 thousand samples per second and resolutions of 24 bits are attainable
with Delta-Sigma DACs. Simple first order Delta-Sigma modulators or higher order
topologies such as MASH - 'Multi stage' noise Shaping can be used to generate the pulse
density signal. Higher oversampling rates relax the specifications of the output Low-pass
filter and enable further suppression of quantization noise.
 The Binary Weighted DAC, which contains one resistor or current source for each bit of
the DAC connected to a summing point. These precise voltages or currents sum to the
correct output value. This is one of the fastest conversion methods but suffers from poor
accuracy because of the high precision required for each individual voltage or current.
Such high-precision resistors and current sources are expensive, so this type of converter
is usually limited to 8-bit resolution or less.
 The R2R Ladder DAC, which is a binary weighted DAC that creates each value with a
repeating structure of 2 resistor values, R and R times two. This improves DAC precision
due to the ease of producing many equal matched values of resistors or current sources,
but lowers conversion speed due to parasitic capacitance.
 The Segmented DAC, which contains an equal resistor or current source segment for
each possible value of DAC output. An 8-bit binary-segmented DAC would have 255
segments, and a 16-bit binary-segmented DAC would have 65,535 segments. This is
perhaps the fastest and highest precision DAC architecture but at the expense of high
cost. Conversion speeds of >1 billion samples per second have been reached with this
type of DAC.
 Hybrid DACs, which use a combination of the above techniques in a single converter.
Most DAC integrated circuits are of this type due to the difficulty of getting low cost,
high speed and high precision in one device.
Signal Conditioning and Processing:
Signal conditioning circuits are used to process the output signal from sensors of a measurement
system to be suitable for the next stage of operation.
The function of the signal conditioning circuits includes the following items:
 Signal amplification (op-amp),
 Filtering (op-amp),
 Interfacing with µP (ADC),
 Protection (Zener & photo isolation),
 Linearization,
 Current – voltage change circuits,
 resistance change circuits (Wheatstone bridge),
 error compensation
Signal Processing:
• Signal processing provides the tools for understanding sampling and reconstruction
• Sampling: How do we know how many pixels are required, and where to place them?
• Reconstruction: What happens when a monitor converts a set of points into a continuous?
How do we enlarge, reduce, rotate, smooth or enhance images?
Aliasing: How do we avoid jagged, pixelated lines?

Embedded system notes

  • 1.
    UNIT- 1 System Definition: Away of working, organizing or performing one or many tasks according to a fixed set of rules, program or plan. Also an arrangement in which all units assemble and work together according to a program or plan. Time display system – A watch Automatic cloth washing system – A washing machine Embedded System Definitions: An embedded system is a system that has software embedded into computer-hardware, which makes a system dedicated for an application (s) or specific part of an application or product or part of a larger system.” An embedded system is one that has dedicated purpose software embedded in computer hardware. It is any device that includes a programmable computer but is not itself intended to be a general purpose computer. Embedded Systems are the electronic systems that contain a microprocessor or a microcontroller, but we do not think of them as computers – the computer is hidden or embedded in the system.” An embedded system is an electronic system that has a software and is embedded in computer hardware. It is programmable or non- programmable depending on the application. An Embedded system is defined as a way of working, organizing, performing single or multiple tasks according to a set of rules. In an embedded system, all the units assemble and work together according to the program. Examples of embedded systems include numerous products such as microwave ovens, washing machine, printers, automobiles, cameras, etc. These systems use microprocessors, microcontrollers as well as processors like DSPs. This article gives an overview of what is an embedded system and types of embedded system.
  • 2.
    The Components ofEmbedded System: Processor The main part of an embedded system is the processor, which could also be a generic microprocessor or a microcontroller and programmed to perform the specific tasks for which the integrated system has been designed. Memory: Electronic memory is an important part of embedded systems and three essential types of memory can be described: RAM, or random access memory, ROM, or read only memory, and Cache. The RAM is one of the hardware components where data are temporarily stored during execution of the system. The ROM contains input output routines that are needed for the system at boot time. The cache, instead, is used by the processor as a temporary storage during the processing and transferring of data. System Clock The system clock is used for all processes is running on an embedded system and requires precise timing information. This clock is generally composed of an oscillator and some associated digital circuitry. Peripherals:
  • 3.
    The peripheral devicesare provided on the embedded system boards for an easy integration. Typical devices include serial port, parallel port, network port, keyboard and mouse ports, a memory unit port and monitor port. Some specialized embedded systems also have other ports such as CAN-bus. Classification of Embedded Systems: Embedded systems can be classified into different types based on performance, functional requirements and performance of the microcontroller. Embedded systems are classified into four categories based on their performance and functional requirements:  Stand alone embedded systems  Real time embedded systems  Networked embedded systems  Mobile embedded systems Embedded Systems are classified into three types based on the performance of the microcontroller such as  Small scale embedded systems  Medium scale embedded systems  Sophisticated embedded systems Stand Alone Embedded Systems 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-Which either controls,drives and displays the connected devices. Examples for the stand alone embedded systems are mp3
  • 4.
    players, digital cameras,video game consoles, microwave ovens and temperature measurement systems. Real Time Embedded Systems A real time embedded system is defined as, a system which gives a required o/p in a particular time.These types of embedded systems follow the time deadlines for completion of a task. Real time embedded systems are classified into two types such as soft and hard real time systems. Networked Embedded Systems These types of embedded systems are related to a network to access the resources. The connected network can be LAN, WAN or the internet. The connection can be any wired or wireless. This type of embedded system is the fastest growing area in embedded system applications. The embedded web server is a type of system wherein all embedded devices are connected to a web server and accessed and controlled by a web browser. Example for the LAN networked embedded system is a home security system wherein all sensors are connected and run on the protocol TCP/IP Mobile Embedded Systems 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 the other resources and limitation of memory. Small Scale Embedded Systems These types of embedded systems are designed with a single 8 or 16-bit microcontroller, that may even be activated by a battery. For developing embedded software for small scale embedded systems, the main programming tools are an editor, assembler, cross assembler and integrated development environment (IDE). Medium Scale Embedded Systems These types of embedded systems design with a single or 16 or 32 bit microcontroller, RISCs or DSPs. These types of embedded systems have both hardware and software complexities. For developing embedded software for medium scale embedded systems, the main programming tools are C, C++, JAVA, Visual C++, RTOS, debugger, source code engineering tool, simulator and IDE. Sophisticated Embedded Systems These types of embedded systems have enormous hardware and software complexities, that may need ASIPs, IPs, PLAs, scalable or configurable processors. They are used for cutting-edge applications that need hardware and software Co-design and components which have to assemble in the final system.
  • 5.
    Characteristics of EmbeddedSystem: Most embedded systems are designed to perform a continued action at a low cost. Most of these systems also have constraints on the performance in terms of hardware and software, such as require operating in real time when a system needs high sped while executing some functions, but may tolerate lower speed for other activities. It is difficult to characterize the speed or the cost of a generic embedded system, especially for systems that have to process a large quantity of data. Typical characteristics of embedded systems can be the following: 1. Processing: ability to process the analog/digital signals. 2. Communication: ability to transfer signals (“Information”) from/to the outside world. 3. Storage: the ability to preserve the temporary information within the embedded system. 4. Each specific application made by an embedded system has different requirements for processing, power supply, storage and communication. 5. Final Cost: The cost of the final product is a very important parameter for the design choices. 6. Time to market: in the design of an embedded system must always keep in mind the timing you want the product listed on the market; taking too long to design a device means that it’s difficult to overcome the fast changes in the market. 7. Life time: Another important factor is the expected lifetime for the product; which can vary from a few days to several years or decades. 8. Communication interfaces: typically the sale price of an embedded system is low, the choice of communication interfaces is critical because it greatly affects the final price of the product. 9. User Interface: In many embedded systems the user interface consists of a few buttons and/or LEDs; in others, it uses the user interface of a host system. 10. Power management: is a crucial factor to be considered for all embedded systems are powered by batteries. 11. Dimensions and weight: in many cases, the physical characteristics are another critical factor; usually the embedded system must be small, very light or with a particular form (for example, very thin). 12. Code size: the storage capacity of embedded systems is limited, so the size of the internal program (e.g. firmware) is a important factor. 13. Reliability: realistic assessment of the probability that the system fails. 14. Maintainability: the system can be repaired or replaced within a certain time interval. 15. Availability: probability that the system is working; essentially depends on the reliability and maintainability. 16. Safety: properties related to the possibility that in the event of system failure are caused damages to people or things.
  • 6.
    Embedded systems requirements: 1.Dedicated functions 2. Dedicated complex algorithms 3. Dedicated (GUIs) and other user interfaces for the application 4. Real time operations. 5. Multi-rate operations. 6. Software requirements analysis. 7. Requirements and software architecture design. 8. Requirements and detailed software design. 9. Requirements and software coding. 10. Requirements and software testing. 11. Requirements change management. 12. Impact analysis. 13. Change management tools. 14. Requirements tracing. 15. Consistency management. Constraints of an Embedded System Design: 1. Available system-memory 2. Available processor speed 3. Limited power dissipation when running the system continuously in cycles of the system start, wait for event, wake-up and run, sleep and stop. 4. Performance, 5. power, 6. size, 7. non-recurring design cost, 8. manufacturing costs. Applications of Embedded Systems: Embedded systems are used in different applications like automobiles, telecommunications, smart cards, missiles, satellites, computer networking and digital consumer electronics. 1. Embedded Systems in Automobiles and in telecommunications  Motor and cruise control system  Body or Engine safety  Entertainment and multimedia in car  E-Com and Mobile access  Robotics in assembly line  Wireless communication  Mobile computing and networking 2. Embedded Systems in Smart Cards, Missiles and Satellites  Security systems  Telephone and banking
  • 7.
     Defense andaerospace  Communication 3. Embedded Systems in Peripherals & Computer Networking  Displays and Monitors  Networking Systems  Image Processing  Network cards and printers 4. Embedded Systems in Consumer Electronics  Digital Cameras  Set top Boxes  High Definition TVs  DVDs
  • 8.
    UNIT – 2 Timingand clocks in embedded systems: Counter/timer hardware is a crucial component of most embedded systems. In some cases, a timer measures elapsed time (counting processor clock ticks). In others, we want to count or time external events. The names counter and timer can be used interchangeably when talking about the hardware. The difference in terminology has more to do with how the hardware is used in a given application. Figure 1: A simple counter/timer Semi-automatic A timer with automatic reload capability will have a latch register to hold the count written by the processor. When the processor writes to the latch, the count register is written as well. When the timer later overflows, it first generates an output signal. Then, it automatically reloads the contents of the latch into the count register. Since the latch still holds the value written by the processor, the counter will begin counting again from the same initial value. Input capture An input capture timer, like the one shown in Figure 2, has a latch connected to the timer's count register. The timer is run at a constant clock rate (usually a derivative of the processor clock), so that the count registers is constantly incrementing (or decrementing, for a down counter). An external signal latches the value of the free-running timer into the processor-visible register and generates an output signal (typically an interrupt). Figure 2: An input capture timer
  • 9.
    Real Time Clock(RTC) A clock, which is based on the interrupts at preset intervals. An interrupt service routine executes on each timeout (overflow) of this clock. This timing device once started never resets or never reloaded with another value. Once it is set, it is not modified later.  A real time clock (RTC) provides the system clock to generate the system interrupts  An interrupt service routine executes on each tick (timeout or overflow) of this clock.  This timing device once started is generally never reset or never reloaded to another value. The purpose of an RTC or a real time clock is to provide precise time and date which can be used for various applications.  RTC is an electronic device in the form of an Integrated Chip (IC) available in various packaging options.  It is powered by an internal lithium battery.  As a result of which even if the power of the system is turned off, the RTC clock keeps running.  It plays a very important role in the real time systems like digital clock, attendance system, digital camera etc.  In applications where time stamp is needed, RTC is a good option. Using RTC for designing such application has always been a good designer’s choice although the beginning might be a bit difficult.  While designing any real time system which deals with time, there are two ways of handling the time factor.  One is to generate the time internally which is done by programming the timers of the controller; and the other is to use an RTC.  The following table shows the comparison of these methods while designing a real time application. S.No. Parameter Internal Timers RTC 1. Error High and keeps increasing with time Almost negligible. Of the order of 1 sec in 100 years 2. Memory space usage High Low 3. CPU usage High Low 4. Ease of Interfacing Easy Difficult 5. Program complexity High Low 6. Efficiency of system Low High 7. Achieving goals of the system Difficult Easy 8. Cost Low High
  • 10.
    DS12C887 is acommonlyusedRTCby DallasSemiconductors.Itcanbe easilyinterfacedwith8051 microcontroller(AT89C51). Timer Timer is a very common and useful peripheral. It is used to generate events at specific times or measures the duration of specific events which are external to the processor. It is programmable device, i.e. the time period can be adjusted by writing specific bit patterns to some of the registers called timer-control registers. Counter A counter is a more general version of the timer. It is used to count events in the form of pulses which is fed to it. Fig.1. shows the block diagram of a simple timer. This has a 16-bit up counter which increments with each input clock pulse. Thus the output value Cnt represents the number of pulses since the counter was last reset to zero. An additional output top indicates when the terminal count has been reached. It may go high for a predetermined time as set by the programmable control word inside the timer unit. The count can be loaded by the external program. 1. Block diagram of a simple timer Fig.2 provides the structure of another timer where a multiplexer is used to choose between an internal clock or external clock. The mode bit when set or reset decided the selection. For internal clock(Clk) it behaves like the timer in Fig.2. For the external count in (cnt_in) it just counts the number of occurrences. Fig.2
  • 11.
    Fig.3 shows atimer with the terminal count. This can generate an event if a particular Interval of time has been elapsed. The counter restarts after every terminal count. Fig. 3Timer Count and Output. Timing Diagram Notation Conventions Timing notation is illustrated in Figure 4 below. The timing notation used in manufacturers’ data sheets may vary from this notation but is usually very similar. It is also important to notice that although the diagrams are reasonably standard, there is a wide variation in the selection of symbols for each timing parameter.
  • 12.
    The purpose oftiming analysis is to determine the sequence of events in each of the bus cycles so that we can delimit, among other things, the time available for each of the components to respond to changes. This time is compared to the requirements as specified in the manufacturers’ data sheets to determine whether they are compatible and by what margin.The most important timing specifications for interfacing components to a bus-oriented design are: • Rise/fall time • Propagation delay time • Setup time • Hold time • Tri-state enable and disable delays • Pulse width • Clock frequency There are two general classes of logic: combinatorial and sequential. Combinatorial logic has no memory and its output is some logical function of its current inputs, after some delay. Examples of combinatorial logic include gates, buffers, inverters, multiplexers, and decoders. Sequential logic has memory, which means that its outputs are a function of both current and past inputs. Examples of sequential logic are flip-flops, registers, microprocessors, and counters. There are two types of sequential logic. Synchronous logic is synchronized to change only when there is a clock transition. In contrast, asynchronous logic does not use a clock signal. Almost all the logic used in a microcomputer design will either be unclocked asynchronous logic (gates, decoders) or clocked synchronous logic (counter, latch or microprocessor). Some types of devices are available in either form. Each of the timing specifications in the following discussion is described using simple logic devices as they are typically used in embedded computer designs.
  • 13.
    Rise and FallTimes The rise time of a signal is usually defined as the time required for a logic signal voltage to change from 20% to 80% of its final value. The fall time is from 80% to 20%, as shown in Figure5 below. These times are also commonly defined by some manufacturers as the transitions between the 10% and 90% levels. Propagation Delays. The propagation delay is the time it takes for a change at the input of a device to cause a change at the output. All devices—even wires—exhibit some propagation delay. Some devices do not have symmetrical delays for positive and negative transitions. In Figure 6 below, the propagation times for a high to low transition are shorter than for a low to high transition. Figure 6. Propagation delay This asymmetrical delay is common for TTL and open collector and open drain outputs because they are better at sinking current than sourcing it. Thus, the load capacitance is charged more slowly when the current is being supplied from the weaker “high side” or pull-up device. Propagation delays are usually measured from the 50% amplitude points, as shown in Figure 6 Task Modeling and management: The goal of task modeling and management is to understand the requirements of embedded software for application programming as well as for the operating system needs. Tasks: An embedded system typically has many activities (or tasks) occurring in parallel. l. A task represents an activity in the system. 2. Historically, one task represents one sequential thread of execution;
  • 14.
    3. The principlesof concurrency are fundamental regardless of the granularity of the concurrent units (processes, tasks, or threads). Concurrent tasking means structuring a system into concurrent tasks. Tasks Categories: 1. Invocation  Periodic (time-triggered)  Aperiodic (event-triggered) 2. Creation  Static  Dynamic 3. Multi-Tasking System  Preemptive: higher-priority process taking control of the processor from a lower- priority  Non-Preemptive: Each task can control the CPU for as long as it needs it. Real-Time modeling Algorithms: Task Modeling Issues: Variations in the task models of concurrent programming languages are based on 1. structure 2. level of parallelism 3. granularity 4. initialization
  • 15.
    5. termination 6. representation TaskManagement: A task can be in one of the states shown: l task creation n In general, all tasks should be created before run time and remain dormant until needed. n This guarantees that the resource demands will be known and that performance can be evaluated with respect to real-time deadlines. l Issues related to tasks such as task structuring methods are covered in a companion course: ICS 213: Software for Embedded Systems. Non existing Created Initializing Terminated Executing Waiting dependent. Real-Time Operating Systems: Three groups – Small, fast, proprietary kernels – Real-time extensions to commercial operating systems – Research operating systems OperatingSystems Issuesfor Real-Time:  Timing,SchedulingLatencies,andPreemption(example:Linux) • SchedulingPolicies(example:Solaris) • Device DriverArchitecturesforReal-Time (example:Windows) • Integrationof Hard Real-Time andGeneral-PurposeOSArchitectures (example: Windows/Linux)  Realtime Response  Recovering from Failures  Working with Distributed Architectures  Asynchronous Communication  Race Conditions and Timing
  • 16.
    UNIT-3 Signals: A signal isa function representing a physical quantity, and typically it contains information about the behavior or nature of the phenomenon. From a communication point of view a signal is any function that carries some information. Types of Signals: 1. Determinist and Random Signals: The deterministic signal is a signal for which at any time instant t the value of x(t) are given as a real or complex number. The deterministic signal can be described by mathematical expression, diagram or look up table. For example, the exponential signal (10)t are deterministic signals.x(t)=e-2t and x(t)=sin2. 2. Periodic and Non-periodic Signals: A periodic signal is a signal x(t) that satisfies the property x(t) = x(t+kT0) or all t, and all integers k. T0 is called the period of signal. Frequency spectrum: Sampling: “A band limited signal can be reconstructed exactly if it is sampled at a rate atleast twice the maximum frequency component in it.” ADC: An electronic integrated circuit which transforms a signal from analog (continuous) to digital (discrete) form. Analog signals are directly measurable quantities. Digital signals only have two states. Why ADC is needed: Microprocessors can only perform complex processing on digitized signals. When signals are in digital form they are less susceptible to the deleterious effects of additive noise. ADC Provides a link between the analog world of transducers and the digital world of signal processing and data handling.
  • 17.
    Application of ADC: 1.ADC is used virtually everywhere where an analog signal has to be processed, stored, or transported in digital form. 2. Some examples of ADC usage are digital volt meters, cell phone, thermocouples, and digital oscilloscope. 3. Microcontrollers commonly use 8, 10, 12, or 16 bit ADCs, our micro controller uses an 8 or 10 bit ADC. Accuracy of A/D Conversion: There are two ways to best improve the accuracy of A/D conversion: 1. Increasing the resolution which improves the accuracy in measuring the amplitude of the analog signal. 2. Increasing the sampling rate which increases the maximum frequency that can be measured. Types of A/D Converters: 1. Dual Slope A/D Converter 2. Successive Approximation A/D Converter 3. Flash A/D Converter 4. Delta-Sigma A/D Converter Dual Slope A/D Converter: Fundamental components 1. Integrator 2. Electronically Controlled Switches 3. Counter 4. Control Logic 5. Comparator
  • 18.
    Working: dual-slope ADC (DS-ADC)integrates an unknown input voltage (VIN) for a fixed amount of time (TINT), then "de-integrates" (TDEINT) using a known reference voltage (VREF) for a variable amount of time. The key advantage of this architecture over the single-slope is that the final conversion result is insensitive to errors in the component values. That is, any error introduced by a component value during the integrate cycle will be cancelled out during the de- integrate phase. .At t<0, S1 is set to ground, S2 is closed, and counter=0. At t=0 a conversion begins and S2 is open, and S1 is set so the input to the integrator is Vin. S1 is held for TINT which is a constant predetermined time interval. When S1 is set the counter begins to count clock pulses, the counter resets to zero after TINT Vout of integrator at t=TINT is VINTINT/RC is linearly proportional to VIN At t=TINT S1 is set so -Vref is the input to the integrator which has the voltage VINTINT/RC stored in it. The integrator voltage then drops linearly with a slop -Vref/RC. A comparator is used to determine when the output voltage of the integrator crosses zero When it is zero the digitized output value is the n state of the counter.
  • 19.
    Flash A/D Converter: FundamentalComponents (For N bit Flash A/D) 2N-1 Comparators 2N Resistors Control Logic
  • 20.
    Uses the 2Nresistors to form a ladder voltage divider, which divides the reference voltage into 2N equal intervals. 1. Uses the 2N-1 comparators to determine in which of these 2N voltage intervals the input voltage Vin lies. 2. The Combinational logic then translates the information provided by the output of the comparators 3. This ADC does not require a clock so the conversion time is essentially set by the settling time of the comparators and the propagation time of the combinational logic. PROS 1. Very Fast (Fastest) 2. Very simple operational theory 3. Speed is only limited by gate and comparator propagation delay CONS 1. Expensive 2. Prone to produce glitches in the output 3. Each additional bit of resolution quires twice the comparators. DAC: A digital-to-analog converter (DAC or D-to-A) is a device for converting a digital (usually binary) code to an analog signal (current, voltage or charges). Digital-to-Analog Converters are the interface between the abstract digital world and the analog real life. Simple switches, a network of resistors, current sources or capacitors may implement this conversion. A DAC inputs a binary number and outputs an analog voltage or current signal. In block diagram form, it looks like this: DAC types:  The Pulse Width Modulator the simplest DAC type. A stable current (electricity) or voltage is switched into a low pass analog filter with a duration determined by the digital input code. This technique is often used for electric motor speed control, and is now becoming common in high-fidelity audio.  Oversampling DACs such as the Delta-Sigma DAC, a pulse density conversion technique. The oversampling technique allows for the use of a lower resolution DAC internally. A simple 1-bit DAC is often chosen, as it is inherently linear. The DAC is driven with a pulse density modulated signal, created through negative feedback. The negative feedback will act as a high pass filter for the quantization (signal processing) noise, thus pushing this noise out of the pass-band. Most very high resolution DACs (greater than 16 bits) are of this type due to its high linearity and low cost. Speeds of greater than 100 thousand samples per second and resolutions of 24 bits are attainable with Delta-Sigma DACs. Simple first order Delta-Sigma modulators or higher order topologies such as MASH - 'Multi stage' noise Shaping can be used to generate the pulse density signal. Higher oversampling rates relax the specifications of the output Low-pass filter and enable further suppression of quantization noise.
  • 21.
     The BinaryWeighted DAC, which contains one resistor or current source for each bit of the DAC connected to a summing point. These precise voltages or currents sum to the correct output value. This is one of the fastest conversion methods but suffers from poor accuracy because of the high precision required for each individual voltage or current. Such high-precision resistors and current sources are expensive, so this type of converter is usually limited to 8-bit resolution or less.  The R2R Ladder DAC, which is a binary weighted DAC that creates each value with a repeating structure of 2 resistor values, R and R times two. This improves DAC precision due to the ease of producing many equal matched values of resistors or current sources, but lowers conversion speed due to parasitic capacitance.  The Segmented DAC, which contains an equal resistor or current source segment for each possible value of DAC output. An 8-bit binary-segmented DAC would have 255 segments, and a 16-bit binary-segmented DAC would have 65,535 segments. This is perhaps the fastest and highest precision DAC architecture but at the expense of high cost. Conversion speeds of >1 billion samples per second have been reached with this type of DAC.  Hybrid DACs, which use a combination of the above techniques in a single converter. Most DAC integrated circuits are of this type due to the difficulty of getting low cost, high speed and high precision in one device. Signal Conditioning and Processing: Signal conditioning circuits are used to process the output signal from sensors of a measurement system to be suitable for the next stage of operation. The function of the signal conditioning circuits includes the following items:  Signal amplification (op-amp),  Filtering (op-amp),  Interfacing with µP (ADC),  Protection (Zener & photo isolation),  Linearization,  Current – voltage change circuits,  resistance change circuits (Wheatstone bridge),  error compensation Signal Processing: • Signal processing provides the tools for understanding sampling and reconstruction • Sampling: How do we know how many pixels are required, and where to place them? • Reconstruction: What happens when a monitor converts a set of points into a continuous? How do we enlarge, reduce, rotate, smooth or enhance images? Aliasing: How do we avoid jagged, pixelated lines?