Adc Dac KR

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 34

School of Computer Science and Engineering

BCSE305L – Embedded Systems


Module ~ II – I/O Interfacing Techniques
ADC & DAC Interfacing with 8051
Presentation by
Dr.K.Ragavan
Assistant Professor Senior Grade I
Department of IOT
School of Computer Science and Engineering
VIT University, Vellore
INTERFACING WITH
8051
ADC INTERFACING WITH 8051
• Most of the physical quantity like temperature, displacement, pressure
etc., all these are present in analog form. All these analog signals are
processed and stored in memory is very complicated process.

• The analog sensors output data in an analog format which a


microcontroller cannot understand. Therefore, to convert this analog
data to a digital format, Analog to Digital converters or ADCs are used.

• An analog signal has a continuously changing amplitude with respect to


time. A digital signal, on the contrary, is a stream of 0s and 1s.
8 bit ADC Block Diagram
• Step size: smallest change at the input that can be detected by ADC
formula for Resolution = Vref/2n
• Conversion time: time taken by ADC to convert input analog signal to
equivalent digital signal
• An input signal which varies from 0 to 8 volt,
• use a 3-bit ADC to convert this signal to binary data.
• A 3-bit ADC can represent 2^3 or 8 different voltage levels using 3 bits of
data.
Input voltage Binary equivalent
0-1 volt 000B
1-2 volt 001B
2-3volt 010B
3-4 volt 011B
4-5 volt 100B
5-6 volt 101B
6-7 volt 110B
7-8 volt 111B
• The tiniest change we can detect is that
of 1 volt. If the change is smaller than 1 Input voltage Binary equivalent
volt, the ADC can’t detect it. This
minimum change that an ADC can 0-1 volt 000B
detect is known as the step size of the 1-2 volt 001B
ADC.
2-3volt 010B
3-4 volt 011B
• An ADC maps analog signals to their
binary equivalents. To do this, ADCs use 4-5 volt 100B
various methods like 5-6 volt 101B
• Flash conversion
6-7 volt 110B
• slope integration, or successive
approximation. 7-8 volt 111B
ADC 0808
• The ADC 0808 is a popular 8-bit ADC
with a step size of 19.53 millivolts.
• It does not have an internal clock.
Therefore, it requires a clock signal from
an external source.
• It has eight input pins, but only one of
them can be selected at a time because
it has eight digital output pins.
• It uses the principle of successive
approximation for calculating digital
values, which is very accurate for
performing 8-bit analog to digital
conversions.
Pin Diagram of ADC
Functional Block Diagram of ADC
Input pins (INT0-INT7)
•The ADC 0808 has eight input analog pins.
These pins are multiplexed together, and only
one of them can be selected using three select
lines.

Select lines and ALE


•It has three select lines, namely A, B, and C, that
are used to select the desired input lines. The
ALE pin also needs to be activated by a low to
high pulse to select a particular input. The input
lines are selected as follows:
Selected analog
A B C ALE pin
channel
0 0 0 INT0 Low to High pulse

0 0 1 INT1 Low to High pulse

0 1 0 INT2 Low to High pulse

0 1 1 INT3 Low to High pulse

1 0 0 INT4 Low to High pulse

1 0 1 INT5 Low to High pulse

1 1 0 INT6 Low to High pulse

1 1 1 INT7 Low to High pulse


