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

CHAPTER 6

DATA CONVERTER
(DAC & ADC)

ismail2009@fke.utm.my 1
ANALOG AND DIGITAL SIGNAL
• Real world connects to electrical world via
transducer
• Transducer is an electronic device which converts
physical quantity into electrical quantity such as
temperature to voltage/current. There are adverse of
transducers:
– Themistor is a transducer where its resistance changes
with temperature
– LDR (Light Dependent Resistor) is another transducer
where its resistance changes with light intensity

ismail2009@fke.utm.my 2
ANALOG AND DIGITAL SIGNAL
• Electrical Signals
– Two forms of Signal
• Analog signal– comprises of instantaneous values
which are spread over time continuously.
• Digital signal– comprises of discrete values that are
spread over time in intervals.

ismail2009@fke.utm.my 3
ANALOG -TO-DIGITAL &
DIGITAL-TO-ANALOG CONVERSION
• Analog signal is converted into digital signal by means of
analog-to-digital converter (ADC).
– Analog signal is obtained from transducer

• Digital signal is converted into analog signal by means of


digital-to-analog converter (DAC)

• Accuracy, storability, low noise effect, easy to process and


manipulate are the advantages of digital signal over analog
signal

ismail2009@fke.utm.my 4
ANALOG-TO-DIGITAL &
DIGITAL-TO-ANALOG CONVERSION
• Analog and digital is related by a graph of analog voltage
versus DAC digital input as shown in figure below.

Analog Voltage(V)
1.2
1.1
1.0
0.9
0.8
Step
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0000
0001
0010

1000

1010
0110

1011
0111
0011
0100
0101

1001

1100

Digital value (4-bit)


ismail2009@fke.utm.my 5
ELEMENTS of DIGITAL TO ANALOG
CONVERTER (DAC) CHARACTERISTIC
• Resolution
– The smallest change of an analog output due to the change of
digital input
– % resolution = step size x 100%
full scale
1
= ----------------- x 100%
Total steps - 1
1
= -------- x 100 %
2N – 1
Note:
N = number of digital bits
ismail2009@fke.utm.my 6
DIGITAL-TO-ANALOG CONVERTER
(DAC)
Example

An 8-bit DAC has step size of 10 mV/step. Find its resolution in


percentage form.

Solution
Total steps = 2N = 28 = 256
Full scale voltage = step size x full scale
(VFS) = step size x (total steps – 1)
= 10 mV x 255 = 2.55 V
% resolution = step size x 100%
full scale voltage
= 10 mV x 100%
2.55V
= 0.392 %

ismail2009@fke.utm.my 7
CONVERTER CHARACTERISTIC
ELEMENTS
• Conversion Time
– Time between the starting edge of start-of–conversion (SOC) signal
and the end-of-conversion (EOC) signal
– Depicting the speed of converter operation
– Conversion rate = Conversion Time
• Resolution
– Determined by numbers of converter’s digital bit
– An amount of analog voltage changes due to a bit change of digital
output
1
– Resolution = ----------
(2N – 1)

ismail2009@fke.utm.my 8
CONVERTER CHARISTERISTIC
ELEMENTS
• Error
– Linearity error
• Analog value diverted from the straight line of the
actual conversion plotting.
• Error from the reference point of converter transfer
function
– Gain error
• Error with respect to input/output ratio

ismail2009@fke.utm.my 9
CONVERTER CHARACTERISTIC
ELEMENTS
– Fixed-zero error
• Especially for Unipolar converter
• Monotonicity
– Considered as monotonicity if output
continuously increases or stay at the same value
when input increases.
• Settling Time
– Time required for output voltage become steady

ismail2009@fke.utm.my 10
CONVERTER CHARACTERISTIC
• Slew rate
ELEMENTS
– Rate change of DAC output voltage due to slew rate of
OP-AMP output. Change of output voltage over time.
• Stability
– Conversion performance with respect to time,
temperature and power supply. Circuit construction and
device matching characteristics including technology
used is importance to produce high stability
• Noise
– This limits resolution of data converter
• Voltage compliance
– Voltage that affects the output current without lowering
converter accuracy.
ismail2009@fke.utm.my 11
DIGITAL-TO-ANALOG (DAC)
• A determination of how close the output
resembles the actual analog is by referring to
number of bits and resolution of a particular D/A
converter
• A 4-bit D/A converter has 24 – 1 or 15 steps to
reach a full scale voltage
• A 8-bit D/A converter has 28 – 1 or 255 steps to
reach a full scale voltage
• This means the 8-bit D/A converter is better than
the 4-bit D/A converter as its smaller step size
• However the price of D/A converter increases
with increases of number of bits

