#include <reg52.h>
#include "delay.h"
#define ds1302_sec_add 0x80 //??¨ºy?Y¦Ì??¡¤
#define ds1302_min_add 0x82 //¡¤?¨ºy?Y¦Ì??¡¤
#define ds1302_hr_add 0x84 //¨º¡À¨ºy?Y¦Ì??¡¤
#define ds1302_date_add 0x86 //¨¨?¨ºy?Y¦Ì??¡¤
#define ds1302_month_add 0x88 //??¨ºy?Y¦Ì??¡¤
#define ds1302_day_add 0x8a //D??¨²¨ºy?Y¦Ì??¡¤
#define ds1302_year_add 0x8c //?¨º¨ºy?Y¦Ì??¡¤
#define ds1302_control_add 0x8e //????¨ºy?Y¦Ì??¡¤
#define ds1302_charger_add 0x90
#define ds1302_clkburst_add 0xbe
sbit RST = P1^0;
sbit SCK = P1^1;
sbit IO = P1^2;
unsigned char w_tbuf = 3;
unsigned char writeweek = 0;
unsigned char readweek = 0;
unsigned char disweek = 0;
unsigned char tempbuf[3];
unsigned char readbuf[3];
unsigned char disbuf[3];
unsigned char writebuf[3];
unsigned char w_dbuf[3];
unsigned char r_dbuf[3];
unsigned char d_dbuf[3];
unsigned char datebuf[3] = {
16,8,17};
unsigned char timebuf[3] = {
16,01,35};
//unsigned char weekbuf[7] = {MON,TUE,WED,THU,FRI,SAT,SUN};
#define LCDPORT P0
sbit RS = P2^4;
sbit RW = P2^5;
sbit E = P2^6;
#define LCD_WRITE_DATA 1
#define LCD_WRITE_COM 0
void lcd_write(unsigned char byte, unsigned char flag)
{
if(flag)
单片机==ds1302_时间日期周几(30)
最新推荐文章于 2024-05-01 00:54:15 发布