实验五 串行通讯应用实验
一、实验目的
了解8251在半双工双机通讯情况下的软件编制,硬件连接技术。
二、实验内容及步骤
1. 实验内容
本实验需用两台TDN-86/51教学实验系统,并通过排线将两台仪器相连,具体接线如图1所示。
8一2号5机1RXDTXDGNDRXD8TXD25GND1二号机 图1 8251的实验线路
其中1号机用作接收机,2号机用作发送机。实验目的是将2号机中的3000-3009H十个单元中的代码传送到1号机的3000-3009H单元中,1号机参考实验程序:
STACK SEGMENT STACK DW 64 DUP(?) STACK ENDS
CODE SEGMENT
ASSUME CS:CODE
START: MOV AL,76H OUT 43H,AL MOV AL,0CH OUT 41H,AL MOV AL,00H OUT 41H,AL CLI
CALL INIT
CALL MOV OUT CALL MOV OUT CALL DALLY AL,7EH 0C1H,AL DALLY AL,34H 0C1H,AL DALLY MOV INT MOV MOV A1: IN AND JZ IN AND MOV INC LOOP MOV MOV MOV MOV MOV INT STI A2: JMP INIT: MOV OUT CALL OUT CALL OUT CALL OUT CALL OUT CALL MOV OUT
AX,0152H 10H
DI,3000H CX,000AH AL,0C1H AL,02H A1
AL,0C0H AL,7FH [DI],AL DI A1
AL,00H SI,300AH [SI],AL AH,06H BX,3000H 10H A2
AL,00H 0C1H,AL DALLY 0C1H,AL DALLY 0C1H,AL DALLY 0C0H,AL DALLY 0C0H,AL DALLY AL,40H 0C1H,AL
RET DALLY :PUSH MOV A3: PUSH POP LOOP POP RET CODE END
CX
CX,3000H AX AX A3 CX ENDS START
2号机实验参考程序:
STACK SEGMENT STACK DW 64 DUP(?) STACK ENDS
CODE SEGMENT
ASSUME CS:CODE
START: MOV AL,76H OUT 43H,AL MOV AL,0CH OUT 41H,AL MOV AL,00H OUT 41H,AL CALL INIT CALL DALLY MOV AL,7EH OUT 0C1H,AL CALL DALLY MOV AL,34H OUT 0C1H,AL CALL DALLY MOV DI,3000H MOV CX,000AH A1: MOV AL,[DI] CALL SEND CALL DALLY INC DI LOOP A1 A2: JMP A2