ismail2009@fke.utm.my 12
TYPES OF D/A CONVERTER
CIRCUIT
• Types of DAC circuit that are commonly
found
– Binary weighted
– R-2R ladder network

ismail2009@fke.utm.my 13
BINARY WEIGHTED DAC CIRCUIT
8R I0 IF RF
VA
4R I1
VB V- -
2R I2 V+ +
VC V0
R I3
VD

 Binary weighted D/A converter circuit


• The above circuit is the binary weighted 4-bit D/A converter
• Constitutes of 4 binary weighted resistors, 1 feedback resistor and 1
op-amp that acts as an inverting summer

• Requires different value of resistors which are R, 2R,4R, 8R at the


input side and a single feedback resistor RF to realize the 4-bit DAC

ismail2009@fke.utm.my 14
BINARY WEIGHTED DAC ANALYSIS

• With virtual ground concept, V+ = V- = 0 V


• If all digital inputs are logic high,
then each current is
I0 = VA/8R, I1 = VB/4R, I2 =VC/2R , I3 = VD/R

• So output voltage becomes,


V0 = -IFRF = - (I0+ I1+ I2 + I3)RF
= -(VA/8R + VB/4R + VC/2R + VD/R) RF

ismail2009@fke.utm.my 15
R-2R LADDER NETWORK DAC

• Required resistors in only two values which


are R and 2R.
• Resistor is connected in ladder structure
shape/formation
• The structure is the basis of most DAC IC
internal circuit

ismail2009@fke.utm.my 16
R-2R 4-BIT DAC CIRCUIT
IREF R R R

VREF
2R 2R 2R 2R 2R
RF

-
I out
+ Vo
I out

ismail2009@fke.utm.my 17
R-2R 4-BIT DAC CIRCUIT
R3 = R R2 = R R1 = R R0 = R
I I3 I2 I1 VREF VREF
I = ---------- = -------
IREF = I I3 = ----
2
R I2 = ----
2
R I1 = ----
2
R I0 = ----
2 R3 R

2R x 2R
I I3 I2 I1 R0 = ----------- = R
I3 = ---- I2 = ---- I1 = ---- I0 = ---- 2R + 2R
2 2 2 2
VREF
2R 2R 2R 2R 2R
RF
D3(MSB) D2 D1 D0

-
I out
+ Vo
I out
Figure 6.7
ismail2009@fke.utm.my 18
R-2R LADDER NETWORK DAC
• Circuit yields.
D3I D2 I D1 I D0 I
I3 = ---- , I2 = ----- , I1 = ----- , I0 = -----
2 4 8 16
ID0 2ID1 4ID2 8ID3
IOUT = D0I0 + D1I1 + D2I2 + D3I3 = ---- + ----- + ---- + ----
16 16 16 16
I (1D0 + 2D1 + 4D2 + 8D2) I (20D0 +21 D1+22D2+23D3)
= ---------------------------------- = -----------------------------------
16 16
I (D3D2D1D0) VREF 1
IOUT = ----------------- = -------- ----- (Digital Input)
16 R 24
= current resolution x digital input

VREF 1
Current resolution = --------- ----
R 24
VREF 1
V0 = -IOUTRF = - ------ ----- x RF x Digital Input
R 24
= - (voltage resolution) x (Digital Input)

ismail2009@fke.utm.my 19
R-2R LADDER NETWORK DAC
CIRCUIT’s RESOLUTION
• Generally,
VREF 1
Current Resolution = --------- ----
(step size ) R 2N
VREF 1
V0 = - ------ ----- x RF x Digital Input
R 2N
VREF 1
Voltage Resolution = -------- ------ RF
R 2N
Note:
N = number of bits
ismail2009@fke.utm.my 20
R-2R LADDER NETWORK DAC CIRCUIT
• Example 6.6
By referring to DAC R-2R circuit in figure 6.7 if Vref = 5 V, R = 10 KΩ and RF = 5
KΩ, calculate;
a) Current resolution
b) Output current, IOUT when digital input is 11002
c) Voltage resolution
d) Output voltage, VO when digital input is 10012

