时钟芯片ds1302 的程序(Clock chip DS1302 procedures).docVIP

  • 3
  • 0
  • 约1.02万字
  • 约 25页
  • 2017-07-29 发布于河南
  • 举报

时钟芯片ds1302 的程序(Clock chip DS1302 procedures).doc

时钟芯片ds1302 的程序(Clock chip DS1302 procedures)

时钟芯片ds1302 的程序(Clock chip DS1302 procedures) Clock chip DS1302 program (jyh.h header file) Release date: June 26, 2003 Number of clicks: 7753 Details: clock chip DS1302 program (jyh.h header file) #include #include #include #include #define uchar unsigned char #define uint unsigned int #define byte unsigned char #define word unsigned int Extern void Set1302 (uchar *); / * * / time setting Extern void Get1302 (uchar curtime[]); / * * / 1302 read the current time Extern, void, Bcd2asc (uchar, uchar *); Clock chip DS1302 procedures Release date: June 26, 2003 Number of clicks: 12353 Details: clock chip DS1302 procedures /********************************************************************* Corporate name: Module name: DS1302.c Function: real time clock module, clock chip type: DS1302 Explain: Program design: zhaojunjie Design time: 2002.03.02 Version number:*********************************************************************/ #include Sbit T_CLK = P2^7; / * * / real time clock clock pin Sbit T_IO = P1^4; / * * / data line real-time clock pin Sbit T_RST = P1^5; / * * / line real-time clock reset pin Sbit ACC0 = ACC^0; Sbit ACC7 = ACC^7; Void RTInputByte (uchar); / * * / 1Byte input Uchar RTOutputByte (void); / * * / 1Byte output? Void W1302 (uchar, uchar); Uchar R1302 (uchar); Void Set1302 (uchar *); / * * / time setting Void Bcd2asc (uchar, uchar *); Void Get1302 (uchar curtime[]); / * * / 1302 read the current time /******************************************************************** Function name: RTInputByte () Function: real time clock writes a byte Description: writes 1Byte data to DS1302 (internal function) Entry parameter: data written by D Return value: None Design: zhaojunjie date: 2002-03-19 Modification: date: ***********************************************************************/ Void RTInputByte (uchar d) { Uchar i; ACC = d; For (i=8; i0; i--) { T_IO = ACC0; / * equivalent to the compilation of the RRC * / T_CLK = 1; t_clk = 0; ACC = 1; } } / *

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档