Dac & Adc

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

DAC 0808 Pin Diagram and Operation

A DAC or digital-to-analog converter in electronics is one kind of system, used to change


a digital signal to an analog signal. DAC architectures are classified into different types based on
the merits such as resolution, maximum sampling frequency, and many more. The applications
of DACs include music players, televisions, mobiles, etc. Due to the difficulty as well as the
requirement of exactly matched components, the most specific DACs are executed
like integrated circuits (ICs).

DAC0808 is a D/A converter IC and is used for converting 8-bit digital data input to analog
signal output. It is a monolithic IC featuring a full scale output current settling time of 150 ns
while dissipating only 33 mW with ±5V supplies. The chip accuracy of conversion is good and
power consumption is also low to make it popular. The power supply currents of the DAC0808
are independent of bit codes, and exhibits essentially constant device characteristics over the
entire supply voltage range.

DAC0808 Pin Configuration


DAC0808 is a sixteen pin device and description for each pin is given below:

Pin Name Description

1 NC No connection

2 GND Ground

3 VEE Negative power supply

4 IO Output signal pin

5 A1 Digital input bit 1 (Most Significant Bit)

6 A2 Digital input bit 2

7 A3 Digital input bit 3


8 A4 Digital input bit 4

9 A5 Digital input bit 5

10 A6 Digital input bit 6

11 A7 Digital input bit 7

12 A8 Digital input bit 8 (Least Significant Bit)

13 VCC Positive power supply

14 VREF+ Positive reference voltage

15 VREF- Negative reference voltage

16 COMPENSATION Compensation capacitor pin

DAC0808 Circuit Diagram

The circuit diagram of the IC DAC0808 is shown below.

In circuit

 For the working of device DAC0808, we need two voltage sources +5V and -15V as shown in
the diagram. This is a major drawback that is eliminated in modern DAC to make them work
from a single power source.
 Eight digital inputs are given to the chip and are supposed to be in order from MSB to LSB.
This is also a major drawback because we need to waste 8 I/O pins. This is also eliminated in
modern DACs.
 A +10V power source is connected as a reference voltage for the device and the negative
reference is grounded.
Working
The device takes in parallel 8-bit data from a microcontroller or microprocessor and converts that
data into an analog signal at the output. And the analog output from DAC is a current quantity,
and this needs to be converted into voltage parameters for use in application easily. So to convert
the current parameter into voltage parameter, we will use an op-amp (operational amplifier)
circuit as shown in the circuit diagram. This op-amp circuit (LF351) is called current-to-voltage
converter.
The output analog voltage from op-amp is in linear relation with input digital value and hence
DAC conversion with DAC0808 is achieved. Similarly, you can also use other application
circuits for DAC0808.

Applications:

 Analog and digital circuits


 Electrical measurements
 Audio conversion
 Hobbyist applications
Interfacing DAC 0808:
Write an assembly language program to generate a triangular wave of frequency 500Hz using the
interfacing circuit. The 8086 system operates at 8MHz. The amplitude of triangular wave should
be +5v.

 Here Iout is proportional to digital signal. This has to be converted into voltage by using
external voltage convertor (741).
 To generate a triangular wave of +5v we connect to Vref (+) and Vref(-) is grounded with
2.5K resistor.
 B1-B8 are 8-bit digital input connected to 8255 port A
 CS is connected to 8086 microprocessor. Similarly the D0-D7 are connected to data lines
of 8086 microprocessor.
 Here 8086 operates in maximum mode and hence IORD and IOWR of 8086 are
connected to RD and WR pins of 8255.

Solution: Given frequency is 500 Hz of triangular wavelength. By the given frequency we can
calculate the time period of wavelength generated.
1/f = T = 1/500 = 2ms
Let us assume that wave to be generated is symmetric and wave form will rise for 1ms and fall
for 1ms.
We know that output analog voltage from op-amp is in linear relation with input digital value.
Now lets see the expression for Iout

Iout = Iref [ ½ Bn-1 + ¼ Bn-2 + ------------+ 1/2n B0]


Consider the 8 bits i.e n=8
We have Vref = 5v => Iref = 20mA
Iout = Iref [ ½ B7 + ¼ B6 + ------------+ B0/256]

Consider

B7 B6 B5 B4 B3 B2 B1 B0

If 0 0 0 0 0 0 0 0 Iout = 0
If 0 0 0 0 0 0 0 1

Iout = Iref [ ½ B7 + ¼ B6 + ------------+ B0/256]