• Solution
VREF 1 5 1
a) Current resolution = --------- ---- = ----- ---- = 0.031 mA/step
R 2N 10K 24

b) IOUT = current resolution x 11012 = 0.031 mA x 13 = 0.403 mA


VREF 1 5 1
c) Voltage resolution = --------- ---- RF = ----- ---- 5KΩ = 0.156 V/step
R 2N 10K 24
d) Output voltage, Vo = - (voltage resolution) x (digital input)
= - (0.156V)(10012) = 0.156 x 9 = -1.404 V

ismail2009@fke.utm.my 21
D/A CONVERTER IC
Manufacturer Device Number Resolution Speed
Motorola MC1408 8 300ns
PMI DAC-08 8 100ns
PMI DAC-03 10 250ns
Analog AD7520 10 500ns
Devices
Datel DAC-4Z12D 12 1us
Burr-Brown DAC70/CSB 16 75us

ismail2009@fke.utm.my 22
D/A CONVERTER IC
• DAC 0808 or MC 1408
– 8-bit NC 1 16 Compen
– R-2R Ladder Network (R = 5 KΩ and 2R = 10KΩ ) GND 2 15 VREF(-)
___
– IOUT (pin 2) VEE 3 14 VREF(+)
– IOUT (pin 4) IOUT 4 13 VCC
– Vref Vref DAC 0808
– Iref = ------ = -------- D7 5 12 D0
R 5K D6 6 11 D1
Vref 1
– Current resolution = ----- ----- D5 7 10 D2
R 2N D4 8 9 D5
– Output current, IOUT = Current resolution x digital input
– Full scale output current, IFS = Current resolution x Full scale digital
Vref 1
= ------- ---- x (2N – 1)
R 2N

____
– Total branch current, IFS = IOUT + IOUT

ismail2009@fke.utm.my 23
R-2R LADDER NETWORK DAC CIRCUIT
• Example 6.7
By referring to DAC R-2R circuit in figure 6.9 if Vref = 10.5 V and R = 5 KΩ,
determine
a) reference current, Iref
b) current resolution
c) full scale output current, IFS

• Solution
Vref 10.5
a) Iref = ------ = ----- = 2.1 mA
R 5K
Vref 1 1
b) Current resolution = ----- ---- = (2.1 mA)--- = 8.203 uA/step
R 2N 28
Vref 1 10.5 V 1
c) IFS = ---- --- x (2 – 1) = --------- --- x (28 – 1)
N

R 2N 5K 28
1
= (2.1mA) ---- x 255 = 2.092 mA
256

ismail2009@fke.utm.my 24
OUTPUT VOLTAGE WITH A SINGLE POLE
DAC 0808
-12 V +12 V

0.1 uF 0.1 uF 0.1 uF


RF
Iref Rref I OUT
14 3 16 13 4 -
5K I OUT +
DAC 0808 V0
2
15
Vref +10.5 V 5 12 1
5K
D7 D6 D5 D4 D3 D2 D1 D0
MSB LSB

 Value for reference voltage, Vref and feedback resistor, RF are selected
based on output voltage, V0 and output current, IOUT as required

ismail2009@fke.utm.my 25
OUTPUT VOLTAGE WITH A SINGLE POLE
DAC 0808
• Voltage resolution = current resolution x RF
VREF 1
= ------- ---- x RF
R 2N
10.5 1
= ------- ---- x 5K
5K 28
• VOUT = Voltage resolution x digital input
VREF 1
= ------ ----- x RF x digital input
R 2N
10.5 1
= ------- ---- x 5K x digital input
5K 28
= IOUT RF

ismail2009@fke.utm.my 26
OUTPUT VOLTAGE WITH BIPOLE DAC 0808
-12 V +12 V

0.1 uF 0.1 uF 0.1 uF


RF (5 K)

Iref Rref I OUT +12 V


14 3 16 13 4 -
741
5K I OUT +
DAC 0808 V0
2
15
Vref +10.5 V 5 12 1
5K 5K -12 V

