时钟芯片pcf8563可用程序(Clock chip PCF8563 available program).docVIP

  • 13
  • 0
  • 约 22页
  • 2017-10-07 发布于河南
  • 举报

时钟芯片pcf8563可用程序(Clock chip PCF8563 available program).doc

时钟芯片pcf8563可用程序(Clock chip PCF8563 available program)

时钟芯片pcf8563可用程序(Clock chip PCF8563 available program) Clock chip PCF8563 assembly language program 07/1/27 Clock chip 8563 Read from 8563, minutes, seconds, data, digital display SCL_8563 BIT P1.6; clock line of clock chip SDA_8563 BIT P1.7; clock chip data line SCL BIT P0.3; 164 clock line SDA BIT P0.2; 164 data lines LED0 EQU 40H; saves seconds bit data LED1 EQU 41H; saves ten bits of data per second LED2 EQU 42H; saves bits of data LED3 EQU 43H; saves ten bits of data LED4 EQU 44H; save bit data LED5 EQU 45H; saves ten bits of data per second TDATE EQU 46H; time cache S EQU 47H MIN EQU 48H HOU EQU 49H SUBA EQU 4AH ORG 0000H AJMP MAIN ORG 0100H The main program at ***********; MAIN: ACALL SEND8563; write the clock, the initial initialization of the clock is 12 points, 0 minutes and 0 seconds LOOP: ACALL RCV8563; read clock data ACALL SEP; data split ACALL DISPLAY; call display ACALL DELAY; call delay AJMP LOOP At the end of the main program ***********; **********; initialization time is written into the 8563 ************** subroutine SEND8563: MOV, S, #00H; initialization time MOV, MIN, #00H MOV, HOU, #12H MOV SUBA, #02H; the countdown time byte address MOV, TDATE, S, seconds data ACALL WRITE_8563; read data 8563 MOV, SUBA, #03H; read the read time byte address MOV, TDATE, MIN ACALL WRITE_8563 MOV, SUBA, #04H; time byte address for reading MOV, TDATE, HOU ACALL WRITE_8563 RET **********; initialization time is written into the 8563 end of subroutine ************** **********; write subroutine which 8563 WRITE_8563: ACALL START; send IC bus start condition to start PC8563 MOV, A, #0A2H; take the device address and write instructions to the 8563 ACALL WRITE_BYTE; writes to the PCF8563 device bus address MOV, A, SUBA; read time byte address ACALL WRITE_BYTE; writes to the time byte address MOV, A, TDATE; writes the data to be written ACALL WRITE_BYTE; write in time ACALL STOP; send IC bus stop condition RET **********; write 8563 *********** end subroutine A result

文档评论(0)

1亿VIP精品文档

相关文档