Interfacing DAC/ADC without Peripheral Controller
description
Transcript of Interfacing DAC/ADC without Peripheral Controller
![Page 1: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/1.jpg)
Interfacing DAC/ADC without Peripheral Controller
Dr A SahuDept of Computer Science & Engineering
IIT Guwahati
![Page 2: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/2.jpg)
Outline• Peripheral communications • DAC– Properties– Generic Model– Interfacing
• ADC– Properties– Generic Model– Interfacing
• Display
![Page 3: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/3.jpg)
Introduction
• Peripherals : HD monitor, 5.1 speaker • Interfaces : Intermediate Hardware – Nvidia GPU card, Creative Sound Blaster card
• Interfaces : Intermediate Software/Program– Nvidia GPU driver , Sound Blaster Driver software
Processor RAM
![Page 4: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/4.jpg)
Primary function of MPU• Read Instruction from memory• Execute instruction • Read/Write data to memory • Some time send result to output device– LEDs, Monitor, Printer
• Interfacing a peripheral – Why: To enable MPU to communicate with I/O– Designing logic circuit H/W for a I/O– Writing instruction (S/W)
![Page 5: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/5.jpg)
Transmission controller• Transmission Controller:– MPU control, Device Control (DMA)
• Type of IO mapping– Peripheral (IN/Out), Memory mapped IO (LD/ST,MV)
• Format of communication– Synchronous (T & R sync with clock), Asynchronous
• Mode of Data Transfer – Parallel, Serial (UART)
• Condition for data transfer – Uncond., Polling, Interrupt, Ready signal, Handshake
![Page 6: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/6.jpg)
Digital to Analog Converter
• Used for play sound in speaker• Used by AC97 (Audio codec)• MP3 Sound store digital format in HDD• Slow as compared to processor/MPU• Parameters• Resolution (8 bit/16 bit)• Settling time (1micro sec)
![Page 7: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/7.jpg)
D/A converter
• FullScaleOutput=(FullScaleValue – 1LSBValue)• 1MSB Value=1/2 * FSV
Digital to
Analog Converter
D0
D1
D2
Analog Output
Vo
Digital Inputs
Anal
og o
utpu
t
000 001 011010 100 101 111110
LSB
FS
01234567
![Page 8: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/8.jpg)
Circuit Realization 4K2.5K
5K
10K
20K
D3=8
D2=4
D1=2
D0=1
Vout
• Vo= Vref/R * ( A1/2+ A2/4+…An/2n)• Vo is proportional to values of Data Bits Value
![Page 9: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/9.jpg)
Practical DAC : R-2R ladder network• Resistive Ladder Network • Require two type Resistor
• But small value– 5K and 10K
2R||2R=R
R+R=2R
R
2R
2R
2R
2R
R
Vout
R
R
+
Resistor
REGISTER
![Page 10: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/10.jpg)
Output Glitches
• Glitches cause waveform distortion, spurs and elevated noise floors
• High-speed DAC output is often followed by a de-glitching SHA (Hold Buffer)
• Cause: Signal and clock skew in circuits
• Especially severe at MSB transition where all bits are switching –
0111…111 →
1000…000Time
Vo
![Page 11: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/11.jpg)
Performance of DAC
• Resolution• Reference Voltages• Settling Time• Linearity• Speed• Errors
![Page 12: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/12.jpg)
Resolution
• Amount of variance in output voltage for every change of the LSB in the digital input.
• How closely can we approximate the desired output signal(Higher Res. = finer detail=smaller Voltage divisions)
• A common DAC has a 8 - 12 bit Resolution
NLSB
VV
2Resolution Ref N = Number of bits
![Page 13: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/13.jpg)
Better Resolution(3 bit)Poor Resolution(1 bit)
Vout
Desired Analog signal
Approximate output
2 V
olt.
Lev
els
Digital Input0 0
1
Digital Input
Vout
Desired Analog signal
Approximate output
8 V
olt.
Lev
els
000
001
010
011
100
101
110
111
110
101
100
011
010
001
000
Resolution
![Page 14: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/14.jpg)
Reference Voltage
• A specified voltage used to determine how each digital input will be assigned to each voltage division.
• Types:– Non-multiplier: internal, fixed, and defined by
manufacturer– Multiplier: external, variable, user specified
![Page 15: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/15.jpg)
• Settling Time: The time required for the input signal voltage to settle to the expected output voltage(within +/- VLSB).
• Any change in the input state will not be reflected in the output state immediately. There is a time lag, between the two events.
Settling Time
![Page 16: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/16.jpg)
Settling Time
Analog Output Voltage
Expected Voltage
+VLSB
-VLSB
Settling timeTime
![Page 17: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/17.jpg)
17
Linearity
Linearity(Ideal Case)
Digital Input
Perfect Agreement
Desired/Approximate Output
Ana
log
Out
put V
olta
ge
NON-Linearity(Real World)
Ana
log
Out
put V
olta
ge
Digital Input
Desired Output
Miss-alignment
Approximate output
![Page 18: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/18.jpg)
• Gain Error: Difference in slope of the ideal curve and the actual DAC output
Errors Gain
High Gain Error: Actual slope greater than ideal
Low Gain Error: Actual slope less than ideal
Digital Input
Desired/Ideal OutputA
nal
og O
utpu
t V
olta
ge
Low Gain
High Gain
![Page 19: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/19.jpg)
• Rate of conversion of a single digital input to its analog equivalent
• Conversion Rate – Depends on clock speed of input signal– Depends on settling time of converter
Speed
![Page 20: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/20.jpg)
• Used when a continuous analog signal is required.
• Signal from DAC can be smoothed by a Low pass filter
Generic Used: Audio player
0 bit
nth bit
n bit DAC011010010101010100101101010101011111100101000010101010111110011010101010101010101010111010101011110011000100101010101010001111
Digital Input
Filter
Piece-wise Continuous Output
Analog Continuous Output
![Page 21: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/21.jpg)
Interfacing 8-bitDAC with 8085
• Design an output port with Address FFH to interface 1408 DAC
• Write a program to generate a continuous RAMP waveform
Time
Output
![Page 22: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/22.jpg)
Interfacing Diagram
8085MPU
A15
A0
D0
D7
Address Bus (16bit)
Data Bus (8bit)
A7
A6
A5
A4
A3
A2
A1
A0
74LS373Latches 1408
LED7
D6
D5
D4
D3
D2
D1
D0
![Page 23: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/23.jpg)
Program to generate continuous RAMP waveformMVI A, 00H ; Load Acc with first I/P
DTOA: OUT FFH ; Output to DACMVI B, COUNT ; Setup Reg. for DelayDCR BJNZ DELAYINR A ; Next InputJMP DTOA ; Go back to Output
Slope of RAMP can be varied by changing Delay
![Page 24: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/24.jpg)
Analog to Digital Conversion
• ADC are slower then DAC• Interfaced using Status Check
Analog to Analog
Converter D0
D1
D2
Analog Input
Vi
Analog Input D
igita
l ou
tput LSB
000001010011100101110111
0 1 2 3 4 5 6 7
![Page 25: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/25.jpg)
Sampling Concepts• Sampling • Fourier Transform
![Page 26: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/26.jpg)
Interpolation
• The process of reconstructing a signal from its values at discrete instants of time– Zero order hold or One Point– Linear or Two Point– Band limited or Low pass Filtering
![Page 27: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/27.jpg)
Algorithm for finding unknown N
• Suppose my range is 0-1024 and assume some value of N between 0-1024
• You have to find the value of N– You can ask me (what about value X)– Answer ( N>X, N<X, N==X)– Operation with X (X++; X*2, X^2, X/2, X--)
![Page 28: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/28.jpg)
Algorithm for finding unknown N
• What is the best Algorithm to find – Sequential ( increase X till X==N) O(N) algorithm– Successive approximation: (Binary Search)• Say R/2 as CMP( R/2, N) === if equal stop IF (R/2 < N) CMP (R/2+R/4,N) ELSE CMP (R/2-R/4, N)
• If you have N persons to do the comparisons– Ask to all people and Gather the information
• Mix of Both approach – If you have M comparator
![Page 29: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/29.jpg)
A/D Conversion Techniques
• Counter or Tracking ADC• Successive Approximation ADC– Most Commonly Used
• Parallel or Flash ADC– Fast Conversion
![Page 30: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/30.jpg)
Counter Type ADC• Block diagram
• Waveform
• Operation– Reset and Start Counter– DAC convert Digital output of
Counter to Analog signal– Compare Analog input and
Output of DAC• Vi < VDAC
– Continue counting• Vi = VDAC
– Stop counting– Digital Output = Output of
Counter• Disadvantage
– Conversion time is varied• 2n Clock Period for Full Scale
input
Clock ControlLogic Counter
DACVi
![Page 31: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/31.jpg)
Successive Approximation ADC• Most Commonly used in medium to high speed Converters• Based on approximating the input signal with binary code and then
successively revising this approximation until best approximation is achieved
• SAR(Successive Approximation Register) holds the current binary value
• Block Diagram
![Page 32: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/32.jpg)
Successive Approximation ADC• Circuit waveform
• Logic Flow
• Conversion Time– n clock for n-bit ADC– Fixed conversion time
• Serial Output is easily generated– Bit decision are made in serial order
![Page 33: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/33.jpg)
Parallel or Flash ADC• Very High speed conversion
– Up to 100MHz for 8 bit resolution– Video, Radar, Digital Oscilloscope
• Single Step Conversion– 2n –1 comparator– Precision Resistive Network– Encoder
• Resolution is limited– Large number of comparator in IC
![Page 34: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/34.jpg)
Generic ADC
A/DConverter
Digital O/P
Vinput
Start
Ready
START RD
![Page 35: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/35.jpg)
Interface ADC using Status Check
A/DConverter
Digital O/P
Vinput
Start
Ready
START RD
Tri-StateBuffer
8085MPU
A15
A0
D0
D7
Address Bus (16bit)
Data Bus (8bit)
A6
A5
A4
A3
IO/W
74LS
138
E1 E2 E3
A7
IO/R
o2
o1
o0
82H
81H
80H
![Page 36: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/36.jpg)
Program to Interface ADC
OUT 82H ; Start ConversionTEST: IN 80H ;Read DR Status
RAR ; Rotate Do to carry
JC TEST ; if Do==1 conv. doneIN 81H ; Read the outputRET ; Return
![Page 37: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/37.jpg)
Display
7 Seg 9 Seg 16 Seg 3x5 DotMatix 5x7 9x11
Dot Matrix Display Panel 25x80 character monitor
![Page 38: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/38.jpg)
Generic Model of Display
DataASCII/BCD
DecoderOr
Memory
Display
Monitor/LEDs
Time to Decode Time to Display
![Page 39: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/39.jpg)
7 Segment LED Interfaces
• Data to 7 Seg Decoder
a
b
c
d
e
f
g
Common Cathode
a
b
c
f
g
e
d
D
C
B
A
LT
RBI
BI
Decoder
5V
0
1
0
1
1
01
1
10
1
5
5v
5V
0
1
0
1
1
11
1
11
1
5
5v
RBO
![Page 40: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/40.jpg)
Multiple 7 Segment LED Interfaces
• Data to 7 Seg Decoder
a b c d e f g
D C B A
RBI RBO
a b c d e f g
D C B A
RBI RBO
a b c d e f g
D C B A
RBI RBO
a b c d e f g
D C B A
RBI RBO
a b c d e f g
D C B A
RBI RBO
5V
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1
10
Blank
0
Blank
1 1
![Page 41: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/41.jpg)
Reference • R S Gaonkar, “Microprocessor Architecture”, Unit II preface,
Chapter 13
![Page 42: Interfacing DAC/ADC without Peripheral Controller](https://reader036.fdocuments.in/reader036/viewer/2022081419/568139dd550346895da19292/html5/thumbnails/42.jpg)
Thanks