D7 D6 D5 D4 D3 D2 D1 D0
MSB LSB

Figure 6.11 DAC 0808 circuit connection to produce bipolar output voltage
 Output voltage, VO will produce positive or negative voltage value depending on digital
input
___ ___
 VO = IOUTRF – IOUT RF = (IOUT – IOUT) RF
_____
 IFS = IOUT + IOUT
ismail2009@fke.utm.my 27
OUTPUT WITH BIPOLE DAC 0808
• Example 6.10
By referring to DAC 0808 circuit in figure 6.11, find
a) current,resolution
b) full scale output current, IFS
c) output voltage Vo when digital input is 000000002
d) output current range for digital input of 10000000 2 . Assume full scale error
is ± 0,2 %
• Solution
Vref 10.5
a) Iref = ------ = ----- = 2.1 mA
R 5K
Vref 1 1
Current resolution = ----- ---- = (2.1 mA)--- = 8.203 uA/step
R 2N 28
Vref 1 10.5 V 1
c) IFS = ---- --- x (2 – 1) = -------- - --- x (28 – 1)
N

R 2N 5K 28
1
= (2.1mA) ---- x 255 = 2.092 mA
256

ismail2009@fke.utm.my 28
OUTPUT WITH BIPOLE DAC 0808
• Solution for Example 6.10
c) Iout = current resolution x digital digit
= 8.2 μA x 0 = 0 A

Iout = IFS – Iout


= 2.09 mA – 0 mA = 2.09 mA

Vo = (Iout – Iout) RF
= (0 – 2.09 mA )5K = -10.45 V

d) ideal current output = (step size)x(digital input)


= 8.2µA x 128
= 1050µA

Full scale error for output current = ( 2.09mA)(±0.2%)


= (2.09mA)(±0.002)=±4µA
Output current range = 1050µA ± 4µA
= 1046µA until 1054µA

ismail2009@fke.utm.my 29
ADC CONVERTER
• Function : Convert analog input voltage into
digital form
• Conversion takes some times
• Adverse ADC types
– Digital Ramp ADC
– Successive Approximation Register (SAR)
– Flash ADC
– Tracking ADC
– voltage to frequency ADC

ismail2009@fke.utm.my 30
ADC CONVERTER
• Block diagram of basic ADC

Analog Sample VA
+ Start Command
Input and Hold Control
circuit Logic
- Clock signal

Comparator EOC
Register
D0
--- D1 Digital
DN-1Output
V8
N digital DAC

ismail2009@fke.utm.my 31
SAR ADC
• Widely used in ADC IC Construction and the second
fastest ADC
• Block diagram of SAR ADC
EOC
Analog Sample VA
+ SAR Start Conversion
Input and Hold
Circuit Control
- Logic Clock signal

MSB LSB
Comparator LSB
Digital
MSB Output
---
V8
N digit DAC

ismail2009@fke.utm.my 32
SAR ADC OPERATION
• Operation begins by considering ADC is a 4-bit, 1V step size and analog input,
VA = 6.3 V
• START conversion command is activated with a high logic level
• Control logic will clear SAR register content, Q3Q2Q1Q0 = 00002 or [Q] = 0000.
This makes VB = 0 V at t0
• VB < VA, comparator output becomes high
• START conversion command returns to low logic level, clock signal is channel
to SAR register
• At first clock pulse, MSB bit (Q3) of SAR register is set to logic 1.Thus [Q] =
1000. Hence VB = 8 V.
• VB > VA, comparator output becomes low. As VB is larger, MSB becomes 0,
Thus [Q] = 0000, VB = 0 V.
• Control logic will set Q2 to 1. Thus [Q] = 0100 and VB becomes 4 V. VB < VA
comparator output becomes low. Q2 = 1 is maintained.
• Control logic sets bit Q1= 1 thus [Q] = 0110, VB = 6 V. VB < VA. Q1 = 1 is
maintained . Hence [Q] = 0110.
• Control logic then set sbit Q0= 1 thus [Q] = 0111, VB = 7 V. VB > VA. Q0
becomes 0.. Hence [Q] = 0110. Once all bits have been tested control logic
activates EOC signal indicating conversion process ended and digital output
can be taken.
• Thus the equivalent digital value is 01102 for analog input , VA = 6.3V

