You are on page 1of 5

Title: Familiarization of interfacing of Digital-to-Analog (DAC) converter with 8086.

Abstract:

The main objective of the experiment is to get familiar with Digital-to-Analog (DAC) converter .

Introduction: A digital-to-analog converter is a function that converts digital data (usually binary) into an
analog signal. Digital-to-Analog Converters (D/A) can be used to convert a digital output from the
computer into an analog value. For instance, we could generate a series of tones by changing the digital
output values in such a way that the analog signal is represented as a sine wave.

Apparatus:

1. MDA-8086 Microprocessor Kit interfaced with PC

2. MTS-86C Microprocessor Kit

3. EMU8086

Precautions:

1. Data in the MTS-86c was carefully inputted with its keyboard. Specially, for 16 bit binary or 4 bit
hexadecimal data.

2. It was made sure that when writing the codes no typing errors were made as that error would cause a
wrong output to be shown in the MTS-86C.

For Sine Wave:

OBJECT CODE SOURCE CODE

= 3FD8 DAC EQU 3FD8H


0000 CODE SEGMENT
ASSUME CS: CODE, DS: CODE, ES: CODE, SS: CODE

0000 ORG 0H

0000 8C C8 START: MOV AX,CS


0002 8ED8 MOV DS,AX
0004 BA 3FD8 MOV DX,DAC
0007 BF0000 L1: MOV DI,0
000A B3 25 MOV BL,37
000C 8A 85 0018
RL2: MOV AL,SINE[DI]
0010 EE OUT DX,AL
0011 47 INC DI
0012 FE CB DEC BL
0014 75 F6 JNZ L2
0016 EB EF JMPL1

0018 7F 95 AA BF D1 E0 SINE DB 127, 149, 170, 191, 209, 224, 237,246


ED F6
0020 FC FE FC F6 ED E0 DB 252, 254, 252, 246, 237, 224, 209, 191
D1 BF
0028 AA 95 7F 69 54 40 DB 170, 149, 127, 105, 84, 64, 39, 30
27 1E
0030 11 08 02 00 02 08 DB 17, 8, 2, 0, 2, 8, 17, 30
11 1E
0038 2D 40 54 69 7F DB 45, 64, 105, 127

003D F4 HLT
003E CODE ENDS
END

For Triangle Wave:

OBJECT CODE SOURCE CODE

= 3FD8 DAC EQU 3FD8H


0000 CODE SEGMENT
ASSUME CS: CODE, DS: CODE, ES: CODE, SS: CODE

0000 BA 3FD8 START: MOV DX, DAC


0003 32 C0 XOR AL, AL
0005 EE L1: OUT DX,AL
0006 FE C0 IN AL
0008 3C FF CMP AL,0FFH
000A 75 F9 JNX L1
000C EE L2: OUT DX, AL
000D FE C8 DEC AL
000F 22 C0 AND AL, AL
0011 75 F9 JNZ L2
0013 EB F0 JMP L1

0015 F4 HLT
0016 CODE ENDS
END

Report:

For Square Wave the Following Code was written:

SOURCE CODE

DAC EQU 3FD8H


CODE SEGMENT
ASSUME CS: CODE, DS: CODE, ES: CODE, SS: CODE

START: MOV DX, DAC


XOR AL, AL

L1: OUT DX,AL


MOV CX,100H
LOOP $
NOT AL
JMP L1

CODE ENDS
END
For Saw tooth wave the following code was written:

OBJECT CODE SOURCE CODE

= 3FD8 DAC EQU 3FD8H


0000 CODE SEGMENT
ASSUME CS: CODE, DS: CODE, ES: CODE, SS: CODE

0000 BA 3FD8 START: MOV DX, DAC


0003 32 C0 XOR AL, AL

0005 EE L1: OUT DX,AL


0006 FE C0 INC AL
0008 3C FF CMP AL, 0FFH
000A 75 F9 JNZ L1
000C EB F7 JMP L1
000E F4 HLT

000F CODE ENDS


END
Discussion:

This experiment showed how a microprocessor processes codes to convert digital signals to analog
signals. Initially there were some code errors which were resolved later and the MTS-86C was able to
give all the outputs for which the codes were written and output was seen on the oscilloscope.

Conclusion:

The experiment was successfully completed.

You might also like