2019-03-25 19:29发布
void Write(uchar date,uchar adr){ while(WR==1); EEADR=adr; EEDATA=date; EEPGD=0; WREN=1; GIE=0; EECON2=0x55; EECON2=0xaa; WR=1; while(WR==1); GIE=1; WREN=0;}
uchar Read(uchar adr){ uchar date; EEADR=adr; EEPGD=0; RD=1; date=EEDATA; while(RD==1); return(date);}
最多设置5个标签!
void Write(uchar date,uchar adr)
{
while(WR==1);
EEADR=adr;
EEDATA=date;
EEPGD=0;
WREN=1;
GIE=0;
EECON2=0x55;
EECON2=0xaa;
WR=1;
while(WR==1);
GIE=1;
WREN=0;
}
uchar Read(uchar adr)
{
uchar date;
EEADR=adr;
EEPGD=0;
RD=1;
date=EEDATA;
while(RD==1);
return(date);
}
一周热门 更多>