ismail2009@fke.utm.my 33
SAR ADC OPERATION
• Operation begins by considering ADC is a 4-bit, 1V step size and analog input,
VA = 6.3 V
• START conversion command is activated with a high logic level
Start MSB = 1 other bits=0
VB(V) - 1000  VB = 8 V
- Compare VA & VB
9 -If VB<VA
8 - Comparator Output = high
7 0111 - bit keep the value
6 VB>VA
5 1000 0110 0110 - Comparator Output = low
4 (START) -bit reset the value
(EOC) Evaluate next bit
- use similar process step
0100 - x100  VB (x = previous bit)
0000 - Compare VA & VB
Decide bit fate
Evaluate other following bits till
the last bit.
t0 t1 t2 t3 t4 t5 t6 t7 All bits evaluate
time  Data ready
Send End of Conversion signal

ismail2009@fke.utm.my 34
FLASH ADC CONVERTER
• The Fastest ADC converter VA>V+ve
• Circuit diagram of flash ADC Comparator output – low
8V
Output bits encoded following
Comparator the highest priority active input
1K
7V -
C7
+
I7
1K - C6
6V + I6
C5 C (MSB)
1K -
5V + I5
C4 B
1K 4V +
-
I4 Priority Digital
1K
3V
- C3 Encoder
I3 A (LSB)Output
+
1K - C2 74148
2V
+
I2
1K - C1
1V + I1
1K C0
I0

Analog input, VA

ismail2009@fke.utm.my 35
FLASH ADC OPERATION
• Let say analog input is 4 V and is compared to
respective comparator producing
C7 = C6 = C5 = C4 = high output
C3 = C2 = C1 = C0 = low output
• So C3 is the highest if compared to C2, C1, C0
• Thus digital output = 0112

ismail2009@fke.utm.my 36
A/D CONVERTER IC
Manufacturer IC Number Resolution Speed Conversion Cost
Type
National MM5357 8 40us SA US10
PMI AD-02 8 8us SA
Analog AD7570 10 18us SA US70
Devices
Datel ADC-EK12B 12 24ms Integrating
Analog AD7550 13 40ms Integrating US70
Devices
National ADC 0816 8 114ms SA US20

ismail2009@fke.utm.my 37
ADC0804
• Cheap
• ADC 0804 IC manufacturer comprises of National
Semiconductor, Texas Instruments.
• 8-bit
• Successive Approximation Register (SAR)
• Voltage supply, VCC = +5V
• Clock frequency range, 100 KHz < fCLK < 1.46 MHz

ismail2009@fke.utm.my 38
ADC0804 pin configuration
• 20 pins
CS 1 20 VCC or VREF
RD 2 19 CLK out
WR 3 18 D0
CLK in 4 17 D1
INTR 5 16 D2
ADC 0804
VIN(+) 6 15 D3
VIN(-) 7 14 D4
A GND 8 13 D5
VREF/2 9 12 D6
D GND 10 11 D7

ismail2009@fke.utm.my 39
ADC0804 PINS
• Vcc (5 Volt)
• CLK R and CLK IN
– Internal Schmitt Trigger Oscillator
• activated by connecting a resistor with 10 Kohm value and a
capacitor with 10 pF value
• VIN(+) and VIN(-)
– Analog input for the converter
– In general, VIN(-) is connected to ground
– Voltage to be converted is fed to VIN(+) and it should
be greater than Vcc.
• Vref/2
– Form the to-be-converted analog voltage range
ismail2009@fke.utm.my 40
ADC0804 PINS
• A GND and D GND
– Analog and digital ground are provided
separately so that noise generated by digital
ground because of a fast switching activity will
not affect the analog ground.
– These two grounds are normally connected to
ground in separate manner on the chasis or the
printed circuit board (PCB).

ismail2009@fke.utm.my 41
ADC0804 PINS
• Four communication control pins
– Chip Select (CS*)
• Device becomes dormant
– Read (RD*)
• Output can be read when RD* and CS* are low
– Write (WR*)
• WR* pulse with low CS* act as SOC (start conversion)
– Interrupt (INTR*)
• Become high at SOC.
• Become low when conversion complete
• End edge of INTR* can become EOC (End conversion)

