Page 1 of 1
When RTC battery dies
Posted: Thu Oct 29, 2015 2:20 pm
by fruit-uk
I have a number of Pis with added RTC modules, mostly DS1307 I think.
Most, if not all, of these modules come with a warning not to use without first installing an appropriate button cell.
Fine, no problem with that, but after two or three years these may become depleted.
Is there then a chance that a depleted battery might damage the module in the same way as no battery at all?
I'm wondering if I should check them periodically.
I haven't been able to find anything specific to this from a search
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 2:27 pm
by gordon77
Sorry I don't know the answer, I would assume it's no problem as you only need the battery to keep the time,
but can you get your RTC to work with Jessie ?
If so how ?
Thanks
Gordon
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 2:45 pm
by fruit-uk
Mm... well some speak of damage to the RTC IC - hence my question.
WRT jessie, I am just setting up a new Pi2 with a fresh jessie install and hoping my new 1-wire + RTC module will arrive later today so no idea yet whether I can get it work.
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 2:48 pm
by DougieLawson
If you write some data to the NVRAM on your DS1307 you can read it back every day. When the data disappears your battery has gone flat.
cat /sys/bus/i2c/devices/1-0068/nvram
sudo sh -c 'echo "Kilroy was here "`date +"%F"` > /sys/bus/i2c/devices/1-0068/nvram'
cat /sys/bus/i2c/devices/1-0068/nvram
BTW, on Jessie with the 4.1.12 kernel rtc-ds1307 isn't getting loaded by the device tree, so my RTC doesn't work until I use
sudo modprobe rtc-ds1307;sudo modprobe i2c-bcm2708
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 2:54 pm
by jojopi
fruit-uk wrote:Is there then a chance that a depleted battery might damage the module in the same way as no battery at all?
I do not think the module will be damaged without a battery, it just will not work reliably.
The datasheet says that if you do not want battery backup, Vbat must be grounded. Internally the chip compares Vcc to 1.25×Vbat to determine when the power is failing. Having Vbat floating makes this comparison nonsense, so the I²C interface may shut down spuriously. The module will not respond correctly to commands if no battery is fitted.
A flat battery is more like a short to ground than a high impedance, so it should not be a problem. Of course the device will forget the time if the power fails and the battery is also dead.
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 3:24 pm
by fruit-uk
DougieLawson wrote:If you write some data to the NVRAM on your DS1307 you can read it back every day. When the data disappears your battery has gone flat.
Indeed and that is something I consider doing.
BTW, on Jessie with the 4.1.12 kernel rtc-ds1307 isn't getting loaded by the device tree, so my RTC doesn't work until I use
sudo modprobe rtc-ds1307;sudo modprobe i2c-bcm2708
I saw that in a previous post of yours.
I assume it's OK to add to /etc/modules - which I've done, they are all loaded - just need the RTC now
jojopi wrote:I do not think the module will be damaged without a battery, it just will not work reliably.
Odd they have worded the warning in that way then - perhaps they have all copied and pasted each other
Thanks both
Re: When RTC battery dies
Posted: Thu Oct 29, 2015 6:31 pm
by fruit-uk
Well, my 1-wire module with RTC arrived but getting it to work across a boot was a pain and as yet there is nothing definitive and in one place for jessie on the forum (and now here's another one!) - other than that your specific RTC module should be compiled in the kernel!
At the moment I have it working by following this page
http://afterthoughtsoftware.com/products/rasclock and commenting out
Code: Select all
if [ -e /run/systemd/system ] ; then
exit 0
fi
in /lib/udev/hwclock-set - after saving a good copy of course.
Need to enable appropriate parameters as listed in /boot/overlays/README in config.txt
and add appropriate modules to /etc/modules of course
So far it has survived several reboots
