|
楼主 |
发表于 2009-2-25 23:22:06
|
显示全部楼层
续上
/*******************************************diplay times*************************************/
void LCD_dispword()
{ uchar secl,sech,minl,minh,hourl,hourh,s;
s=0x3a;
secl=(clocktmp[0]&0x0f)|0x30; /*get the seconds and convert to diplay data*/
sech=(clocktmp[0]>>4&0x0f)|0x30;
minl=(clocktmp[1]&0x0f)|0x30;
minh=(clocktmp[1]>>4&0x0f)|0x30;
hourl=(clocktmp[2]&0x0f)|0x30;
hourh=(clocktmp[2]>>4&0x0f)|0x30;
//dels(1000);
dels(1000);
writer_function(0x88);
Write2(hourh); /*display hours*/
Write2(hourl);
Write2(s); /*display ":"*/
Write2(minh);
Write2(minl);
Write2(s);
Write2(sech);
Write2(secl);
//Enable(0xc0);
//Write1(STR14);
}
因为以前是做硬件的,转行做软件不久,很多不懂的地方,上面这段代码的问题搞了几天了,因为没有51的仿真器,而软件仿真又找不出问题所在,恳请各位用过ds1302的前辈不吝赐教,提示我代码问题所在.谢谢!!! |
|