Digital to Analog Converters Alexander Gurney Alexander Pitt

  • Slides: 44
Download presentation
Digital to Analog Converters Alexander Gurney Alexander Pitt Gautam Puri 1

Digital to Analog Converters Alexander Gurney Alexander Pitt Gautam Puri 1

Digital to Analog Converters � Alexander Gurney � Alexander Pitt � Gautam Puri 2

Digital to Analog Converters � Alexander Gurney � Alexander Pitt � Gautam Puri 2 What is a DAC? Applications of DACs Types of DACs Binary Weighted Resistor R-2 R Ladder Specifications Resolution Speed Linearity Settling Time Reference Voltages Errors

What is a DAC? – Alexander Gurney What is a DAC? �A DAC converts

What is a DAC? – Alexander Gurney What is a DAC? �A DAC converts a binary digital signal into an analog representation of the same signal � Typically the analog signal is a voltage output, though current output can also be used 1 0 0 1 3 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 1 1 DAC

What is a DAC? – Alexander Gurney Reference Voltage � DACs rely on an

What is a DAC? – Alexander Gurney Reference Voltage � DACs rely on an input Reference Voltage to calculate the Output Signal 4

What is a DAC? – Alexander Gurney Binary to Analog Conversion sample is converted

What is a DAC? – Alexander Gurney Binary to Analog Conversion sample is converted from binary to analog, between 0 and Vref for Unipolar, or Vref and –Vref for Bipolar Analog Output Signal � Each 000000010010001101000101011001111000100110101011 Digital Input Signal 5

What is a DAC? – Alexander Gurney Sampling Frequency � Sampling frequency is the

What is a DAC? – Alexander Gurney Sampling Frequency � Sampling frequency is the number of data points sampled per unit time � Sampling frequency must be twice the frequency of the sampled signal to avoid aliasing, per Nyquist criteria � A higher sampling frequency decreases the sampling period, allowing more data to be transmitted in the same amount of time 6

What is a DAC? – Alexander Gurney Output is a Piecewise Function � This

What is a DAC? – Alexander Gurney Output is a Piecewise Function � This is due to finite sampling frequency � The analog value is calculated and “held” over the sampling period � This results in an imperfect reconstruction of the original signal DAC Ideally Sampled Signal 7 Output typical of a real, practical DAC due to sample & hold

What is a DAC? – Alexander Gurney An Example � 4 Bit signal �

What is a DAC? – Alexander Gurney An Example � 4 Bit signal � Unipolar � Vref = 7 V � 8 Sample Points � Sample Frequency = 1 hertz � Duration 8 seconds 0001 0011 0110 1100 1011 0101 0010 0111 8

What is a DAC? – Alexander Gurney Filtering � The analog signal generated by

What is a DAC? – Alexander Gurney Filtering � The analog signal generated by the DAC can be smoothed using a low pass filter � This removes the high frequencies required to sustain the sharp inclines making up the edges Piece-wise Continuous Output Digital Input 0 bit 01101001010100101 10101011111100101 00001010111110011 01010101010 1110101111000 100101010001111 n bit DAC nth bit 9 Analog Filter Continuous Output

What is a DAC? – Alexander Gurney DACs in Audio Digital MP 3 s

What is a DAC? – Alexander Gurney DACs in Audio Digital MP 3 s HD Radio CDs 10 Analog ->3. 5 mm Audio Out ->Signal received by speaker ->RCA Audio Out

What is a DAC? – Alexander Gurney DACs in Video Digital DVDs OTA Broadcast

What is a DAC? – Alexander Gurney DACs in Video Digital DVDs OTA Broadcast Youtube 11 Analog ->Composite Output ->Converter Box Output ->Analog Monitor Input

DAC Types – Alex Pitt Types of Digital to Analog Converters � Binary Weighted

DAC Types – Alex Pitt Types of Digital to Analog Converters � Binary Weighted � Explanation � Advantages and disadvantages � R-2 R Ladder � Explanation � Example � Advantages and disadvantages 12

DAC Types – Alex Pitt Binary Weighted DAC � Adds resistors in parallel scaled

DAC Types – Alex Pitt Binary Weighted DAC � Adds resistors in parallel scaled by two to divide voltage on each branch by a power of two Vout = Analog Out � Use transistors to switch between open and close 13 � Use a summing op-amp circuit with gain

DAC Types – Alex Pitt Binary Weighted DAC � Circuit can be simplified by

DAC Types – Alex Pitt Binary Weighted DAC � Circuit can be simplified by adding resistors in parallel to substitute for Rin. *Values for A, B, C and D are either 1 or 0. 14

DAC Types – Alex Pitt Binary Weighted DAC B 0 B 1 B 2

DAC Types – Alex Pitt Binary Weighted DAC B 0 B 1 B 2 B 3 General equation MSB 15 LSB

DAC Types – Alex Pitt Binary Weighted DAC �Advantages � Works well up to

