Google

Oct 27, 2008

Program to interface DAC using 8255 and generate triangular waveform

Program to interface DAC using 8255 and generate triangular waveform

The following is the assembly language using DAC to interface with 8255 and generate a square wave on CRO. Here in the code, we use two loops one for the rising part of the wave and the other element to reach zero i.e decrement. The two jump instructions used in the program are iterated to repeat cycles of a triangular wave.

Code:

MOV DX,8807 : DX is loaded with control word register address of 8255
MOV AL,80
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV DX,8801 : DX is loaded with Port A address of 8255
MOV AL,00
UP1 OUT DX,AL ; Contents of AL are transferred to portA of 8255
INC AL
CMP AL,FF
JNZ UP1
OUT DX,AL : Contents of AL are transferred to portA of 8255
DEC AL
JNZ UP2
JMP UP1; Repeat the same

The expected square wave can be observed in a CRO. Thus we programed in assembly language to interface DAC using 8255 to generate a triangular waveform.

Related links
Ebooks for micro processors and micro controllers

2 comments:

Sachinthana Anuradha said...

Can You please up load to do the same thing using pic16f84(Please Please help me.I want to do this for my final presentation.If not I will be get failed.Please help me.Due date is 15 nov 09)Please help me to generate triangular waves using pic 16f84 or "C" language....PLEASE

Sachinthana Anuradha said...

sachinthana.anuradha@yahoo.com is my email .Please inform me....