CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ds1302 save and read problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pcmgogo



Joined: 25 Dec 2004
Posts: 9

View user's profile Send private message

ds1302 save and read problem
PostPosted: Sun Dec 26, 2004 3:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 27, 2004 2:55 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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