ADC0809转换程序

程序框图
 
电路
 
程序
ORG 05A0H
05A0 758153 SE11: MOV SP,#53H
05A3 757E00 MOV 7EH,#00H
05A6 757D08 MOV 7DH,#08H
05A9 757C00 MOV 7CH,#00H
05AC 757B09 MOV 7BH,#09H
05AF 757A10 MOV 7AH,#10H
05B2 757910 MOV 79H,#10H ;显示缓冲区初值
05B5 120425 LO18: LCALL DIS ;显示
05B8 7400 MOV A, #00H
05BA 90FFE0 MOV DPTR,#0FFE0H
05BD F0 MOVX @DPTR,A ;0809的0通道采样
05BE 120425 LCALL DIS
05C1 E0 MOVX A,@DPTR ;取出采样值
05C2 7879 MOV R0,#79H
05C4 120077 LCALL PTDS ;采样值送显示缓冲区
05C7 80EC SJMP LO18 ;循环
ORG 0077H
0077 F9 PTDS: MOV R1,A ;拆送显示缓冲区
0078 117C ACALL PTDS1
007A E9 MOV A,R1
007B C4 SWAP A
007C 540F PTDS1: ANL A, #0FH
007E F6 MOV @R0,A
007F 08 INC R0
0080 22 RET
ORG 0425H
0425 C083 DIS: PUSH DPH
0427 C082 PUSH DPL
0429 D2D4 SETB RS1
042B 787E MOV R0,#7EH
042D 7A20 MOV R2,#20H
042F 7B00 MOV R3,#00H
0431 90044F MOV DPTR, #LS0
0434 E6 LS2: MOV A,@R0
0435 93 MOVC A,@A+DPTR
0436 79DC MOVX R1, #0DCH
0439 EA MOV A,R2
043A 09 INC R1
043B F3 MOVX @R1,A
043C DBFE LS1: DJNZ R3, LS1
043E C3 CLR C
043F 13 RRC A
0440 FA MOV R2,A
【ADC0809转换程序】0441 18 DEC R0
0442 70F0 JNZ LS2
0444 F2 MOVX @R0,A
0445 18 DEC R0
0446 F4 CPL A
0447 F2 MOVX @R0,A
0448 C2D4 CLR RS1
044A D082 POP DPL
044C D083 POP DPH
044E 22 RET
044F C0F9A4 LS0: DB 0C0H, 0F9H,0A4H, 0B0H, 99H, 92H ;字形表
0452 B09992
0455 82F880 DB 82H, 0F8H, 80H, 90H, 88H, 83H, 0C6H
0458 908883
045B C6
045C A1868E DB 0A1H, 86H, 8EH, 0FFH, 0CH, 89H, 7FH, 0BFH
045F FF0C89
0462 7FBF
END

    推荐阅读