本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
下面是程序和 仿真图 我是菜鸟啊请大家指点下 SEC EQU 50H
MIN EQU 51H
HOUR EQU 52H
DAY EQU 53H
MON EQU 54H
WEEK EQU 55H
YEAR EQU 56H
ORG 0000H
LJMP START
ORG 0030H
START: MOV SEC,#59H
MOV MIN,#25H
MOV HOUR,#18H
MOV DAY,#10H
MOV MON,#04H
MOV WEEK,#05H
MOV YEAR,#09H
LCALL S1302
LCALL G1302
LCALL DISPLAY
MOV R5,#25
MOV TMOD,#01H
MOV TH0,#63H
MOV TL0,#0C0H
SETB TR0
LOOP1: JBC TF0,LOOP2
LJMP LOOP1
LOOP2: MOV TH0,#63H
MOV TL0,#0C0H
LCALL DISPLAY
DJNZ R5,LOOP1
LCALL G1302
MOV R5,#25
LJMP LOOP1
DISPLAY: MOV A,YEAR
MOV B,#10
DIV AB
MOV 60H,A
MOV 61H,B
MOV A,WEEK
MOV B,#10
DIV AB
MOV 62H,A
MOV 63H,B
MOV A,MON
MOV B,#10
DIV AB
MOV 64H,A
MOV 65H,B
MOV A,DAY
MOV B,#10
DIV AB
MOV 66H,A
MOV 67H,B
MOV A,HOUR
MOV B,#10
DIV AB
MOV 68H,A
MOV 69H,B
MOV A,MIN
MOV B,#10
DIV AB
MOV 6AH,A
MOV 6BH,B
MOV A,SEC
MOV B,#10
DIV AB
MOV 6CH,A
MOV 6DH,B
MOV A,60H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#20H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,61H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#10H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,62H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#08H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,63H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#04H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,64H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#02H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,65H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#01H
MOV P2,#00H
MOV P0,A
LCALL DELAY
MOV A,66H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#80H
MOV P0,A
LCALL DELAY
MOV A,67H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#40H
MOV P0,A
LCALL DELAY
MOV A,68H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#20H
MOV P0,A
LCALL DELAY
MOV A,69H
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#10H
MOV P0,A
LCALL DELAY
MOV A,6AH
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#08H
MOV P0,A
LCALL DELAY
MOV A,6BH
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#04H
MOV P0,A
LCALL DELAY
MOV A,6CH
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#02H
MOV P0,A
LCALL DELAY
MOV A,6DH
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P3,#00H
MOV P2,#01H
MOV P0,A
LCALL DELAY
TABLE: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
DELAY: MOV R7,#1
DEL2: MOV R6,#126
DEL1: DJNZ R6,DEL1
DJNZ R7,DEL2
RET
S1302: CLR P1.5
CLR P1.6
SETB P1.5
MOV B, #8EH
LCALL RTInputByte
MOV B, #00H
LCALL RTInputByte
SETB P1.6
CLR P1.5
MOV R0, #Sec
MOV R7, #7
MOV R1, #80H
S13021: CLR P1.5
CLR P1.6
SETB P1.5
MOV B, R1
LCALL RTInputByte
MOV A, @R0
MOV B, A
LCALL RTInputByte
INC R0
INC R1
INC R1
SETB P1.6
CLR P1.5
DJNZ R7,S13021
CLR P1.5
CLR P1.6
SETB P1.5
MOV B, #8EH
LCALL RTInputByte
MOV B, #80H
LCALL RTInputByte
SETB P1.6
CLR P1.5
RET
G1302: MOV R0, #SEC
MOV R7, #7
MOV R1, #81H
G13021: CLR p1.5
CLR P1.6
SETB P1.5
MOV B, R1
LCALL RTInputByte
LCALL RTOutputByte
MOV @R0, A
INC R0
INC R1
INC R1
SETB P1.6
CLR P1.5
DJNZ R7, G13021
RTInputByte: MOV R4,#8
Inbit1: MOV A,B
RRC A
MOV B,A
MOV P1.7, C
SETB P1.6
CLR P1.6
DJNZ R4, Inbit1
RET
RTOutputByte: MOV R4, #8
Outbit1: MOV C, P1.7
RRC A
SETB P1.6
CLR P1.6
DJNZ R4,Outbit1
RET
END
|