求大神帮助,DS1302设不了初值,是什么原因?
时间:10-02
整理:3721RD
点击:
求大神帮助,DS1302设不了初值,是什么原因?
谢谢了,小弟刚学单片机,谢谢!write_eep: ;===================================================
CLR SZRST
CLR SCL
SETB SZRST
MOV R1,#8EH
CALL WRB
MOV R0,#00H
CALL WRB
SETB SCL
CLR SZRST
MOV R0,#40H ;DI ZHI
MOV R3,#07 ;JI SHU
MOV R1,#80H ;XIE MING LING
LOOP: CLR SZRST
CLR SCL
SETB SZRST
MOV B,R1
CALL WRB
MOV A,@R0
MOV B,A
CALL WRB
INC R0
INC R1
INC R1
SETB SCL
CLR SZRST
DJNZ R3,LOOP
CLR SZRST
CLR SCL
SETB SZRST
MOV R1,#8EH
CALL WRB
MOV R0,#8H
CALL WRB
SETB SCL
CLR SZRST
RET
WRB: MOV R2,#08H
CLR C
LPW: MOV A,B
RRC A
MOV B,A
MOV SDA,C
SETB SCL
NOP
CLR SCL
DJNZ R2,LPW
RET
谢谢了,小弟刚学单片机,谢谢!write_eep: ;===================================================
CLR SZRST
CLR SCL
SETB SZRST
MOV R1,#8EH
CALL WRB
MOV R0,#00H
CALL WRB
SETB SCL
CLR SZRST
MOV R0,#40H ;DI ZHI
MOV R3,#07 ;JI SHU
MOV R1,#80H ;XIE MING LING
LOOP: CLR SZRST
CLR SCL
SETB SZRST
MOV B,R1
CALL WRB
MOV A,@R0
MOV B,A
CALL WRB
INC R0
INC R1
INC R1
SETB SCL
CLR SZRST
DJNZ R3,LOOP
CLR SZRST
CLR SCL
SETB SZRST
MOV R1,#8EH
CALL WRB
MOV R0,#8H
CALL WRB
SETB SCL
CLR SZRST
RET
WRB: MOV R2,#08H
CLR C
LPW: MOV A,B
RRC A
MOV B,A
MOV SDA,C
SETB SCL
NOP
CLR SCL
DJNZ R2,LPW
RET
问题自己找到了
建议不要用汇编,后面很多程序用C很方便
恩,谢谢