ismail2009@fke.utm.my 42
ADC0804 PINS
• Analog Input Range
– Determined by and depending on Vcc,VREF/2 and VIN (-)
– If VREF/2 is left not connected, VIN(-) always at ground,
then analog input range is from 0 until 5 V.
– If a voltage is fed to VREF/2, this voltage will determine
the analog input voltage range. It will be half of the input
voltage range which is going to be converted
– As an addition, a voltage value can be fed to VIN(-). It will
function as an offset, forming the lower part of analog
voltage range limit

ismail2009@fke.utm.my 43
ADC0804 PINS
• Analog Input Range
– Example 1
Let VREF/2 = 1.5 V and VIN(-) = 0.5 V.
So analog input range is between 0.5V and 3.5V
Good thing in setting the range this way is that the
output will have small resolution if analog input
voltage less than 5V
For this example, every digital increment is equal to
3/256 V not 5/256V.

ismail2009@fke.utm.my 44
ADC0804 PINS
• Analog Input Range
– Example 2
Let VREF/2 = 2 V and VIN(-) = 0.5 V. What is the
analog input voltage range? What is the digital value
for analog input voltage of 4V?
Analog input voltage range is between 0.5Vand
4.5V.
Input voltage of 4V is seen as being 3.5 V higher
the lower level limit
Therefore digital value is (3.5/4)x256 = 224 or
E0(hex) or 111000002

ismail2009@fke.utm.my 45
ADC0804
• Question
If VREF/2 is connected to 2.56V and VIN(+)
to 4V, VIN(-) to the ground, what is the
digital output?
• Solution
Digital value = (4/2(2.56)) * 256 = 200
= 110010002 = C8 (hex)

ismail2009@fke.utm.my 46

Example of ADC0804 Application
Example 6.16
a) Obtain the analog input range if Vref/2 terminal is not connected
b) If Vref/2 terminal is connected to voltage supply +1.5 V, determine
i) step size in volt
ii) % resolution
iii) analog input when digit output = 000000112
iv) digital output when analog input = 1.0 V
c) Determine the ADC conversion time, tc +5 V

Analog + VIN(+) VCC D7


Input -
VIN(-) D6
A Grid D5
D4 Digital
+1.5 V VREF/2 Output
D3
CLK out
ADC D2
10 K 0804 D1
CLK in
150 pF D0

CS*
from micro RD*
processor to micro
WR* INTR* processor
D Gnd

ismail2009@fke.utm.my 47
EXAMPLE OF ADC0804 APPLICATION
• Solution 6.16
a) Vref/2 terrninal is let open
Vref
------ = 2.5 V
2
Vref = 5 V

Thus analog input range is between 0 and 5 V (full scale)

b) If Vref/2 = 1.5 V, therefore analog input range is between 0 and 3 V


full scale voltage 3V 3 3 3
i) step size = ----------------------- = ------------------------ = ------------ = ------ = ------
full scale Total steps– 1 2N – 1 28 – 1 255

= 11.76 mV

step size 11.76


ii) % Resolution = ----------------------- = -------- x 100% = 0.39%
full scale voltage 3

iii) Analog input = step size x digital output = 11.76m x 00000011 2 = 11.76mV(3) = 35.28mV
analog input 1
iv) Digital output = ------------------------- = ------------ = 85 = 0101010102
step size 11.76 mV

ismail2009@fke.utm.my 48
EXAMPLE OF ADC0804 APPLICATION

• Solution 6.16
c) Clock frequency for ADC0804,

fclk = 1/1.1RC = 1/1.1(10K)(150pF) = 606 kHz

tclk = 1/606 k = 1.65µs

thus the conversion time,


tC = (number of digital bits) x clock time
tc = N x tclk
= 8 x 1.65µs = 13.2µs

ismail2009@fke.utm.my 49
MICROPROCESSOR
APPLICATION
• Microprocessor or computer is often used in
surveilling and controlling processes besides being
used as problem solving
• For example, Electronic Control Module in cars
to monitor engine temperature, RPM and to
control optimum transmission in terms air and fuel
combustion in the carburettor.

ismail2009@fke.utm.my 50
THANK YOU

WISHES ALL THE BEST


IN YOUR FINAL EXAMS

THE END

ismail2009@fke.utm.my 51

You might also like