DAC Types – Alex Pitt Binary Weighted DAC �Advantages � Works well up to ~ 8 -bit conversions �Disadvantages � Needs large range of resistor values (2048: 1 for a 12 bit DAC) with high precision resistor values � Too much or too little current flowing through resistors � Minimum/maximum opamp current � Noise overwhelms current through larger resistance values 16

DAC Types – Alex Pitt R-2 R Ladder DAC � Each bit controls a

DAC Types – Alex Pitt R-2 R Ladder DAC � Each bit controls a switch between ground and the inverting input of the op amp. switch is connected to ground if the corresponding bit is zero. Vref RF � The � Requires 17 4 bit converter only two resistance values (R and 2 R)

DAC Types – Alex Pitt R-2 R Ladder Example �Convert V 3 Vref V

DAC Types – Alex Pitt R-2 R Ladder Example �Convert V 3 Vref V 2 0001 to analog V 1 V 0 V 1 RF 18 V 0

DAC Types – Alex Pitt R-2 R Ladder Example �Convert 0001 to analog R

DAC Types – Alex Pitt R-2 R Ladder Example �Convert 0001 to analog R RF Vref V 0 2 R RF 19

DAC Types – Alex Pitt R-2 R Ladder By adding resistance in series and

DAC Types – Alex Pitt R-2 R Ladder By adding resistance in series and in parallel we can derive an equation for the R-2 R ladder. 20

DAC Types – Alex Pitt R-2 R Ladder MSB LSB By knowing how current

DAC Types – Alex Pitt R-2 R Ladder MSB LSB By knowing how current flows through the ladder we can come up with a general equation for R-2 R DACs. 21

DAC Types – Alex Pitt R-2 R Ladder � 4 -Bit Equation � Substituting

DAC Types – Alex Pitt R-2 R Ladder � 4 -Bit Equation � Substituting � General Rf 22 Equation

DAC Types – Alex Pitt R-2 R Ladder DAC �Advantages � Only two resistor

DAC Types – Alex Pitt R-2 R Ladder DAC �Advantages � Only two resistor values � Can use lower precision resistors 23

Specifications - Gautam Puri Specifications of DAC Lets discuss some terms you’ll hear when

Specifications - Gautam Puri Specifications of DAC Lets discuss some terms you’ll hear when dealing with DACs � Reference Voltage � Resolution � Speed � Linearity � Settling Time � Some types of Errors 24

Specifications - Gautam Puri Reference Voltage Vref � The reference voltage determines the range

Specifications - Gautam Puri Reference Voltage Vref � The reference voltage determines the range of output voltages from the DAC � For a ‘Non-Multiplying DAC’, Vref is a constant value set internally by the manufacturer � For a ‘Multiplying DAC’, Vref is set externally and can be varied during operation � Vref also affects DAC resolution (which will be discussed later). 25

Specifications - Gautam Puri Full scale voltage � Full scale voltage is the output

Specifications - Gautam Puri Full scale voltage � Full scale voltage is the output voltage when all the bits of the digital input signal are 1 s. � It is slightly less than reference voltage Vref � Vfs = Vref - VLSB 26

Specifications - Gautam Puri Resolution � Resolution of a DAC is the change in

Specifications - Gautam Puri Resolution � Resolution of a DAC is the change in output voltage for a change in the least significant bit (LSB) of the digital input � Resolution is specified in “bits”. � Most DACs have a resolution of 8 to 16 bits � Example: � Higher A DAC with 10 bits has a resolution of resolution (more bits) = smoother output � A DAC with 8 bits has 256 steps whereas one with 16 bits has 65536 steps for the given voltage range and can thus offer smoother output 27

Specifications - Gautam Puri Speed (Sampling frequency) � Sampling frequency is the rate at

Specifications - Gautam Puri Speed (Sampling frequency) � Sampling frequency is the rate at which the DAC accepts digital input and produces voltage output � In order to avoid aliasing, the Nyquist criterion requires that � Sampling frequency is limited by the input clock speed (depends on microcontroller) and the settling time of the DAC 28

Specifications - Gautam Puri Settling Time � It takes the DAC a finite amount

Specifications - Gautam Puri Settling Time � It takes the DAC a finite amount of time to produce the exact analog voltage corresponding to the digital input � The settling time is the time interval from when the DAC commands the update of its output to when the voltage actually reaches ± ½ VLSB. � A faster DAC will have a smaller settling time 29 tsettle

Specifications - Gautam Puri Linearity � If the change in analog output voltage per

Specifications - Gautam Puri Linearity � If the change in analog output voltage per unit change in digital input remains constant over the entire range of operation, the DAC is said to be linear � Ideally the DAC should have a proportionality constant which results in a linear slope � Non-linearity is considered an error, and will be further discussed in the errors section Linear 30 Non-linear

Specifications - Gautam Puri Types of DAC Errors � Non-monotonic output error � Non-linear

Specifications - Gautam Puri Types of DAC Errors � Non-monotonic output error � Non-linear output error ― ― Differential Integral � Gain error � Offset error � Full scale error � Resolution error � Settling time and overshoot error 31

