使用 DAC 介面生成三角波
我們編寫了一個 8085 組合語言程式,使用數字模擬轉換器 (DAC) 介面生成三角波形。波形的顯示在示波器上可見。
讓我們在這個領域考慮一個問題解決方案。該問題指出:為了獲得單極輸出,介面上的 J1 短接到 J2。要將波形顯示在示波器上,將聯結器 P1 的 1 號引腳連線到示波器訊號引腳,將聯結器 P1 的 2 號引腳連線到示波器地線引腳。
程式
; FILE NAME DAC_TO_TRIANG.ASM ORG C100H X DW 00FFH ; the fall of rise and time I proportional directly to the value. ORG C000H PA EQU D8H PB EQU D9H PC EQU DAH CTRL EQU DBH MVI A, 88H OUT CTRL ; Purpose to configure 8255 ports ; The next 7 instructions will generate rising portion of the triangular waveform. ; And it is done by sending to DAC through Port A values from 00H to FFH, ; in steps of 01. Also the increment will be done after a small time delay here. LOOP: MVI A, 00H ASCEND: OUT PA PUSH PSW CALL DELAY POP PSW INR A JNZ ASCEND DCR A ; Now A contents will be FFH DESCEND: OUT PA PUSH PSW CALL DELAY POP PSW DCR A CPI FFH JNZ DESCEND JMP LOOP ; These Subroutines are used only for the generation of delay ; which is proportional to all the contents of word located at X. DELAY: LHLD X AGAIN: DCX H MOV A, H ORA L JNZ AGAIN RET
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP