Has anyone added an RTC


#21

Pretty sure the resisters were acting as pull-ups. Sorry I misunderstood and thought perhaps the eeprom you mentioned as something on board the BPI-R2. I am running 4.14 compiled after a checkout from your repo. I do see error -110 in the dmesg output after attempting to insert the device via echo > new_device.

I might just try grabbing another module designed for a RPI where everything is expecting 3v logic based on your clarification, as I don’t have anything else to test this module out with.


(sam shih) #22

Maybe you got a broken module ? I bought 4 module from the network, but I got one of it missing the ds1307… image


(Prakash) #23

Hi. I am trying to use i2c1 on pin 3 &5. My β€œi2cdetect -y 1” not detected my I2C module. I already loaded i2c-dev and ds1307 modules.

#i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f

00: – -- – -- – -- – -- – -- – -- –

10: – -- – -- – -- – -- – -- – -- – -- – --

20: – -- – -- – -- – -- – -- – -- – -- – --

30: – -- – -- – -- – -- – -- – -- – -- – --

40: – -- – -- – -- – -- – -- – -- – -- – --

50: – -- – -- – -- – -- – -- – -- – -- – --

60: – -- – -- – -- – -- – -- – -- – -- – --

70: – -- – -- – -- – --

TIA.


(sam shih) #24

I used i2c0 for testing my RTC.
Thanks for @frank-w, My module works fine now
(My RTC modules is β€œTiny RTC I2C modules”)
image

Steps:

  1. I have removed pull-ups on DS1307 (@frank-w’s reply β€œremoving pullups R2 and R3 on β€œtiny RTC”” )
  2. Use @frank-w’s step to compile linux image (DTS, kernel config…etc)
  3. Connect RTC modules to BPIR2 in follow way: (Notice: connect 5v to vcc, don’t use 3.3v)
    (Please confirm the DS1307 chip exist on your module :smile: ) image
  4. Use the command i2cdetect -y -r -a 0 to scan the i2c bus 0 (/dev/i2c-0) --> β€œ0x68”
  5. modprobe rtc-ds1307
    echo ds1307 0x68 > /sys/bus/i2c/devices/i2c-0/new_device
    cat /sys/bus/i2c/devices/i2c-0/0-0068/rtc/rtc0/time
  6. Use the command date, hwclock -w and hwclock -r to test your module

(Prakash) #25

Hi. I am Frank’s 4.14.28 kernel and I can find that the I2C0 & I2C1 are exist on /dev/. However, i2cdetect -y 0/1 detected nothing. I am using 420mA Serial to I2C converter. I confirmed that my I2C module is working fine on RPI board. So I assume, I no need to worry up the pullups.

For experiment, I also tried with DS3231 RTC module. Still it is not detected anything on the I2C port.

TIA.


(xbgmsharp) #26

I have an issue on BPi-R2 and time is always behind. After one night the clock is 15minutes behind current time. I have sync (ntp) the time yesterday after boot as it was 1 week behind current time. How come the BPI-R2 is always behind current time? I have β€œRTC_DRV_DS1307” enable in the kernel. Do i have to buy a physical new card for RTC (Real Time Clock) ?

Is that the same as for BPI-R1, https://bananapi.gitbooks.io/bpi-accessories/content/en/rtcmodule.html?


(Frank W.) #27

For external rtc you need an external board like ds1307 but care about the data-levels (5v are not good for pi-pins which are operating with 3v3)