Specifications - Gautam Puri Non-monotonic Output Error A monotonic function has a slope whose

Specifications - Gautam Puri Non-monotonic Output Error A monotonic function has a slope whose sign does not change � Non-monotonic error results when the analog output changes direction for a step or a few steps of digital input � In a closed loop control system this may cause the DAC to toggle continuously between 2 input codes and the system will be unstable. � 32

Specifications - Gautam Puri Differential non-linear output error � For a change in the

Specifications - Gautam Puri Differential non-linear output error � For a change in the LSB of input, the output of an ideal DAC is VLSB � However in a non-linear DAC the output may not be exactly the LSB but rather a fraction (higher or lower) of it 33

Specifications - Gautam Puri Differential non-linear output error � Basically “differential” non-linearity expresses the

Specifications - Gautam Puri Differential non-linear output error � Basically “differential” non-linearity expresses the error in step size as a fraction of LSB � The DNL is the maximum of these deviations over the entire transfer function � One must choose a DAC with DNL less than 1 LSB. A DNL > 1 LSB will lead to non-monotonic behavior. This means that for certain steps in digital input, the output voltage will change in the opposite direction. This may cause a closed loop control system to become unstable as the system may end up oscillating back and forth between two points. 34

Specifications - Gautam Puri Integral non-linear output error � The integral non-linearity error is

Specifications - Gautam Puri Integral non-linear output error � The integral non-linearity error is the difference between the ideal and actual output. It can also be defined as the difference between ideal and a best fit line � INL occurs when the output is non-linear and thus unable to adhere to a straight line. � The maximum deviation from this line is called INL. 35

Specifications - Gautam Puri Integral non-linear output error � INL is expressed as fraction

Specifications - Gautam Puri Integral non-linear output error � INL is expressed as fraction of LSB. � INL cannot be calibrated out as the non-linearity is unpredictable and one does not know where the maximum deviation from the ideal line will occur. � One must choose an ADC with an INL (maximum deviation) within the accuracy required. 36

Specifications - Gautam Puri More important - DNL or INL ? � The DNL

Specifications - Gautam Puri More important - DNL or INL ? � The DNL and INL are both important non-linear errors to be aware of. � In the case of an application such as an imaging one, where slight differences in color densities are important, the “differential” non-linearity error is more important. � In an application where the parameters vary more widely, such as speed of a vehicle, the “integral” non-linearity error may be of greater importance 37

Specifications - Gautam Puri Gain Error � The difference between the output voltage (or

Specifications - Gautam Puri Gain Error � The difference between the output voltage (or current) with full scale input code and theideal voltage (or current) that should exist with a full scale input code 2 Types of Gain Error 1. Low Gain: Step Amplitude Less than Ideal 2. High Gain: Step Amplitude Greater than Ideal Gain Error can be adjusted to zero by using an 38 external potentiometer

Specifications - Gautam Puri Offset Error � It is the difference in ideal and

Specifications - Gautam Puri Offset Error � It is the difference in ideal and actual output voltage at a digital input of zero All output values will differ from the ideal values by that same amount, hence the output is “offset” from the input � Offset can be ‘positive’ or ‘negative’ � It can be fixed by adding/subtracting the difference to the digital input before passing through the DAC � 39

Specifications - Gautam Puri Full Scale Error � It is a combination of gain

Specifications - Gautam Puri Full Scale Error � It is a combination of gain and offset error � It is measured at the full scale input 40

Specifications - Gautam Puri Resolution Error � If the resolution is not high enough,

Specifications - Gautam Puri Resolution Error � If the resolution is not high enough, the DAC cannot accurately output the required waveform � Lower resolution results in higher resolution error Low resolution (1 bit) 41 Higher resolution (3 bits)

Specifications - Gautam Puri Settling Time and Overshoot Error � If settling time is

Specifications - Gautam Puri Settling Time and Overshoot Error � If settling time is too high, the DAC will not produce the ideal output waveform fast enough and there will be a delay or lag. � This will also lower the maximum operating frequency of the DAC. 42

References • • • Previous semester lecture slides http: //www. hitequest. com/Hardware/a_dac. htm http:

References • • • Previous semester lecture slides http: //www. hitequest. com/Hardware/a_dac. htm http: //www. national. com/appinfo/adc/files/ms 101157. pdf http: //www. noise. physx. uszeged. hu/Digital. Measurements/ADConversion/ADS pecs. pdf Scherz, Paul. Practical Electronics for Inventors. 2 nd Edition, Mc. Graw Hill. 2007. http: //masteringelectronicsdesign. com/an-adc-anddac-differential-non-linearity-dnl/ http: //masteringelectronicsdesign. com/an-adc-anddac-integral-non-linearity-inl/ 43

Questions ? Alexander Gurney What is a DAC? Alexander Pitt Types of DACs Guatam

Questions ? Alexander Gurney What is a DAC? Alexander Pitt Types of DACs Guatam Puri Specifications 44