View previous topic :: View next topic |
Author |
Message |
nicolas33290
Joined: 16 Jul 2004 Posts: 6
|
ds1302 probleme with save |
Posted: Wed Jul 28, 2004 2:10 am |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
Re: ds1302 probleme with save |
Posted: Wed Jul 28, 2004 2:30 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
nicolas33290
Joined: 16 Jul 2004 Posts: 6
|
nicolas33290 |
Posted: Wed Jul 28, 2004 2:52 am |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jul 28, 2004 6:05 am |
|
|
This would be a Super Capacitor instead of a battery. |
|
![](templates/subSilver/images/spacer.gif) |
nicolas33290
Joined: 16 Jul 2004 Posts: 6
|
nicolas33290 |
Posted: Wed Jul 28, 2004 6:19 am |
|
|
yes, it is a super capacitor
can you help me please?
and what resistor and diode I must choose?? |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jul 28, 2004 6:36 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
nicolas33290
Joined: 16 Jul 2004 Posts: 6
|
|
Posted: Wed Jul 28, 2004 8:35 am |
|
|
ok thank you, but can you write me the few lines of the code please?? |
|
![](templates/subSilver/images/spacer.gif) |
|