100% found this document useful (1 vote)
652 views3 pages

8086 Alp To Interface Dac

The document provides assembly language code to generate four different waveforms - triangular, square, ramp, and staircase - on an oscilloscope by interfacing with a DAC chip. The code initializes port A of the 8255 PPI chip and then uses loops to increment/decrement values written to the port at different time intervals, producing the different waveforms. Triangular wave increments then decrements from 0 to 255. Square wave toggles between 0 and 255 with a delay. Ramp wave increments from 0 to 255 in a loop. Staircase wave increments value by 40 with a delay between writes to the port.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
652 views3 pages

8086 Alp To Interface Dac

The document provides assembly language code to generate four different waveforms - triangular, square, ramp, and staircase - on an oscilloscope by interfacing with a DAC chip. The code initializes port A of the 8255 PPI chip and then uses loops to increment/decrement values written to the port at different time intervals, producing the different waveforms. Triangular wave increments then decrements from 0 to 255. Square wave toggles between 0 and 255 with a delay. Ramp wave increments from 0 to 255 in a loop. Staircase wave increments value by 40 with a delay between writes to the port.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DAC 0800

Problem Statement: Write 8086 ALP to interface DAC and generate following waveforms on
oscilloscope.
i. Triangular wave
ii. Square wave
iii. Ramp wave
iv. Stair case wave

A) Coding to generate Triangular Wave


Dyna-86> A 1000
0000:1000> MOV AL, 89 ;Initialize 8255
OUT 67, AL
MOV AL, 01 ;Enable latch
OUT 63, AL

L3: MOV AL, 00 ;Write 00 to port A


L1: OUT 61, AL
INC AL ;Increment AL
CMP AL, FF ;Compare with FFh
JNZ L1 ;(200Ah)

L2: OUT 61, AL


DEC AL ; decrement AL
CMP AL, 00h ; compare with 00h
JNZ L2 ;(2012h)
JMP L3 ;(2008 h) Repeat for continuous wave
INT 3

B ) Coding to generate Square Wave

Dyna-86>A 1000
0000:1000> MOV AL, 89 ;Initialize 8255 by writing CW to CWR
OUT 67, AL
MOV AL, 01 ;Enable latch
OUT 63, AL

P3: MOV AL, 00 ;write 00 to port A


OUT 61, AL

MOV CL, FF ;Insert Delay


P1: DEC CL
JNZ P1 ;100Eh

MOV AL, FF ;write FF to port A


OUT 61, AL
MOV CL, FF ; Insert Delay
P2: DEC CL
JNZ P2 ;1018h

JMP P3 ;1008h Repeat for continuous wave


INT 3

c) ) Coding to generate Ramp Wave

Dyna-86> A 1000
0000:1000> MOV AL, 89 ; Initialize 8255 by writing CW to CWR
OUT 67, AL
MOV AL, 01 ; Enable latch
OUT 63, AL

A2: MOV AL, 00 ; write 00 to port A


A1: OUT 61, AL
INC AL ; increment AL
CMP AL, FF ;Compare with FFh
JNZ A1
JMP A2 ;Repeat for continuous wave
INT 3
D) ) Coding to generate Staircase Wave

Dyna-86>A 1000
0000:1000> MOV AL, 89h ; Initialize 8255 by writing CW to CWR
OUT 67h, AL
MOV AL, 01h ; Enable latch
OUT 63h, AL

MOV AL, 00h ; write 00 to port A


Back: OUT 61h, AL

ADD AL, 40h


CALL 5000 ; Insert Delay

JMP Back ;1008h


INT 3
Delay Routine:
Dyna-86> A 5000
0000:5000> MOV DL, FFh
MOV CL, FFh
DEC CL
JNZ 5004h
DEC DL
JNZ 5008h
RET

OUTPUT:
Join CRO & Run the above coding separately.
Observe the following waveform on CRO

 Observe Triangular, Square, Ramp wave on CRO

You might also like