DS1302 backup via capacitor or battery / batteries
JC68
Posts: 19
i have built a bs2 circuit that currently uses the DS1302, Sensirion SHT1x, HD44780 LCD, and a parallel to serial chip from PHA for the LCD to BS2 connection.· for the most part, all is well.
i would like to implement the DS1302 trickle charge ability into the circuit but can't really find the info i am looking for.· i came across chris savages great DS1320 demo and code (where he mentions specifically not covering the charge mode).
i have also checked the DS1302 data sheet.
i have also come across many sources saying "just use a 3v lithium coin battery, it will last for 10 years"
i would like to use a capacitor but am not sure how to wire the components.· the data sheet mentions 1 or 2 diodes, and 1 or 2 resistors.· i am confused as to why/how you would use 2 and not 1...? also, do i just use diode specs to figure out which one is best as it doesn't say what to use, like it does the resistors at 2k 4k and 8k.
also when they say to connect diode between vcc2 and vcc1 could i literally solder it in place?· if diode goes from pin 1 to pin 8 how do i put in resistor?
figure 5 of data sheet shows:
vcc2--diode--resistor--vcc1
but doesn't show cap or batteries. do i just place the capacitor's anode between the resistor and vcc1 with the capacitors cathode to vss?
does anybody have any advice or maybe a pic of their wiring?
for what it's worth i have diodes·1N4001 (276-1101 / radio shack) and Rectifier Diodes (276-1114 / radio shack).· on capacitors i have a 1uF (272-996 / radio shack)
thanks in advance!
i would like to implement the DS1302 trickle charge ability into the circuit but can't really find the info i am looking for.· i came across chris savages great DS1320 demo and code (where he mentions specifically not covering the charge mode).
i have also checked the DS1302 data sheet.
i have also come across many sources saying "just use a 3v lithium coin battery, it will last for 10 years"
i would like to use a capacitor but am not sure how to wire the components.· the data sheet mentions 1 or 2 diodes, and 1 or 2 resistors.· i am confused as to why/how you would use 2 and not 1...? also, do i just use diode specs to figure out which one is best as it doesn't say what to use, like it does the resistors at 2k 4k and 8k.
also when they say to connect diode between vcc2 and vcc1 could i literally solder it in place?· if diode goes from pin 1 to pin 8 how do i put in resistor?
figure 5 of data sheet shows:
vcc2--diode--resistor--vcc1
but doesn't show cap or batteries. do i just place the capacitor's anode between the resistor and vcc1 with the capacitors cathode to vss?
does anybody have any advice or maybe a pic of their wiring?
for what it's worth i have diodes·1N4001 (276-1101 / radio shack) and Rectifier Diodes (276-1114 / radio shack).· on capacitors i have a 1uF (272-996 / radio shack)
thanks in advance!
Comments
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
and for what it's worth, it's already on a battery but putting positive to vcc1 and ground to vss took 10 secs and i didn't really learn what i wanted too...
anybody have any advice, diagrams, or pics...?
thanks again!!
Most of the information is in the datasheet…The main things you need to know are what the diodes and resistors do…You select diodes to drop the voltage and resistors to limit the charging current. Both are available since the charging circuit can accommodate NiCad batteries as well as Supercaps. Both affect the charging current as well as the voltage drop. Page 4 of the datasheet tells you how to calculate these numbers. Since the supercaps are just a high-capacity storage device you really don’t need to worry so much about charging current. If the supercap is rated at 5V you shouldn’t need to worry about the diodes either. You should be able to just enable charging with 1 diode and all three resistors selected. With a NiCad battery you might want to limit one or both parameters. Page 7 shows a functional diagram of how the circuit works. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I might also add that, in this case, the diodes also perform the function of keeping the current flowing in the direction that you want it to as the voltage conditions change.
JC68,
I would also recommend going through the "What's a Microcontroller?" text to help you understand the principles involved with what you want to do. Having those bits of knowledge can't help but be useful as you continue on the road to microcontrollerelectronicenjoyment (and it's free, too!).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Based on the simplified diagram I would’ve probably thought that too, but a previous discussion with a Dallas Engineer indicates that when the backup power is used that whole section is disconnected by the power control circuitry. The resistors and diode should never see any voltage/current. They don’t really show a functional block of power control. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The diodes and resistors are built into the DS1302. As far as connecting things, all you have to do is connect your backup device to Vcc1 and ground whether it's a rechargable battery, super capacitor, or lithium coin cell. The trick is telling the DS1302 to charge the device if it's rechargable. There's an example worked out for a 5V super capacitor on page 7 of the datasheet. For other devices, it really depends on their operating voltage and charging current.
I used the use the charging circuit on the DS1302 back when the chip first came out. Back then I had a pretty good relationship with several companies such as Dallas (who wasn’t part of Maxim then) as a developer. I understand the diodes and resistors are internal and I was trying to explain how to use them. I also referred to the example on the datasheet. I still agree with Newzed on the coin cell battery. I stopped using the charging circuit many years ago and just place a CR2032 battery in the circuit now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support