Ds1302 battery dead in just a few days
Sutton Murray
Posts: 88
On projects of mine i have found that the battery ran down quickly in just a few days.
Confident with myself that my diagram is correct i turned to the data sheet. I Read about the trickle charge command, but don't know how to implement it. Is my problem with the quick dying batteries the reason to the trickle charge not being activated?
Am i correct in thinking that the command must be issued only ones at the initialization period. After this i don't have to run the command again? Will the command solve my problem?
Is the command below correct?
SHIFTOUT 2, 1, LSBFIRST, [noparse][[/noparse]$091 | (ADR<<1)\8] '$091 or %10010001
Confident with myself that my diagram is correct i turned to the data sheet. I Read about the trickle charge command, but don't know how to implement it. Is my problem with the quick dying batteries the reason to the trickle charge not being activated?
Am i correct in thinking that the command must be issued only ones at the initialization period. After this i don't have to run the command again? Will the command solve my problem?
Is the command below correct?
SHIFTOUT 2, 1, LSBFIRST, [noparse][[/noparse]$091 | (ADR<<1)\8] '$091 or %10010001
Comments
Try this,
cheers,
Chris, West Oz...
···· TIMER.LOWBYTE = %10100111
·····TIMER.HIGHBYTE = %01000·· 'enable trickle charger, 1 diode, 8K resistor
·····GOSUB writeRTC
· WRITERTC:
····· HIGH Res1302
····· SHIFTOUT datapin, clock, LSBFIRST, [noparse][[/noparse]%0\1,TIMER.HIGHBYTE\5,%10\2,TIMER.LOWBYTE]
····· LOW Res1302
····· RETURN
Are you sure you even want a battery?· The documents mention using a Super Capacitor.
Even then, trickle charge rate is determined by different factor for different battery chemistry. It isn't the same for lead acid, lithium, and NiMH. Kind and Size are important.
Personally I would use a NiMH or NiCad pack that is intended to replace the rechargible batteries in a cordless phone. You can get a 600ma 4.8 volt version and 1/25th to 1/30th of that is the trickle charge rate.· That fits to the 2.2ma maximum.
Lithium is nicer because it is smaller, but need a more sophisticate system to monitor charge and discharge.
Super Cap seems to be a good way to go.· But if you have long down times, it may not provide enough.
And it always helps to fully charge the battery before you use it. NiMH and NiCad don't hold a charge very long - 3 to 6 months.· Directly from the store, they are usually in need of topping off.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
Post Edited (Kramer) : 9/27/2007 5:07:28 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Ford is my code incorrect? I will try yours thanks.
From the statements given i conclude that my problem, the quickly dying battery should not occur. The CR2032 must not be active in a trickle charge state.
Any other reasons for the battery to die quickly?
Should the I/O lines be set as an output or input lines at the initialization stage. Will this have any prevention act for a quick dying battery?
Test is by taking out the battery of cap, from the pin 1 (vcc2) of your DS1302, turn it on and measure the voltage between this pin and ground. if this is Zero or below 3.6V you have it set to zero.
Dont complicate your program, turn it on by
HIGH CE
SHIFTOUT IO, CLK, LSBFIRST, [noparse][[/noparse]$90,$A5] ´this sets to 4,3V and 2,15 mA
LOW CE
hope to help.
Amaral
I have the DS1302 connected with the voltage supply to pin1(vcc2) and the Battery to pin8(vcc1). This is the other way around as described by you. Is this a problem?
With my battery removed from the pin8(vcc1) a get a reading of 4.62V. Should this be zero? Your code will this set it to zero?
The pins are correct your way !
with my code , you should have 4.6V! that´s correct too !
have you tried to mesure before running the code ?
because now everything seems right
Amaral
The 4.6V output from the DS1302, isn't this the reason for flattening the battery. Shouldn't their be a 0 Volt out put from the Ds1302?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For in much wisdom is much grief, and he who increases knowledge increases sorrow." ~Ecclesiastes 1:18
It's mentioned in the datasheet, but they only go on about using a super-cap/rechargeable and don't drop the other shoe,·with explicit info regarding a non-rechargeable battery situation,·in the AppKit Notes.
Check out the chip docs to determine how to do that. It's POSSIBLE all you have to do is disconnect the backup battery, un-power the 1302, and on power up it'll reset itself back to the default. After that, DO NOT turn on trickle charging (edit your code to make sure you don't), apparently that will kill a 2032 coin cell.
I have tried your advice. I have disconnected the battery, didn't work. Made sure nothing is in the code to trigger the charge. Then i changed the DS1302 with another DS1302. This worked the voltage on the battery pin 8 of the chip now had a 0 volts reading. Replacing the old DS1302 in the same circuit and code, still have the 4.6volt output reading on pin 8.
Now how is this possible?
I know that the chip has ram on it that will loose the data when the battery has been disconnected. My guess is that the chip must have a small portion of EEPROM for basic functions. Well does it? Has previous code of mine activated this to be stored on EEPROM of the DS1302, causing the continuous charge activity. I have been playing around a lot aiming getting the RAM of the DS1302 to function in my program.
How will i go about in fixing this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For in much wisdom is much grief, and he who increases knowledge increases sorrow." ~Ecclesiastes 1:18
patterns will disable the trickle charger. The DS1302 powers up with the trickle charger disabled.
Of course, one of your 1302's may be a deceased DS1302...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Post Edited (pwillard) : 10/1/2007 7:20:19 PM GMT
to disable that you have to:
HIGH CE
SHIFTOUT IO, CLK, LSBFIRST, [noparse][[/noparse]$90,$00] ´this sets to 0V, none resistors or diodes select
LOW CE
Yes It is stored in a ROM (EEPROM MEMORY) that keeps the information !
Sorry about leaving this tread for a while ! my work does not let me play a lot !
Hope to Help
Amaral
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Sorry you all , I´ve to take longer time to post an answear !
on the documentation it says: "The DS1302 powers up with the trickle charger disabled."
it should be 0V ! otherwise it may be damaged !
Amaral