Running 2 Youtube Channel : The Masti Adda (Fun based ) : The Knowledge Adda (Knowledge based) : Subscribe for Knowledge with Fun....

Write an assembly language program to interface DAC to 8085 to demonstrate the generation of square wave.

Written by @
Apparatus Used: Microprocessor Kit, Keyboard and DAC interface Board
Assumption: DAC 0800 is an 8 bit Digital to analog converter and output voltage variation is between +5V to -5 V. The output voltage varies in step of 10/256=.04 (approx.). By this table we can see the digital data input and corresponding output.

Input data (Hex)
Output Voltage
00
-5.00
01
-4.96
02
-4.92
03
-4.88
---
-----
----
---
7F
0.00
----
-----
FD
4.92
FE
4.96
FF
5.00

According the discussed above table we can see that with input 00 to DAC we get analog output as -5V. Its give output digital data 00 to FF at regular intervals to DAC and result in namely different form as square wave, saw tooth and triangular wave. The Port address of DAC is 08 H.
Algorithm:
  • Load the initial value 00 to accumulator and move it to DAC
  • Call the delay program
  • Load the last value FF to accumulator and move it to DAC
  • Call the delay Program
  • Repeat the highlighted step
Program:
Memory Address
Op-code
Operand
Comments
2000
MVI
A,00 H
Load 00 to accumulator
2002
OUT
08 H
Send data of  A to DAC
2004
CALL
2012
Store current number
2007
MVI
A,FF H
Send FF to accumulator
2009
OUT
08 H
Send data of  A to DAC
200B
CALL
2012
Current number is now previous no.
200E
JMP
2000
Save result as new current no.
2011
RST
5
Set the Breakpoint
DELAY
2012
MVI
B,05 H
Store 05 to B
2014
MVI
C,FF H
Load FF to C
2016
DCR
C
Decrement C by 1
2017
JNZ
2016
Jump if C is not zero at target address
201A
DCR
B
Decrement B by 1
201B
JNZ
2014
Jump if B is not zero at target address
201E
RET

Return to main program
201F
END

End the program
 
Used Instruction:
MVI: This instruction is used to store 8 bit data in specified register.
DCR: This instruction is used decrement the content of specified register by 1.
JNZ: Jump if counter is not zero at target address.
JMP: Jump unconditionally to the target address.
CALL: This instruction is used to transfer the program sequence to the address specified by the address.
RET: Return from the subroutine unconditionally.
OUT: Send the data to the output port from accumulator.
END: This instruction is used to execute the program.

Result: Thus the square wave generated interfacing DAC trainer board with 8085 Trainer kit.

No comments:

Post a Comment