We write a program for the generation of rectangular interface of Digital to Analog Converter (DAC) interference:
Let us consider a problem solution in this domain. The problem states that: To get unipolar output, J1 is shorted to J2 on the interface. To display the waveform on a CRO connect pin 1 of connector P1 to CRO signal pin, and pin 2 of connector P1 to CRO ground pin.
The program is stated as below.
; FILE NAME DAC_TO_RECT.ASM ORG C100H X DW 00FFH ; ‘OFF’ time is proportional to this value Y DW 00C0H ; ‘ON’ time is proportional to this value ORG C000H PA EQU D8H PB EQU D9H PC EQU DAH CTRL EQU DBH MVI A, 88H OUT CTRL ; Configure 8255 ports LOOP: LHLD Y XCHG LHLD X ; Now DE contains 00C0H and HL contains 00FFH MVI A, 00H OUT PA ; Sending 00H to DAC through the Port A CALL DELAY ; Generation of delay proportional to the contents of HL. XCHG ; Now HL contains 00C0H MVI A, FFH OUT PA ; Sending the FFH to Digital to Analog Converter through Port A CALL DELAY ; Generation of delay proportional to the contents of HL JMP LOOP ; Subroutine to generate a delay proportional to contents of HL DELAY: DCX H MOV A, H ORA L JNZ DELAY RET