Sunteți pe pagina 1din 72

DA Converters

José Borges, Patrício Lima, Marcos Brito, Marek Mastyło, Jakub Nyk

GROUP 4
DEEC –MPIN
FEUP
April, 2010

April 10
Outlines

1. Overview of DA converter types


• Four-bit DA converter
• R-2R ladder
2. Principle of operation
3. DAC performance
4. Applications

April 10 2
Overview of DA converter types

 DAC is very important in electronics


 DA converter transforms digital binary input signal into
analog output signal (e.g. voltage, current)
 A typical DAC converts the abstract numbers into a
concrete sequence of impulses that are then
processed by a reconstruction filter using some form of
interpolation to fill in data between the impulses

April 10 3
Overview of DA converter types

 Digital-to-analog (D/A) converters (sometimes called


DACs) are used to present the results of digital
computation, storage, or transmission, typically for
graphical display or for the control of devices that
operate with continuously varying quantities
 The output of the D/A converter is proportional to the
product of the digital input value and the reference

April 10 4
Overview of DA converter types

 Sampled data can be reconstructed perfectly provided


that its bandwidth meets certain requirements
 Reconstructed signal should be a baseband signal
with bandwidth less than the Nyquist frequency

April 10 5
Overview of DA converter types

 Instead of impulses, usually the sequence of numbers


update the analogue voltage at uniform sampling
intervals
 Numbers are written to the DAC
 Numbers are lanched in sequence with clock signal

April 10 6
Overview of DA converter types

 It causes that DAC output voltage changes rapidly


from the previous value to the value represented by
the currently latched number
 Output signal value is held in time at the current value
 Every next latched number casues changes of current
output signal value

April 10 7
Overview of DA converter types

 Example: Transform of latched number to output signal


value: MSB – bit 1 Bit 2 LSB – bit 3 Value
0 0 0 0.0
0 0 1 0.125
0 1 0 0.25
0 1 1 0.375
1 0 0 0.5
1 0 1 0.625
1 1 0 0.750
1 1 1 0.875

 Sign bit can be used

April 10 8
Overview of DA converter types

 Operation gives „staircase” (equivalent to zero-order


hold):

 Reference: http://en.wikipedia.org/wiki/Digital-to-analog_converter

April 10 9
Overview of DA converter types

 DAC output is a sequence of piecewise constant


values or rectangular pulses
 Harmonics are above Nyquist frequency
 Low pass filters are used as a reconstruction filter to
remove higher harmonics

April 10 10
Overview of DA converter types

 Effective frequency response of the DAC depends on


the filter phase distortion
 Not all DACs have a zero order response

April 10 11
Overview of DA converter types
Applications

 DA conversion is used in audio and video systems


 Audio signals are stored in digital form (MP3, CD) and
they must be converted into an analog signal to be
heard
 Video signals from a digital source, such as a
computer, must be converted to analog form if they are
to be displayed on an analog monitor

April 10 12
Principle operations
Counting Pulse-width modulator

 Counting, Pusle-Width Modulator:

 Reference: http://www.analog.com/library/analogDialogue/archives/39-
06/data_conversion_handbook.html

April 10 13
Principle operations
Counting Pulse-width modulator

 It is constructed using counters to generate an output


voltage proportional to a digital input word
 A sampling clock starts the counter, which is loaded
with the digital word and simultaneously sets an R/S
flip-flop

April 10 14
Principle operations
Counting Pulse-width modulator

 The counter counts upward at a fast rate, and when it


reaches all "ones", the R/S flip-flop is reset
 The output of the R/S flip flop is therefore a pulse-
width-modulated (PWM) pulse whose width is
proportional to the complement of the binary word

April 10 15
Principle operations
R-2R Ladder

 An R-2R Ladder is a simple and inexpensive way to perform


digital-to-analog conversion, using repetitive arrangements of
precision resistor networks in a ladder-like configuration
 Five-bit R-2R resistor ladder:

 Reference: http://en.wikipedia.org/wiki/Resistor_ladder

April 10 16
Principle operations
R-2R Ladder

 Bit4 MSB (most significant bit) to Bit0 LSB (least


significant bit) are driven from digital logic gates
 The R-2R network causes the digital bits to be
weighted in their contribution to the output voltage Vout
 In our example 5-bits are used, so it gives 32
