Unit 5 Merged
Unit 5 Merged
Chapter 4
Signal Conditioning
4.1 Introduction
The first component of a measurement system is the sensor that converts the physical variable to
be measured into an electrical quantity. However, the signal is usually in a format that cannot be
directly used: it requires ‘conditioning’.
Hence the second part of any measurement system is the signal conditioning component that
converts the electrical signal from an unsuitable format to a suitable format. Signal processing
further modifies the signal to prepare it for transmission.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 1 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
Signal conditioning element takes the output of the sensing element and converts it into a form
more suitable for further processing, usually a d.c. voltage, d.c. current or frequency signal.
Examples are:
Signal processing is concerned with improving the quality of the reading or signal at the output
of a measurement system, and one particular aim is to attenuate any noise in the measurement
signal that has not been eliminated by careful design of the measurement. However, signal
processing performs many other functions apart from dealing with noise, and the exact
procedures that are applied depend on the nature of the raw output signal from a measurement
transducer. Procedures of signal filtering, signal amplification, signal attenuation, signal
linearization and bias removal are applied according to the form of correction required in the raw
signal.
Traditionally, signal processing has been carried out by analogue techniques in the past, using
various types of electronic circuit. However, the ready availability of digital computers in recent
years has meant that signal processing has increasingly been carried out digitally, using software
modules to condition the input measurement data.
Digital signal processing is inherently more accurate than analogue techniques, but this
advantage is greatly reduced in the case of measurements coming from analogue sensors and
transducers, because an analogue-to-digital conversion stage is necessary before the digital
processing can be applied, thereby introducing conversion errors. Also, analogue processing
remains the faster of the two alternatives in spite of recent advances in the speed of digital signal
processing. Hence, both analogue and digital processing are considered in this chapter, with
analogue processing being considered first because some preliminary analogue processing is
often carried out even when the major part of the processing is carried out digitally.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 2 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
Regardless of the types of sensors or transducers you are using, the proper signal conditioning
equipment can improve the quality and performance of your system.
4.2.1 Amplification
Amplifiers are necessary in order to amplify low-level signals, e.g. thermocouple or strain gauge
bridge output voltages, to a level which enables them to be further processed. Because real-world
signals are often very small in magnitude, signal conditioning can improve the accuracy of your
data. Amplifiers increase the level of the input signal to better match the range of the analog-to-
digital converter (ADC), thus increasing the resolution and sensitivity of the measurement. While
many data acquisition (DAQ) devices include onboard amplifiers for this reason, many
transducers, such a thermocouples, require additional amplification.
In addition, using external signal conditioners located closer to the signal source, or transducer,
improves the signal-to-noise ratio of the measurement by boosting the signal level before it is
affected by environmental noise.
The operational amplifier can be regarded as the basic building block for modern amplifiers. It is
a high gain, integrated circuit amplifier designed to amplify signals from d.c. up to many kHz. It
is not normally used by itself but with external feedback networks to produce precise transfer
characteristics which depend almost entirely on the feedback network. Usually there are two
input terminals and one output terminal, the voltage at the output terminal being proportional to
the difference between the voltages at the input terminals.
Figure 4.2 shows a common amplifier configuration that is used to amplify the small difference
that may exist between two voltage signals V A and V B . The output voltage V 0 is given by:
R3
V0 = (VB − VA )
R1
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 3 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
4.2.2 Attenuation
Attenuation is the opposite of amplification. It is necessary when the voltages to be digitized are
beyond the input range of the digitizer. This form of signal conditioning diminishes the
amplitude of the input signal so that the conditioned signal is within range of the ADC.
Attenuation is necessary for measuring high voltages (more than 10 V).
xVi
V0 =
L
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 4 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
4.2.3 Isolation
Improper grounding of the system is one of the most common causes for measurement problems,
including noise and damaged measurement devices. Signal conditioners with isolation can
prevent most of these problems. Such devices pass the signal from its source to the measurement
device without a physical connection by using transformer, optical, or capacitive coupling
techniques. Besides breaking ground loops, isolation blocks high-voltage surges and rejects high
common-mode voltage and thus protects both the operators and expensive measurement
equipment.
4.2.4 Filtering
Signal filtering consists of processing a signal to remove a certain band of frequencies within it.
The band of frequencies removed can be either at the low-frequency end of the frequency
spectrum, at the high-frequency end, at both ends, or in the middle of the spectrum. Filters to
perform each of these operations are known respectively as low-pass filters, high-pass filters,
band-pass filters and band-stop filters (also known as notch filters). All such filtering operations
can be carried out by either analogue or digital methods.
The result of filtering can be readily understood if the analogy with a procedure such as sieving
soil particles is considered. Suppose that a sample of soil A is passed through a system of two
sieves of differing meshes such that the soil is divided into three parts, B, C and D, consisting of
large, medium and small particles, as shown in Figure 4.4. Suppose that the system also has a
mechanism for delivering one or more of the separated parts, B, C and D, as the system output. If
the graded soil output consists of parts C and D, the system is behaving as a low-pass filter
(rejecting large particles), whereas if it consists of parts B and C, the system is behaving as a
highpass filter (rejecting small particles). Other options are to deliver just part C (band-pass filter
mode) or parts B and D together (band-stop filter mode). As any gardener knows, however, such
perfect sieving is not achieved in practice and any form of graded soil output always contains a
few particles of the wrong size.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 5 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
Signal filtering consists of selectively passing or rejecting low-, medium- and high frequency
signals from the frequency spectrum of a general signal. The range of frequencies passed by a
filter is known as the pass-band, the range not passed is known as the stop-band, and the
boundary between the two ranges is known as the cut-off frequency. To illustrate this, consider a
signal whose frequency spectrum is such that all frequency components in the frequency range
from zero to infinity have equal magnitude. If this signal is applied to an ideal filter, then the
outputs for a lowpass filter, high-pass filter, band-pass filter and band-stop filter respectively are
shown in Figure 4.4. Note that for the latter two types, the bands are defined by a pair of
frequencies rather than by a single cut-off frequency.
Just as in the case of the soil sieving analogy presented above, the signal filtering mechanism is
not perfect, with unwanted frequency components not being erased completely but only
attenuated by varying degrees instead, i.e. the filtered signal always retains some components (of
a relatively low magnitude) in the unwanted frequency range. There is also a small amount of
attenuation of frequencies within the pass-band that increases as the cut-off frequency is
approached. Figure 4.5 shows the typical output characteristics of a practical constant-k
(‘Constant-k’ is a term used to describe a common class of passive filters) filter designed
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 6 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
respectively for high-pass, low-pass, band-pass and band-stop filtering. Filter design is
concerned with trying to obtain frequency rejection characteristics that are as close to the ideal as
possible. However, improvement in characteristics is only achieved at the expense of greater
complexity in the design. The filter chosen for any given situation is therefore a compromise
between performance, complexity and cost.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 7 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
4.2.5 Excitation
Excitation is required for many types of transducers. For example, strain gages, accelerometers
thermistors, and resistance temperature detectors (RTDs) require external voltage or current
excitation. RTD and thermistor measurements are usually made with a current source that
converts the variation in resistance to a measurable voltage. Accelerometers often have an
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 8 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
integrated amplifier, which requires a current excitation provided by the measurement device.
Strain gages, which are very-low-resistance devices, typically are used in a Wheatstone bridge
configuration with a voltage excitation source.
4.2.6 Linearization
Linearization is necessary when sensors produce voltage signals that are not linearly related to
the physical measurement. Linearization is the process of interpreting the signal from the sensor
and can be done either with signal conditioning or through software. Thermocouples are the
classic example of a sensor that requires linearization.
Thermocouples
The most popular transducer for measuring temperature is the thermocouple. The thermocouple
is an inexpensive, rugged device that can operate over a very wide range of temperatures.
However, the thermocouple has unique signal conditioning requirements.
A thermocouple operates on the principle that the junction of two dissimilar metals generates a
voltage that varies with temperature. Measuring this voltage is difficult because connecting the
thermocouple to the terminals of a DAQ board creates what is called the reference junction or
cold junction, shown in Figure 4.2. These additional junctions act as thermocouples themselves
and produce their own voltages. Thus, the final measured voltage, V MEAS , includes both the
thermocouple and cold junction voltages. The method used to compensate for these unwanted
cold-junction voltages is called cold-junction compensation.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 9 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
Cold-junction compensation in software, on the other hand, is very flexible and requires only
knowing the ambient temperature. If you use an additional sensor to directly measure the
ambient temperature at the cold junction, you can compute the appropriate compensation for the
unwanted thermoelectric voltages. This approach is why many signal conditioning accessories
are equipped with direct-reading temperature sensors, such as thermistors or semiconductor
sensors. Software cold-junction compensation follows this process:
1. Measure the temperature of the reference junction and compute the equivalent
thermocouple voltage for this junction using standard thermocouple tables or
polynomials.
2. Measure the output voltage (V MEAS ) and add – not subtract – the reference-junction
voltage computed in Step 1.
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 10 of 11
Instrumentation & Measurement _____________________________________________________ _ AAiT
_____________________________________________________________________________________
Compiled by Yidnekachew M. Page 11 of 11
www.learnabout-electronics.org Amplifiers Module 1
Video Amplifiers
Video amplifiers are a special type of wide band amplifier that also preserve the DC level of the
signal and are used specifically for signals that are to be applied to CRTs or other video equipment.
The video signal carries all the picture information in TV, video and radar systems. The bandwidth
of video amplifiers depends on use. In TV receivers it extends from 0Hz (DC) to 6MHz and is
wider still in radar.
Buffer Amplifiers
Buffer amplifiers are a commonly encountered, specialised amplifier type that can be found within
any of the above categories, they are placed between two other circuits to prevent the operation of
one circuit affecting the operation of the other. (They ISOLATE the circuits from each other). Often
buffer amplifiers have a gain of one, i.e. they do not actually amplify, so that their output is the
same amplitude as their input, but buffer amplifiers have a very high input impedance and a low
output impedance and can therefore be used as an impedance matching device. This ensures that
signals are not attenuated between circuits, as happens when a circuit with a high output impedance
feeds a signal directly to another circuit having a low input impedance.
Operational Amplifiers
Operational amplifiers (Op-amps) have developed from circuits designed for the early analogue
computers where they were used for mathematical operations such as adding and subtracting. Today
they are widely used in integrated circuit form where they are available in single or multiple
amplifier packages and often incorporated into complex integrated circuits for specific applications.
The design is based on a differential amplifier, which
has two inputs instead of one, and produces an output
that is proportional to the difference between the two
inputs. Without negative feedback, op amps have an
extremely high gain, typically in the hundreds of
thousands. Applying negative feedback increases the
op amp’s bandwidth so they can operate as wideband
amplifiers with a bandwidth in the MHz range, but
reduces their gain. A simple resistor network can apply
such feedback externally and other external networks
can vary the function of op-amps.
Module 1.1
Amplifier Parameters
What you’ll learn in Module 1.1. Amplifier Parameters
Any amplifier is said to have certain parameters. These
After studying this section, you are the particular properties that make the amplifier
should be able to: perform in a certain way, and so make it suitable for a
Describe typical amplifier parameters. given task. Typical amplifier parameters are described
below.
• Gain.
Gain
• Frequency response.
The gain of an amplifier is a measure of the
• Bandwidth.
"Amplification" of an amplifier, i.e. how much it
• Input impedance. increases the amplitude of a signal. More precisely it is
the ratio of the output signal amplitude to the input
• Output impedance. signal amplitude, and is given the symbol "A". It can be
• Phase shift. calculated for voltage (Av), current (Ai) or power (Ap),
When the subscript letter after the A is in lower case
• Feedback. this refers to small signal conditions, and when the
subscript is in capitals it refers to DC conditions. The
gain or amplification for the three differnt types of amplifiers can be described using the appropriate
formula:
Voltage gain Av = Amplitude of output voltage ÷ Amplitude of input voltage.
The gain of an amplifier is governed, not only by the components (transistors etc.) used, but also by
the way they are interconnected within the amplifier circuit.
Frequency Response
Amplifiers do not have the same gain at all frequencies. For example, an amplifier designed for
audio frequency amplification will amplify signals with a frequency of less than about 20kHz but
will not amplify signals having higher frequencies. An amplifier designed for radio frequencies will
amplify a band of frequencies above about 100kHz but will not amplify the lower frequency audio
signals. In each case the amplifier has a particular frequency response, being a band of frequencies
where it provides adequate amplification, and excluding frequencies above and below this band,
where the amplification is less than adequate.
AMPLIFIERS MODULE 01.PDF 6 E. COATES 2007 -2021
www.learnabout-electronics.org Amplifiers Module 1
To show how the gain of an amplifier varies with frequency, a graph, showing the frequency
response of the amplifier is used. Fig. 1.1.1a shows the typical frequency response curve of an audio
amplifier, and Fig. 1.1.1b, that of a RF amplifier. In such graphs, it is common that very large
values may be encountered for both gain and frequency. For this reason it is usual for both the
frequency and gain axes of the graph to use logarithmic scales. It can be seen from Fig. 1.1.1a that
scales on the (horizontal) x-axis do not increase in a linear manner; each equal division represents a
tenfold increase in the frequency plotted. This ensures that a very wide range of frequency can be
plotted on a single graph. The (vertical) y-axis uses linear divisions but logarithmic units (deciBels
dB). The curve of the graph shows how gain, measured in deciBels, varies with frequency.
Comparing Figs. 1.1.1a and b drawn in this manner, shows how each type of amplifier (audio, RF
etc) has its own characteristic shape of frequency response curve. An amplifier which has a very
narrow, sharply peaked response curve is said to be very "selective". This is typical of an RF
amplifier and is precisely what is needed in an amplifier designed for the tuning stages of a radio
where only one radio carrier wave among many hundred others, crowded along the medium wave
band for example, must be selected.
Bandwidth
An important piece of information that can be obtained from a frequency response curve is the
Bandwidth of the amplifier. This refers to the ‘band’ of frequencies for which the amplifier has a
useful gain. Outside this useful band the gain of the amplifier is considered to be insufficient
compared with the gain at the centre of the bandwidth. Bandwidth specified for voltage amplifiers is
the range of frequencies for which the amplifier’s gain is greater than 0.707 of the maximum gain
(see Fig. 1.1.1.b). Alternatively, decibels are used to indicate the gain, the ratio of output to input
voltage, (see Fig. 1.1.1.a). The useful bandwidth in Fig. 1.1.1a would be described as extending to
those frequencies at which the voltage gain is −3dB down compared to the gain at the mid band
frequency. Several ways of describing the bandwidth can be used, firstly it could be said (of Fig
1.1.1a), that "The bandwidth is from 10Hz to 20kHz." Alternatively it could be said (of Fig. 1.1.1b)
"The bandwidth is 9kHz, centred on 774kHz." or even that it is "774kHz plus or minus 4.5kHz."
Input Impedance
The word impedance means opposition to AC current flow. At 0 Hz, (that is, DC) impedance
(symbol Z) is the same as resistance (R), but at frequencies other than 0Hz impedance and
resistance are not the same. The input impedance of an amplifier is the effective impedance between
the input terminals. "Effective" means that the impedance is not necessarily just that of the amplifier
components (resistors, capacitors etc.) actually connected across the input terminals, but is the
impedance experienced as the amount of current able to flow into the input terminals for a given
signal voltage applied at a particular frequency. Input Impedance is influenced by a number of
factors including the frequency of the applied signal, the gain of the amplifier, any signal feedback
used and even what is connected to the output of the amplifier.
Output Impedance
The output impedance of an amplifier is not solely dependent on the actual components connected
within the output of an amplifier. It is an ‘apparent’ impedance and can best be demonstrated as
being responsible for a fall in signal voltage at the output terminals of an amplifier, when a current
is drawn from the output terminals. The more current drawn from the output terminals, the greater
the reduction in output signal voltage. The effect is that of an impedance or resistance in series with
the output terminals.
impedance of the first amplifier and the input impedance of the second amplifier form a potential
divider, as shown in Fig. 1.1.3
When connecting voltage amplifiers in cascade, the input signal to the second stage should ideally
be 100% of the output voltage of stage 1, i.e. have as high a voltage amplitude as possible. This will
occur if the output impedance of the first amplifier is a much lower value than the input impedance
of the second amplifier. This allows most of the voltage available at the output terminal (point A) to
be developed across the input impedance of the second amplifier (and therefore across its input
terminals) rather than across the first amplifier’s output impedance.
If the second amplifier is a current amplifier however, it will be necessary that as much current as
possible flows into its input terminals. In this case therefore, the input impedance of the second
amplifier must be low.
In the case of power amplifiers, the maximum power is transferred from output to input if both
impedances are equal.
The values of input and output impedance have a considerable effect on the gain of multi stage
amplifiers, and there is always some loss of signal amplitude which occurs due to the coupling of
successive amplifier stages. In calculating the overall gain of a multi stage amplifier, the overall
gain should be equal to the product of the individual gains of each amplifier. i.e. if each stage of a
two stage amplifier has a gain of 10, then the overall gain should be 10 x 10 = 100. In practice
however, this is not achievable due to the coupling losses incurred in matching the amplifiers, and a
slightly lower overall gain results.
Phase Shift
Phase shift in an amplifier is the amount (if any) by which the output signal is delayed or advanced
in phase with respect to the input signal expressed in degrees. If a phase shift of 90 degrees occurs
then the peak of the output wave occurs one quarter of a cycle after the peak of input wave. Such a
shift can be caused by the effect of components such as resistors inductors and capacitors in the
amplifier circuit. The action of the transistor in a single stage amplifier can cause 180 degrees of
phase shift, and therefore the input and output will be in "anti-phase." Whether a phase shift in an
amplifier is important depends on the purpose of the amplifier.
The design of multi stage amplifiers must take phase shift into consideration, as the amount of
phase shift will vary with frequency it is possible that at some frequencies the total phase shift may
add up to 360 degrees. If the output signal of such a system is allowed to re-enter the input then
positive feedback occurs and the amplifier will become unstable and is likely to oscillate.
Feedback
Feedback is the process of taking a proportion of an amplifier’s output signal and feeding it back
into the input. Feedback can be arranged to either increase or decrease the input signal. When
feedback is used to increase the input signal it is called POSITIVE FEEDBACK, and when the
effect of the feedback reduces the input signal it is called NEGATIVE FEEDBACK.
POSITIVE FEEDBACK occurs when the feedback signal is in phase with the input signal, this
increases the amplitude of the input and hence the output signal, effectively increasing the gain of
the amplifier.
NEGATIVE FEEDBACK occurs when the feedback signal is in anti-phase with the input signal,
effectively reducing the amplitude of the input and hence also the output signal. This causes a
reduction in gain. See Fig. 1.1.5.
Fig. 1.1.5 Negative feedback reduces gain, distortion and noise, it also increases bandwidth.
In high quality amplifiers negative feedback is often used to reduce the gain of the amplifier. A
particular benefit of this, is that any distortion of the signal or background noise produced by the
amplifier is also reduced. A further beneficial effect is that applying negative feedback increases the
bandwidth of the amplifier. The reason for this can be seen in Fig. 1.1.6 where reducing the height
of the gain curve produces wider spacing of the 0.707 points, therefore widening the bandwidth.
4
• So, the digital output from a microprocessor has to be
converted into an analogue form before it can be used as an
input by the actuator.
5
Binary System
7
Decimal and their Binary Equivalent
Binary Decimal Binary Decimal
0000 0 1000 8
0001 1 1001 9
0010 2 1010 10
0011 3 1011 11
0100 4 1100 12
0101 5 1101 13
0110 6 1110 14
0111 7 1111 15
8
Analogue and Digital Signals
12
• The analog quantization size Q, sometimes called the code
width, is defined as the full-scale range of the A/D converter
divided by the number of output states
𝑄 = (𝑉𝑚𝑎𝑥 −𝑉𝑚𝑖𝑛 )/𝑁
• It is a measure of the analog change that can be resolved by
the converter.
• The number of analog decision points that occur in the
process of quantizing is (N-1), i.e. 7 in case of 3 bit device.
13
• Consider a 3-bit device, which has 23 or 8 output states as listed in the
first column.
• The output states are numbered from 0 to (N-1).
• The corresponding code word for each output state is listed in the
second column.
• The decision points occur at 1.25 V, 2.50 V, . . . , and 8.75 V.
Code Width, 𝑄 = (𝑉𝑚𝑎𝑥 −𝑉𝑚𝑖𝑛 )/𝑁 = (10 − 0)/8 = 1.25 𝑉
• This means that the amplitude of the digitized signal has an error of at
most 1.25 V. Therefore, the A/D converter can only resolve a voltage to
within 1.25 V of the exact analog voltage.
14
Shannon’s Sampling Theorem
• The first step for A/D conversion is to numerically evaluate the
signal at discrete instants in time.
• This process is called sampling, and the result is a digitized
signal composed of discrete values corresponding to each
sample.
• So how fast or often the signal should be sampled to obtain an
accurate representation?
• It needs high speed hardware and large computer memory.
16
• Shannon’s Sampling Theorem states that, the sampling rate of
a signal should be more than two times the maximum
frequency component in the signal to retain all frequency
components.
• In other words, to represent the analog signal, the digital
samples must be taken at a frequency 𝑓𝑠 (sampling rate) such
that
𝑓𝑠 > 2𝑓𝑚𝑎𝑥
17
• 𝑓𝑠 > 2𝑓𝑚𝑎𝑥
• Where 𝑓𝑚𝑎𝑥 (Nyquist frequency) is the highest frequency
component in the input analog signal.
• Time period between digital samples is ∆𝑡 = 1/𝑓𝑠
• If sampling rate is 5000 Hz, time interval between samples
would be 1/5000 = 0.2 ms
18
Aliasing
19
• Furthermore, the apparent frequency in the sampled signal is
0.2𝑓0 (2 aliased signal cycles for ten original signal cycles).
• Therefore, under-sampling not only results in errors but
also creates information that is not really there!
20
Analog-to-Digital Conversion
• To properly acquire an analog voltage signal for digital
processing, the following components must be properly
selected and applied in this sequence:
0011 0010 0100
0011 0010 1011
0001 0011 1100
0011 0101 0111
22
• The sample and hold amplifier maintains a fixed input value
(from an instantaneous sample) during the short conversion
time of the A/D converter.
• The converter should have a resolution and analog
quantization size appropriate to the system and signal.
• The computer must be properly interfaced to the A/D
converter system to store and process the data.
23
• The A/D system components described above can be found
packaged in a variety of commercial products called data
acquisition (DAC or DAQ) cards or modules.
• DAC products are available in a variety of form factors
including PC and instrument panel plug-in cards, laptop
computer PCMCIA cards, and stand-alone external units with
standard interfaces (e.g., USB). DAC and modules usually
support various high-level language interfaces (e.g., C++ , Visual
Basic, FORTRAN) that give easy access to the product’s features.
24
Analog-to-Digital Converters
DAC
Digital o/p
27
• A voltage is generated by a clock emitting a regular sequence
of pulses which are counted in a binary manner.
• Resulting binary word is converted into an analogue voltage
by a digital to analogue converter..
• This voltage rises in steps and is compared with the analogue
i/p voltage from the sensor.
• When the clock generated voltage passes the i/p analogue
voltage the pulses from the clock are stopped being counted
by a gate.
28
• o/p of the counter at that time in the digital representation of
the voltage.
• While the comparison could be accomplished by starting the
count at 1, the LSB, and then proceeding bit by bit upwards, a
faster method is by successive approximations.
• This involves selecting the MSB that is less than the analogue
value, then adding successive lesser bits for which the total
does not exceed the analogue value.
29
• For example, we might start the comparison with 1000. If this
is too large we try 0100. If this is too small we then try 0110. If
this is too large we try 0101.
• Because each of the bits in the word is tried in sequence, with
an n-bit word it only takes n steps to make the comparison.
• Thus if the clock has a frequency f, the time between pulses is
1/f .
• Hence the time taken to generate the word, i.e. the
conversion time, is nf.
30
Introduction
6
Data bus
7
Address bus
8
Control Bus
9
Microprocessor
Address bus Data bus
Address bus
Data bus
ALU
Control unit
11
Registers
12
• Common flags in status register
Flag Set, i.e. 1 Reset, i.e. 0
Z Result is zero Result is not zero
N Result is negative Result is not negative
C Carry is generated Carry is not ignored
V Overflow occurs Overflow does not occur
I Interrupt is ignored Interrupt is processed normally
13
3. Programme counter register-
• It allows the CPU to keep track of its position in the program.
• Contains the address of the memory location that contains
the next program instruction.
• The program counter is incremented each time so that the
CPU executes instructions sequentially until, JUMP or
BRANCH, changes the program counter out of that
sequence.
14
4. Memory address register- contains the address of data.
5. Instruction register - stores instructions.
6. General purpose register - temporary storage of data or
addresses, involved in the transfer between registers.
7. Stack pointer register
• Content of this register form an address which defines the
top of stack in RAM.
• Stack is a special area of the memory in which program
counter values can be stored when a subroutine part of
program is being used.
15
• The number and form of the registers depends on the
microprocessor.
• For example, the Motorola 6800 microprocessor has two
accumulator registers, a status register, an index register, a
stack pointer register and a program counter register.
16
Memory
• Memory units store binary data.
• Size of memory determined by the number of wires in the
address bus.
• Memory unit consists of large number of storage cells with each
cell capable of storing 0 or 1 bit.
• Storage cells grouped into a location with each location storing a
word.
• In order to access the stored word each location is identified by
a unique word.
• Size of memory specified in terms of no. of memory locations
available. 1 K is 210 =1024 (4K memory has 4096 locations.)
18
Forms of memory
19
2. RAM (Random access memory)-
• can be read from or written to at any time provided power is
there.
• Data is considered volatile because it is lost when power goes.
• Static RAM- retains data in flip flop as long as memory is
powered.
• Dynamic RAM-consists of capacitor storage of data that must be
refreshed (rewritten) periodically because of the charge leakage.
20
3. EPROM (Erasable programmable ROM)-
• Data stored can be erased with ultraviolet light through a
transparent window at the top of the EPROM IC.
• Then new data can be stored on the EPROM.
• Other type of EPROM is electrically erasable (EEPROM)
• Data in this is electrically erasable and rewritten through its
data line.
21
Input/Output
23
Microprocessor Programming
25
Microcontroller
3
• 8-bit microcontrollers – Motorola 68HC11, Intel 8051 and
PIC16C6x/7x .
• 16-bit microcontroller – Motorola 68HC16.
• 32-bit microcontroller – Motorola 68300.
6
Method to Design a Microcontroller-based System
1. Define the problem
2. Draw a functional diagram
3. Identify I/O requirements
4. Select appropriate microcontroller models
5. Identify necessary interface circuits
6. Decide on a programming language
7. Draw the schematic
8. Draw a program flowchart
9. Write the code
10. Build and test the system
27
Factors Considered While Selecting a Microcontroller
28
Address bus
Crystal Output
Address Memory Memory Input/ port
decoder Output
Clock ROM RAM Input
Micro- Chip port
processor enable
(CPU)
Data bus
Control bus