|
|
View previous topic :: View next topic |
Author |
Message |
pcmgogo
Joined: 25 Dec 2004 Posts: 9
|
ds1302 save and read problem |
Posted: Sun Dec 26, 2004 3:26 pm |
|
|
I write a code for drive ds1302 with pic16f84. I write the code with ds1302.c library.
I use the pic's 3 pin. My code is working with these procedure,
i use only write and read functions for ds1302.
InitRTC, init function has
write_byte(0x8e);
write_byte(0x00);
write_byte(0x90);
write_byte(0xa0);
Set time, set time is here,
write_byte(0x84);
write_byte(0x01);
write_byte(0x82);
write_byte(0x01);
write_byte(0x80);
write_byte(0x00);
Read time is here,
write_byte(0x85);
ret_hr=read_byte();
write_byte(0x83);
ret_min=read_byte();
write_byte(0x81);
ret_sec=read_byte();
Then, LCD started.
i could read only 00:00:00 (ret_hr,ret_min,ret_sec).
What is the problem.
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Dec 27, 2004 2:55 pm |
|
|
I looked at the CCS driver file, ds1302.c, and it doesn't have functions
with the names "write_byte()" and "read_byte()".
Do you have the CCS compiler ?
If so, you should use their example file for the DS1302: EX_RTCLK.C
And you should use the CCS driver: DS1302.C |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|