possibilities of output values

April 10 17
Principle operations
R-2R Ladder

 Depending on which bits are set to 1 and which to 0


the output voltage will be a stepped value between 0
volts and Vref minus the value of the minimum step
 For a digital value VAL, of a R-2R DAC of N bits of
0 V/Vref, the output voltage Vout is:

Vout = Vref × VAL / 2N

April 10 18
Principle operations
R-2R Ladder - example

 Let N = 5 and hence 2N = 32. With Vref = 3.3 V (typical


CMOS logic 1 voltage), Vout will vary between 00000,
VAL = 0 and 11111, VAL = 31
 Minimum (single step) VAL = 1, we have

Vout = 3.3 × 1 / 32 = 0.1 volts

April 10 19
Principle operations
R-2R Ladder - example

 Maximum output (11111 VAL = 31), we have

Vout = 3.3 × 31 / 25 = 3.2 volts

April 10 20
Principle operations
R-2R Ladder - example

 R-2R ladder features:


 Cheap – needs only two resistor values (or even
one, if we use parallel conection)
 Fast
 Fixed output
 DAC tends to be restricted to a relatively small
number of bits

April 10 21
Principle operations
R-2R Ladder - example

 Small inaccuracies in the higher significant bit resistors


can entirely overwhelm the contribution of the less
significant bits
 Depending on the type of logic gates used and design
of the logic circuits, there may be transitional voltage
spikes at such major crossings even with perfect
resistor values
 High output impedance gates may be unsuitable in
some cases

April 10 22
Principle operations
R-2R Ladder - example

 Resistors used with the more significant bits must be


proportionally more accurate than those used with the
lower significant bits
 On a printed circuit board, using discrete components,
high precision resistors of 1% accuracy may be
employed for a 5 bit circuit
 Both the ratio tolerances of the individual resistors
within the ladder and the resistance of the switches
used at the ladder inputs can affect DAC output
accuracy

April 10 23
Principle operations
R-2R Ladder - example

 Circuit Diagram for an R-2R Ladder Network DAC:

 Reference: http://www.ecelab.com/circuit-dac-r2r.htm

April 10 24
Principle operations
Four-bit DA Converter

 DAC with summing amplifier:

 Reference:
http://hyperphysics.phyastr.gsu.edu/hbase/electronic/dac.html#c2

April 10 25
Principle operations
Binary-Weighted DAC

 Example of 5-bit Binary-Weighted DAC:

 Reference: http://www.analog.com/library/analogDialogue/archives/39-
06/data_conversion_handbook.html

April 10 26
Principle operations
Binary-Weighted DAC

 By connecting various combinations of parallel shorting


switches, 32 possible values of series resistance can
be obtained ranging from 0 to 31·R
 32 possible levels of light intensity are given

April 10 27
Principle operations
Binary-Weighted DAC

 Example Voltage-mode Binary-Weighted Resistor DAC


(The output impedance of the voltage-mode binary
DAC changes with the input code ):

 Reference: http://www.analog.com/library/analogDialogue/archives/39-
06/data_conversion_handbook.html

April 10 28
Main Technical Specifications

 Static Performance

• Resolution (N)
• Differential Nonlinearity (DNL)
• Relative Accuracy or Integral Nonlinearity (INL)
• Zero-Scale Error (VZSE)
• Full-Scale Voltage (VFS)

April 10 29
Main Technical Specifications
Resolution

 This is the number of possible output levels the DAC is


designed to reproduce
 This is usually stated as the number of bits it uses
 Resolution is related to the effective number of bits
which is a measurement of the actual resolution attained
by the DAC

April 10 30
M.T.S.
Differential Nonlinearity (DNL)

 Shows how much two adjacent code analog


values deviate from the ideal 1LSB step

April 10 31
M. T. S.
Integral nonlinearity (INL)

 Shows how much the


DAC transfer
characteristic deviates
from an ideal one. That is,
the ideal characteristic is
usually a straight line;
INL shows how much the
actual voltage at a given
code value differs from
that line, in LSBs (1LSB
steps).

April 10 32
Main Technical Specifications

 Analog Output

• Output Current (Iout)


• Load Regulation at Full Scale (LREG)
• Is the capability to maintain a constant voltage (or current)
level on the output channel of a power supply despite changes
in load
• Capacitance load (CL)

