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 support@ccsinfo.com

ds1302 probleme with save

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



Joined: 16 Jul 2004
Posts: 6

View user's profile Send private message

ds1302 probleme with save
PostPosted: Wed Jul 28, 2004 2:10 am     Reply with quote

hello!
I have a program with my pic16f877 and a RTC ds1302 who work but when the power is off, th date is not saved
I think is necessary to program the "battery" betwwen PIN8 and VCC???
who can help me please?
can you give me the source code to program the battery of my ds1302??
sorry for my english, I'm french..
thank you!
Ttelmah
Guest







Re: ds1302 probleme with save
PostPosted: Wed Jul 28, 2004 2:30 am     Reply with quote

nicolas33290 wrote:
hello!
I have a program with my pic16f877 and a RTC ds1302 who work but when the power is off, th date is not saved
I think is necessary to program the "battery" betwwen PIN8 and VCC???
who can help me please?
can you give me the source code to program the battery of my ds1302??
sorry for my english, I'm french..
thank you!

You don't 'program' the battery. However you do program the _charging_ options for the battery. This will depend on what type of battery you have attached. The same applies with regards to selecting the number of 'diodes' to be enabled in the chain from the battery terminal.
You need to say what type of battery you have attached, and then somebody can tell you what needs to go into the charge control register.

Best Wishes
nicolas33290



Joined: 16 Jul 2004
Posts: 6

View user's profile Send private message

nicolas33290
PostPosted: Wed Jul 28, 2004 2:52 am     Reply with quote

the battery is a : 1F / 5.5V
and she is placed between VCC1 and GND
ans I surch a program to control the battery
can you help me?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Jul 28, 2004 6:05 am     Reply with quote

This would be a Super Capacitor instead of a battery.
nicolas33290



Joined: 16 Jul 2004
Posts: 6

View user's profile Send private message

nicolas33290
PostPosted: Wed Jul 28, 2004 6:19 am     Reply with quote

yes, it is a super capacitor
can you help me please?
and what resistor and diode I must choose??
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Jul 28, 2004 6:36 am     Reply with quote

From the datasheet:
Quote:

Diode and resistor selection is determined by the user according to the maximum current desired for
battery or super cap charging. The maximum charging current can be calculated as illustrated in the
following example. Assume that a system power supply of 5V is applied to VCC2 and a super cap is
connected to VCC1. Also assume that the trickle charger has been enabled with one diode and resistor R1
between VCC2 and VCC1. The maximum current IMAX would, therefore, be calculated as follows:
IMAX = (5.0V - diode drop)/R1  (5.0V - 0.7V) / 2kΩ  2.2mA
As the super cap charges, the voltage drop between VCC1 and VCC2 will decrease and, therefore, the
charge current will decrease.


So for this example you would use 10100101 or 0xA5 for the Trickle Charge register.
nicolas33290



Joined: 16 Jul 2004
Posts: 6

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 8:35 am     Reply with quote

ok thank you, but can you write me the few lines of the code please??
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