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

DS1307 doesn't keep day of the month
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9253
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jun 27, 2015 2:13 pm     Reply with quote

OK, silly question but have you tried another DS1307 RTC chip ? While rare, maybe part of that one is damaged? I've used that RTC for years and never had a problem. There's a 'driver' for it in the CCS package or in the 'code library' here. The 4K7 pullups are should be fine for 5 volts but I use 3k3.

Also there might be a 'bug' in the driver you're using, perhaps a mislabeled variable or the correct one misused ?

Another way to attack it is to use a spare I/O pin as a serial output and send the data to a PC running a terminal program. You'll need a max232 type chip on the O/P to the PC but it should be easy enough to hack in for test purposes. I always dedicate one pin to be for 'test' LED / 'serial output'.

Without the real hardware and code it is difficult to troubleshoot 'over the internet.

Jay
AnthonyRFC



Joined: 21 Jun 2015
Posts: 16
Location: Venezuela

View user's profile Send private message

PostPosted: Sun Mar 13, 2016 7:31 am     Reply with quote

Hi all:

I could finally fix the problem using:

Code:

#define USE_INTERRUPTS 1



That line tells to the library to disable all interrupts during the reading process of the DS1307.


I hope this can help others with the same problem.

Best regards,

Anthony
_________________
From CumanĂ¡, Venezuela.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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