Iout = Iref [ ½ (0) + ¼ (0) + ------------+ 1/256]
= 20mA [1/256]

Now using this value we can obtain the voltage i.e.


Vout = Iout * 5k = 0.3V
This is how digital values are converted to analog values

The ALP for DAC is as follows:


MOV AL, 80H Initialize CWR at address 80H
OUT CWR, AL
MOV AL, 00H Start wave rise at 00H
BACK: OUT Port A, AL
INC AL Increment AL
CMP AL, FFH Compare with FFH
JB BACK
BACK 1: OUT Port A, AL Fall wave from 5v to 0v
DEC AL Start decrementing AL
CMP Al, 00H Compare with 00H
JA BACK 1
JMP BACK
ADC 0808 Pin Diagram and Operation

The ADC0808 and ADC 0809 are monolithic CMOS devices with an 8-channel multiplexer.
These devices are also designed to operate from common microprocessor control buses, with tri-
state output latches driving the data bus.

The main features of ADC0808 Pin Diagram are:

 8-bit successive approximation ADC.


 8-channel multiplexer with address logic.
 Conversion time 100 μs.
 It eliminates the need for external zero and full-scale adjustments.
 Easy to interface to all microprocessors.
 It operates on single 5V power supply.
 Output meets TTL voltage level specifications.

Pin Diagram of ADC0808 Pin Diagram:


Operation of ADC0808 Pin Diagram:

ADC 0808/0809 has eight input channels, so to select desired input channel, it is necessary to
send 3-bit address on A, B and C inputs. The address of the desired channel is sent to the
multiplexer address inputs through port pins. After at least 50 ns, this address must be latched:
This can be achieved by sending ALE signal. After another 2.5 μs, the start of conversion (SOC)
signal must be sent high and then low to start the conversion process. To indicate end of
conversion ADC 0808/0809 activates EOC signal. The microprocessor system can read
converted digital word through data bus by enabling the output enable signal after EOC is
activated. This is illustrated in Figure
Interfacing ADC 0808 with 8085:

Figure shows interfacing of ADC 0808 with 8085 using 8255. ADC 0808 has eight input
channels, so to select desired input channel, it is necessary to send 3-bit address on ADC, ADB
and ADA inputs. The address of the desired channel is sent to the multiplexer address inputs
through PB0 to PB2 lines.

After at least 50 ns, this address must be latched. This is achieved by sending ALE signal using
Port line PB3. After another 2.5 μs the start of conversion signal (SOC) must be sent high and
then low. Port line PB4 is used for this purpose. The end of conversion (EOC) is detected by port
line PC0. Schmitt-trigger inverter circuitry generates 300 kHz clock which is required to operate
ADC 0808. The zener diode and LM 308 amplifier circuitry is used to produce a V CC and
+VREF of 5.12 V for the A/D converter. With this reference voltage the A/D converter will have
256 steps of 20 mV each.
Example 2: Interfacing ADC 0808 with 8086 using ports. Use port A of 8255 for transferring
digital data output of ADC to the CPU and port C for control signals. Assume that an analog
input is present at I/P2 of ADC and a clock input of suitable frequency is available for ADC.

Solution: The analog input I/P2 is used and therefore address pins ABC should be 0,1,0
respectively to select I/P2.

The OE and ALE pins are already kept at +5V to select the ADC and enable the outputs.

Port A will read digital data from ADC. Hence it is an input port. Port B will be used to
select one of the available 8 input channels of ADC and hence will act as output port.

Port C upper act as input port to receive the EOC signal while Port C lower act as output
port to send SOC to the ADC.
Port A act as a 8-bit input data port to receive the digital data output from the ADC and Port B
as output port to select the input address. Port C upper acts as input port to receive the EOC
signal while Port C lower acts as output port to send SOC to the ADC. The 8255 control word
is shown in the figure.

The required ALP is as follows

MOV AL, 98H Initialize 8255

OUT CWR, AL

MOV AL, 02H Select I/P2 as analog

OUT Port B, AL input address

MOV AL, 00H Give start of conversion

OUT Port C, AL pulse to the ADC


MOV AL, 01H

OUT Port C, AL

MOV AL, 00H

OUT Port C, AL

WAIT:

IN AL, Port C Check for EOC

RCR by reading Port C upper and rotating carry

JNC WAIT

IN AL, Port A If EOC, read digital equivalent in AL

HLT Stop

You might also like