April 10 33
Main Technical Specifications

 Logic Inputs

• Logic Low Voltage (VIL)


• Logic High Voltage (VIH)
• Input Leakage Current (IIL)
• Input Capacitance (CIL)

April 10 34
Main Technical Specifications

 Interface timing specifications

• Clock Width High (tCH) / Low (tCL)


• Load Pulse Width (tLDW)
• Data Setup (tDS) / Hold (tDH)
• Clear Pulse Width (tCLRW)
• Load Setup (tLD1) / Hold (tLD2)
• Select (tCSS) / Deselect (tCSH)

April 10 35
Main Technical Specifications
Interface Timing Specifications

April 10 36
Main Technical Specifications

 AC characteristics

• Voltage Output Settling Time (ts)


• DAC Glitch
• Digital Feedthrough

April 10 37
Main Technical Specifications

 Supply characteristics

• Positive Supply Current (IDD)


• Positive Dissipation (PDISS)
• Positive Supply Sensitivity (PSS)

April 10 38
DAC performance
Resolution

 This is the number of possible output levels the DAC is


designed to reproduce
 This is usually stated as the number of bits it uses
 Resolution is related to the effective number of bits
which is a measurement of the actual resolution attained
by the DAC

April 10 39
DAC performance
Maximum sampling frequency

 Measurement of the maximum speed at which the


DACs circuitry can operate and still produce the
correct output
 Signal must be sampled at over twice the frequency of
the desired signal – Nyquist sampling theorem

April 10 40
DAC performance
Monotonicity

 Ability of a DAC's analog output to move only in the


direction that the digital input moves
 This characteristic is very important for DACs used as
a low frequency signal

April 10 41
DAC performance
THD+N(Total harmonic distortion)

 Measurement of the distortion and noise added to the


signal by the DAC
 It is expressed as a percentage of the total power of
unwanted harmonic distortion and noise that
accompany the desired signal

April 10 42
DAC performance
Dynamic range

 Measurement of the distortion and noise added to the


signal by the DAC
 It is expressed as a percentage of the total power of
unwanted harmonic distortion and noise that
accompany the desired signal
 Measurement of the difference between the largest
and smallest signals the DAC can reproduce
expressed in decibels

April 10 43
DAC performance
Phase distortion

 Phase distortion and sampling period instability are


also sometimes important in DA conversion process

April 10 44
Application Example
Waves Generator

 Requirements:
 Generate four waveforms:
• Square,
• Triangle ,
• Sawtooth
• Sine
 Amplitude choise
 DC Level choise
 Frequency choise

April 10 45
Application Example
Waves Generator

 Schematic circuit

April 10 46
Waves Generator
How to generate
wave?
 Choosing DA Converter:

 Two families widely used:


 DAC 0808 ( parallel)
 DAC 8512 (serie)

 Choose for this circuit: DAC0808

National Semiconductors

April 10 47
Application Example
Waves Generator

 Interface :
 SET FUNC: to select functions:
• Waveform
• Amplitude
• Frequency

 PLUS

 MINUS

 RST

April 10 48
Application Example
Waves Generator

 Interface:

 Led’s indicates selected function

April 10 49
Waves Generator
How to generate waves?

 Square wave:

 Characteristics:
 Vmax
 Vmin
 Pulse-width

April 10 50
Waves Generator
How to generate waves?

 Square wave:

 Is represented by tow voltage leves :Vmin and Vmax


 The value to set in microcontroller output is :

April 10 51
Waves Generator
How to generate
waves?
 Algorithm to generate Square Wave:

1. Calculate Vmax and Vmin from VPP and DC level


2. Calculate delay from requested frequency
3. Loop :
• Set Vmin
• Delay
• Set Vmax
• Jump to loop

April 10 52
Waves Generator
How to generate
wave?
 Triangle wave:

April 10 53
Waves Generator
How to generate
wave?
 Triangle wave:
 Equation definition

April 10 54
Waves Generator
How to generate
wave?
 Tabling values of magnitude:

April 10 55
Waves Generator
How to generate
wave?
 Algorithm to generate Triangle Wave :

1. Calculate Vmax and Vmin


2. Table the values of Wave
3. Calculate delay time
• Delay time is function of frequency
4. Infinit loop:
• Sending upward wave
• Sending downward wave

