Hi, I have come over the problem with LCD. Thankx to all.Any one req. LCD C code can contact me by posting his/her email on this thread. Now i have connected P2.0 to SDA and P2.1 to SCL of AT24C04 EEPROM. Can any one give me his codes for refrance regarding how to READ and WRITE to 24C04. *RU2
201 调用方式:uchar read1380(uchar command ) 202 函数说明:read1380()返回当前时间, command指要返回的时间类型。 203 秒:81H 分钟:83H 小时:85H 日期:87H 星期:89H 星期几:8BH 年:8D H 204 ---------------------------------------------------------------------------------*/ 205 uchar read1380 (uchar command) 206 { 207 uchar time; 208 GetPCF8563(command,1,&time); 209 return time; 210 } 211 212 /*-------------------------------------------------------------------------------- 213 调用方式:void write1380(uchar command ,uchar time ) 214 函数说明:write1380()往HT1380写命令和数据,command是命令字, time是后写入的数据 215 ---------------------------------------------------------------------------------*/ 216 void write1380(uchar command ,uchar time) 217 { 218 SetPCF8563(command,time); 219 } 220 221 222 /*-------------------------------------------------------------------------------- 223 调用方式:void time_display(uchar x0,uchar y0 ) 224 函数说明:time_display()在指定的x0,y0坐标,以00:00:00格式显示当前时间。 225 ---------------------------------------------------------------------------------*/ 226 //uchar time[]="00:11:11"; 227 228 void time_display(uchar x0,uchar y0,bit type) //液晶时间显示 229 { 230 uchar time[]="00:00:00"; 231 uchar con[3]; 232 uchar time_type; 233 GetPCF8563(0x02,3,con); 234 235 time[0]=(con[2]>>4)+'0'; 236 time[1]=(con[2]&0x0f)+'0'; 237 time[3]=(con[1]>>4)+'0'; 238 time[4]=(con[1]&0x0f)+'0'; 239 time[6]=(con[0]>>4)+'0'; 240 time[7]=(con[0]&0x0f)+'0'; 241 242 time[8]=0; 243 if(type==1) 244 { 245 time_type=0xff; 246 } 247 else 248 { 249 time_type=0; 250 } 251 dipchar0(x0,y0,F57,1,time_type,time); 252 } 第4 页 文件: PCF8563T.C 2001-11-27, 18:39:20
Thankx haha, I will surely let u know if i do any modification or optimization or addition to u r refrance code. please give me u r email so that i can share some of my codes with u. rutu
hi rutu and all:) u're welcome.and the code is no mine:),but you can use it anywhere~ my e-mail:feichen201@hotmail.com