.post large { float:left; color: $headerBgColor; font-size:100px; line-height:80px; padding-top:1px; padding-right:5px; }

News and Materials Headline Animator

Sunday, June 6, 2010

Program to interface DAC using 8255 and generate square waveform


Program to interface DAC using 8255 and generate square 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 delay elements one for the rising part of the wave and the other delay element to reach zero i.e decrement. Certain value chosen is delayed or sustained for a time period to form the square wave. The two loops used in the program are iterated to repeat cycles of a square 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
Begin MOV AL,00
OUT DX,AL ; Contents of AL are transferred to portA of 8255
MOV CX,00FF
Delay1 Loop Delay1
MOV AL,FF
OUT DX,AL : Contents of AL are transferred to portA of 8255
MOV CX,00FF : CX is loaded with 00FFH
Delay2 Loop Delay2 : Repeat until CX=0
JMP Begin ; Repeat the same

The expected square wave can be observed as in the figure shown. Thus we programed in assembly language to interface DAC using 8255 to generate a square waveform.

No comments:

Post a Comment

Popular Posts

News and Materials

Subscribe Now: Feed Icon

Infolinks In Text Ads

Related Posts with Thumbnails

Latest News

Time