使用DAC接口生成矩形波
我们编写了一个程序来生成数模转换器(DAC)干扰的矩形接口:
让我们考虑这个领域的问题解决方案。问题指出:为了获得单极性输出,J1在接口上短接到J2。要在CRO上显示波形,请将连接器P1的引脚1连接到CRO信号引脚,并将连接器P1的引脚2连接到CRO接地引脚。
该程序说明如下。
; 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