2、eg51.h>#include#defineLINE1 0#defineLINE2 1#defineLINE1_HEAD 0x80#defineLINE2_HEAD 0xC0#defineLCD_DELAY_TIME500#defineDATA_MODE0X38#defineOPEN_SCREEN0x0C#defineDISPLAY_ADDRESS0x80#defineCLEARSCREENLCD_en_command(0x01)#defineHIGH1#defineLOW0#defineTRUE1#de
3、fineZERO0#defineMSBOx80#defineLSB0x01#defineDS1302_WP0x8E#defineDS1302_RESETRST=LOW;SCL=LOW;RST=HIGH#defineDS1302_WP_ENABLEWrite_Ds1302(DS1302_WP,0X00)#defineDS1302_WP_DISENABLEWrite_Ds1302(DS1302_WP,0x80)#defineLCDIOP2sbitLCD1602_RS=P1^5;sbitLCD1602_RW=P1^6;sbitLCD1602
4、_EN=P1^7;sbitSCL=P1^0;sbitSDA=P1^1;sbitRST=P1^2;//sbitout=P0^6;voidLCD_delay(void);//lcddelayfunction voidLCD_en_command(unsignedcharcommand);//writecommandfucntionvoidLCD_en_dat(unsignedchartemp);//writedatafunctionvoidLCD_set_xy(unsignedcharx,unsignedchary);//setdisp
5、layaddressfunctionvoidLCD_write_char(unsignedx,unsignedchary,unsignedchardat);//writelcdacharacterfunctionvoidLCD_write_string(unsignedcharX,unsignedcharY,unsignedchar*s);//writelcdstringfunctionvoidLCD_init(void);//lcdinitizefunctionvoidmsec(unsignedintx);//delayfuncti
6、onvoidWrite_Ds1302_byte(unsignedchartemp);voidWrite_Ds1302(unsignedcharaddress,unsignedchardat);unsignedcharRead_Ds1302(unsignedcharaddress);voidRead_RTC(void);//readRTCvoidSet_RTC(void);//setRTCvoidInitial(void);//systeminitizefunctionvoiddisplay(void);//RTCdisplayfunc
7、tioncodeunsignedcharset_rtc_code[7]={0x00,0x20,0x18,0x04,0x02,0x07,0x08}; //settheinitialvaluecodeunsignedcharwrite_rtc_address[7]={0x80,0x82,0x84,0x86,0x88,0x8a,0x8c};//setthewriteaddresscodeunsignedcharread_rtc_address[7]={0x81,0x83,0x85,0x87,0x89,0x8b,0x8d};//setthe
8、readaddresscodeunsignedchar*day[7]={"Mon","Tue","Wen","Thu","Fri","Sat","Sun"};unsignedcharread_rtc_code[7];un