April 10 56
Waves Generator
How to generate
wave?
 HOW TO GENERATE TAWTOOTH WAVE?

 I just need to set the upward of triangle wave!!

April 10 57
Waves Generator
How to generate
wave?
 Sine Wave

April 10 58
Waves Generator
How to generate
wave?
 Algorithm to generate Sine Wave:

 Generating a table with sine values (Sk) between 0º and 90º

 Steps to set sine wave:


1. Send upward wave stored in table
2. Send downward wave
3. Do VDC- upward wave and send to output
4. Do VDC-downward wave and sendo to output

April 10 59
Waves Generator
How to generate
wave?
 Calculating values of Sk:

0 pi/16 2pi/16 3pi/16 4pi/16 5pi/16 6pi/16 7pi/16 8pi/16

0 10 20 28 36 42 47 50 51

𝑽𝒑𝒑
𝑵𝒌 = 𝑽𝒅𝒄 + ∗ 𝑺𝒌
𝟐

April 10 60
Application Example
8051 Car

 Circuit schematic
• Interface with DA converter serial port and motor controller.

April 10 61
Application Example
8051 Car

 Circuit schematic
 Connecting 8051 to:
• DA Converter
• Motor Controller

April 10 62
Application Example
8051 Car

 Circuit schematic
• VREF+ – Reference voltage (Maximum)
• VREF- – Reference voltage (Minimum)
• IOUT – Output current of the converted data
• VEE – Power supply
• COMP – Compensation
• A1 to A8 – Digital input pins

April 10 63
Application Example
8051 Car

 Circuit schematic
• Output Signal
8
𝑉𝑅𝑒𝑓
𝐼𝑜𝑢𝑡 = ∗ 𝐷𝑖 ∗ 2𝑖−8
𝑅𝑅𝑒𝑓
𝑖=1

𝐷1 𝐷2 𝐷3 𝐷4 𝐷5 𝐷6 𝐷7 𝐷8
𝐼𝑜𝑢𝑡 = 𝐼𝑅𝑒𝑓 ∗( + + + + + + + )
2 4 8 16 32 64 128 256
Ex:
𝐷 = 10001001
𝐼𝑅𝑒𝑓 = 1𝑚𝐴
1 1 1 137
𝐼𝑜𝑢𝑡 = 1𝑚𝐴 ∗ + + = 1𝑚𝐴 ∗ = 0.535𝑚𝐴
2 32 256 256

April 10 64
Application Example
8051 Car

 Circuit schematic
• Motor interface
• The amplifier operates as a
current to voltage converter.

April 10 65
Application Example
8051 Car

 Circuit schematic
• Motor interface
• The voltage is used to generate
the necessary current to feed
The motors..

April 10 66
Application Example
8051 Car

 Coding
• Main program
• Check the command saved on 8051 memory and execute it.
• Commands supported:
• Speed – arg
• Front – arg
• Front right – arg
• Front Left – arg
• Back – arg
• Back right – arg
• Accelerate

April 10 67
Application Example
8051 Car

 Coding
• Serial port
• Commands comes from a terminal connected to the serial port
• The supported commands, will be saved on memory
• In the end the code is compiled and a warning message tells
us if the syntax is correct

April 10 68
Application Example
8051 Car

 Coding
• Main program Flowchart

Memory Value Mnemonic


30h f front
31h 5 5s
32h b back
33h 6 6s
34h s speed
35h 9
90
36h 0
37h j jump
38h 0 0
39h e end

April 10 69
Application Example
8051 Car

 Coding
• Serial port interrupt routine
• Flowchart

April 10 70
References

 Sites:
 http://www.ecelab.com/circuit-dac-r2r.htm
 http://en.wikipedia.org/wiki/Digital-to-analog_converter
 http://en.wikipedia.org/wiki/Resistor_ladder
 http://hyperphysics.phyastr.gsu.edu/hbase/electronic/dac.html#c2
 http://www.the-crankshaft.info/2009/08/dac-interfacing.html
 http://www.8051projects.net/
 http://www.labcenter.co.uk/download/prodemo_autodl_general.cfm

 Softwares:
 ISIS Proteus
 Uvision

April 10 71
Thank you !

April 10 72

S-ar putea să vă placă și