View: 37651|Reply: 24

RTC battery interface

[Copy link]

17

threads

212

posts

1420

credits

Gold member

Rank: 6Rank: 6

credits
1420
Published in 2015-4-19 20:43:47 | Show all floors |Read mode
Hi guys,

I would like to know if there's something special to do (software or else) if we want to plug a such battery (CR032) to keep the time of the OPi (normal model).
I will maybe use it with Android.
Link: https://www.adafruit.com/products/1870

Thanks

2

threads

17

posts

96

credits

Registered member

Rank: 2

credits
96
Published in 2015-12-30 18:30:44 | Show all floors
hello

I want to came back to RTC on Orange Pi2. I want to install Orange Pi2 with KODI and CARPC at car but i need RTC with battery to hold power and clolck settings at orange pi board. I bougth DS3231 and i don`t knew how to activate it on Raspberian and Android.

5

threads

29

posts

933

credits

Senior member

Rank: 4

credits
933
Published in 2015-4-20 03:00:55 | Show all floors
Edited by Tyrannus at 2015-4-19 20:24

hi gaara....

I think this bat-connectors is for the PMU(AXP209????).
9.4 Backup battery
The AXP209 supports backup battery char
ging and discharge. When no main power(BAT/ACIN/VBUS)
is available, LDO1 will choose the backup battery to support the operation of some circuits, such as the
system real-time clock, etc.
When there is a main power, REG35H[7] can be set to charge the back
up battery, whose target voltage
is 3.0V by default (adjustable via REG35H[6:5]) and charge current is 200uA by default ( adjustable via
REG35H[1:0]).


pls check with an Multimeter if voltage present.
if you have on this connectors ~0,3V dont plug a simply CR032 on it.
On this way use a rechargeable VL-2020.


if you have connected the battery, you should disconnect the Inet connection from OPI and restart,
clock and date set up manually as needed and start again without inet.

If time/date correct hiphip hurra ...else.... coming soon

regards Mike

17

threads

212

posts

1420

credits

Gold member

Rank: 6Rank: 6

credits
1420
 Author| Published in 2015-4-20 15:45:28 | Show all floors
Hi Tyrannus, thx so much, I was going to do a silly thing...
I will verify today with my multimeter but I think you're right.

17

threads

212

posts

1420

credits

Gold member

Rank: 6Rank: 6

credits
1420
 Author| Published in 2015-6-3 15:27:54 | Show all floors
Edited by gaara at 2015-6-3 09:29

I have tried with a Sanyo UR18650A cell (from an old battery) and it works.
It keeps the hour in Android, even if the power bord is unplugged.
Thanks for your help !

1

threads

2

posts

29

credits

Novice

Rank: 1

credits
29
Published in 2015-11-30 11:47:22 | Show all floors
Hi gaara, could you elaborate on how to put the cell battery on OrangePI in Android?

I've tried to connect CR032 to the exposed RTC pad and Ground PIN - but it does not work

0

threads

3

posts

100

credits

Registered member

Rank: 2

credits
100
Published in 2016-1-28 12:27:14 | Show all floors
lizi0 replied at 2015-12-30 18:30
hello

I want to came back to RTC on Orange Pi2. I want to install Orange Pi2 with KODI and CARPC at ...

See this (russian text with image): http://www.itcooky.com/?p=4023

1

threads

64

posts

240

credits

Intermediate member

Rank: 3Rank: 3

credits
240
Published in 2016-2-1 17:42:35 | Show all floors
It is possible to add any ds1307 (I2C intf.) real-time clock to any 2nd generation OPi  - just following the instructions from https://learn.adafruit.com/addin ... -black/set-rtc-time with several exceptions:
- kernel will enumerate I2C device to /dev/rtc1 because /dev/rtc0 is occupied by built-in Allwinner's RTC (sunxi-rtc)
That means you have to modify a symlink "/dev/rtc" to point to /dev/rtc1 instead of /dev/rtc0 like this: sudo ln -f -s /dev/rtc1 /dev/rtc

After that standard hwclock will work fine, however I recommend to use an init-script to make sure time is automatically adjusted. Here is mine (/etc/init.d/rtc_ds1307)

#! /bin/sh
### BEGIN INIT INFO
# Provides:          rtc_ds1307
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: DS1307 real-time clock usage script
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

# Author: Alexander Golenshin <shooreg@gmail.com>

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="ds1307_rtc maintenance service"

do_start()
{
        echo "Selecting correct  RTC instance "
        echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device
        sudo ln -f -s /dev/rtc1 /dev/rtc
        echo "Syncing system time to RTC"
        sudo hwclock -s
}

do_stop()
{
        echo "Syncing RTC to system time"
        sudo hwclock -w
}

case "$1" in
  start)
        do_start
        ;;
  stop)
        do_stop
        ;;
  status)
        echo "RTC time:"
        hwclock -r
        echo "System time:"
        date
        ;;
  restart|force-reload)
        do_stop
        ;;
  *)
        echo "Usage: rtc_ds1307 {start|stop|status|restart}" >&2
        exit 3
        ;;
esac

:

1

threads

64

posts

240

credits

Intermediate member

Rank: 3Rank: 3

credits
240
Published in 2016-2-1 17:50:58 | Show all floors
As to the built-in RTC, it is working, actually, but to supply power to it I tried this:
- applied 3.3v to rtc labeled pad = rtc preserves it's data, but the board denies to restart after reapplying main power
- applied 3.3v to corresponding pins on GPIO header = rtc preserves it's data and starts normally, but draining "aux" current is about 30-35mA which is too much for a rtc battery

So with TinyRTC-like modules costing less than a 1$ I think it is not worth modding the board...

1

threads

40

posts

269

credits

Intermediate member

Rank: 3Rank: 3

credits
269
Published in 2016-5-16 23:03:59 | Show all floors
Until I get the external RTC module and I set it up to work with the Beelink v1.1, could you let me know which are the GPIO pins that correspond to the external power source that feeds the RTC?
I have a battery that it is 3.7 2000mAH that I would like to test meanwhile.

I have been trying to use any Android software that could get the date from the GPS (which I can read via bluetooth), but I could not get any working correctly to set up the system's time.

Thanks
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list