;;;ADC0809默认int5;;进行电压采集12MHZ;; ;;eoc;;p3.2;;ale,star;;p3.3;;oe;;;p3.7,leddata;;p1;;lednubm;;p2;;data;;p0;; ;;数码管共阴2006/07/20;; ORG 0000H AJMP MAIN ORG 000BH AJMP TIME_0 ORG 0030H MAIN: MOV SP,#5FH CLR P3.3;;;ALE STAR;; CLR P3.7;;;DISP OUTDATA MOV 3AH,#05H;;30H为通道数;; MOV 3EH,#00H;;;LED FOR NUMBER MOV TMOD,#02H MOV TH0,#(65536-2000)/256 MOV TL0,#(65536-2000) MOD 256 MOV SCON,#00H MOV TCON,#15H MOV IE,#82H LOOP: ;;LJMP LOOP CHDATA: MOV A,3AH CJNE A,#08H,CHNEXT MOV 3AH,#00H LJMP LOOP CHNEXT: CLR C ANL A,#07H RRC A MOV P3.4,C;;A RRC A MOV P3.5,C;;B RRC A MOV P3.6,C;;;C PLUCKDATA: SETB P3.3;;ALE STAR CLR P3.3 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP JNB P3.2,$ SETB P3.7;;;;ENABLE MOV A,#30H ADD A,3AH MOV 38H,A;;;;FOR CH ADDRIVER DATA MOV R0,A MOV A,P0 CLR P3.7;;DISPABLE MOV @R0,A LJMP LOOP DISPLED: MOV R0,38H MOV A,@R0 MOV B,#100 DIV AB MOV 3BH,A;;BAI MOV A,B MOV B,#10 DIV AB MOV 3CH,A;;SHI MOV 3DH,B;;GE DISPTAB: MOV DPTR,#LEDB MOV A,3EH CJNE A,#03H,DISPF MOV 3EH,#00H MOV P2,#0FFH AJMP DISPOVER1 DISPF: CJNE A,#02H,DISP1 MOV A,3BH MOVC A,@A+DPTR MOV P1,A MOV P2,#0FEH ;; MOV 3EH,#00H ;; AJMP DISPOVER1 DISP1: CJNE A,#01H,DISP2 MOV A,3CH MOVC A,@A+DPTR MOV P1,A MOV P2,#0FDH DISP2: CJNE A,#00H,DISPOVER MOV A,3DH MOVC A,@A+DPTR MOV P1,A MOV P2,#0FBH DISPOVER: INC 3EH DISPOVER1: RET TIME_0: ACALL DISPLED MOV TH0,#(65536-2000)/256 MOV TL0,#(65536-2000)MOD 256 RETI LEDB:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,00H END |