Output pins (D0-D7)
•The ADC has eight output pins that give the binary equivalent of a given analog
value.
VCC and Ground
•These two pins are used to provide the required voltage to power the
microcontroller. In most cases, the ADC uses 5V DC to power up.
Clock
•As mentioned earlier, the 0808 does not have an internal clock and needs an
external clock signal to operate. It uses a clock frequency of 20Mhz, and using
this clock frequency it can perform one conversion in 100 microseconds.
VREF (+) and VREF (-)
•These two pins are used to provide the upper and the lower limit of voltages
which determine the step size for the conversion. Here Vref(+) has a higher
voltage, and Vref(-) has the lower voltage. If Vref(+) has an input voltage 5v and
Vref(-) has a voltage of 0v then the step size will be 5v-0v/2 8= 19.53 mv.
Start conversion
•This pin is used to tell the ADC to start the conversion. When the ADC
receives a low to high pulse on this pin, it starts converting the analog
voltage on the selected pin to its 8-bit digital equivalent.
End of conversion
•Once the conversion is complete, the ADC sends high to low signal to
tell a microcontroller that the conversion is complete and that it can
extract the data from the 8 data pins.
Output enable
•This pin is used to extract the data from the ADC. A microcontroller
sends a high to low pulse to the ADC to extract the data from its data
buffers
Logic to communicate between 8051 and ADC 0808
• Step 1: Set the port you connected to the output lines of the ADC as an input port.
• Step 2: Make the Port connected to EOC pin high. The reason for doing this is that
the ADC sends a high to low signal when the conversion of data is complete. So this
line needs to be high so that the microcontroller can detect the change.
• Step 3: Clear the data lines which are connected to pins ALE, START, and OE as all
these pins require a Low to High pulse to get activated.
• Step 4: Select the data lines according to the input port you want to select. To do
this, select the data lines and send a Low to high pulse at the ALE pin to select the
address.
• Step 5: Now that we have selected the analog input pin, we can tell the ADC to start
the conversion by sending a pulse to the START pin.
• Step 6: Wait for the High to low signal by polling the EOC pin.
• Step 7: Wait for the signal to get high again.
• Step 8: Extract the converted data by sending a High to low signal to the OE pin.
Interfacing diagram of ADC 0808
• The analog signal is applied to the any
input pin INO – IN7.
• The digital output terminals ( D0- D7)
of ADC 0808 is directly connected to
port 0 in 8051.
• Port 3 in micro controller are connected
different control signals in ADC 0808.
P3.0 – ALE, P3.1 – SOC P3.2 – OE, P
3.3 – EOC respectively.
• Port 2 in micro controllers are
connected to the address lines of A,B
and C in ADC 0808.
• The Address lines A,B,C are used to
select the particular input Lines.
SUCCESSIVE APPROXIMATION ADC
• A successive-approximation ADC is a type of analog-to-digital
converter (ADC) that converts a continuous analog waveform into a
discrete digital representation using a binary search through all
possible quantization levels before finally converging upon a digital
output for each conversion.

• One of most common methods of conversion when sample rate is


under 10 MSPS (Megasamples per second) Ideal for multichannel
data acquisition systems Resolutions between 8-16 bits
• As you can see, this ADC consists of a comparator, a digital to analog
converter, and a successive approximation register along with the
control circuit,

• Now whenever a new conversion starts, the sample and hold circuit
samples the input signal. And that signal is compared with the
specific output signal of the DAC.
WORKING PROCESS OF SAR ADC
• Samples and holds analog signal For each bit, a successive
approximation register analyzes it and outputs binary to a digital-to-
analog converter that is dependent on the current bit and all
previously approximated After the DAC, a comparator compares the
voltage of the analog to the digital, and continually loops until they
are equivalent

• Vin > Vdc = SET YOUR NEXT BIT

• Vin<Vdc = SET BIT IS GOING TO RESET AND WILL SET NEXT BIT
• Advantages:
• Conversion time is very small and independent of the amplitude of the
signal.
• Good speed to power ratio

• Disadvantages:
• It may be fast, but it’s slower than a flash ADC, that uses a linear
‘voltage ladder’ and compares the input voltage to each ‘rung’ of the
ladder
• It’s a somewhat complex circuit
Digital to Analog Converter
DAC INTERFACING
•The Microcontroller output is binary values, but application equipments display, motor,
speakers etc. work in analog signal. So we need digital to Analog converters.
•8 bit current output monolithic DAC
•Manufactured by national semiconductor corporation
•16 pin IC available
•8 input lines (digital input)
•Single output
Interfacing diagram of DAC 0808 with microcontroller
8051
• In DAC 0808 the digital inputs are converted to current ( Iout). The current Iout is converted
into voltage using Op- amp The Current value in Iout pin is depends upon the binary
numbers at the Do – D7 inputs of the DAC 0808 and the reference current ( I ref )
Functional Block Diagram of DAC 0808
R-2R DAC
•R-2R Digital-to-Analogue Converter, or DAC, is a data converter which use two precision
resistor to convert a digital binary number into an analogue output signal proportional to the
value of the digital number

Advantages of a R-2R Ladder DAC


•R-2R Ladder DAC contains only two values of resistor: R and 2R. So, it is easy to select
and design more accurate resistors.
•If more number of bits are present in the digital input, then we have to include required
number of R-2R sections additionally.
The circuit diagram of a 3-bit R-2R Ladder DAC is shown in the following figure −

• Recall that the bits of a binary number can have only one of
the two values. i.e., either 0 or 1. Let the 3-bit binary input
is b2b1b0.
• Here, the bits b2 denote the Most Significant Bit (MSB) and
b0 denote Least Significant Bit (LSB) respectively.

• The digital switches shown in the figure will be connected


to ground, when the corresponding input bits are equal to
‘0’. Similarly, the digital switches shown in figure will be
connected to the negative reference voltage, −VR when the
corresponding input bits are equal to ‘1’.

• It is difficult to get the generalized output voltage equation


of a R-2R Ladder DAC. But, we can find the analog output
voltage values of R-2R Ladder DAC for individual binary
input combinations easily.
Interfacing ADC & DAC with 8051

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy