RTC's SDA and SCL Resistors

Hi!
I’m installing a real-time clock (RTC) on Beaglbone Black and I’m seeing divergent information abount hardware of the DS1307 integrated circuit, that operates at 5V voltage, while the I2C IO buses of the BeagleBone operate at 3.3V.

In the Adafruit RTC, they indicate removing the SCL and SDA resistors from the DS1305 kit as shown here:
[https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/wiring-the -rtc](https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/wiring-the -rtc)

In linux.org, nothing is reported about the resistors and there are other places that also do not say anything about the resistors:
http://elinux.org/Adafruit:_RTC_DS1307

Question:
Should I keep the SCL and SDA resistors? Or should I remove the resistors?

Connect the pullup resistors to 3v3.

Regards,
John

Just to be clear, the Adafruit module has 2k2 resistors to 5V. These must be removed. However, the BBB still needs pullup resistors to 3v3.

Regards,
John

John, I get it. But I do not know how it would be possible to do this in my DS1307 module which is of this type:
http://www.ebay.com/itm/5-PCS-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-For-AVR-ARM-PIC-/172308340060?epid=846722400&hash=item281e609d5c:g:VxcAAOSwawpXsn0J

How would It connect to 3.3V hardware instead of 5V?

Thank you again!

The page you’ve linked is 404. But . .

#1 3v3 is the absolute max you want to put on any beaglebone I/O pins ADC lines are max 1v8

#2 If those are pullups, you have to have pullups on any I2C SCL / SDA line.

You need to read the datasheet for that part. If in fact the I2C data and clock lines are 5v, you’ve got the wrong part. However, I wouldn’t be surprised if that part could also be powered by 3v3 too. One wire RTC’s can also functionally be powered by multiple voltages. At least the one I’m using( DS3232 ).

OK, if you read the datasheet, you will see VIH = 2v2 and VIL = 0v8, which means the I2C signals are compatible with a 3v3 pullups. The module you referenced has pullup resistors to 5v0, which means they must be removed. There are voltage convertors from TI for I2C devices, but in this case they are not required. However, if you want to leave the 5v0 pullup resistors on the module, then you must use one of these voltage translators. Here is an example:

https://www.sparkfun.com/products/11955

Regards,
John

Here is what I used:

https://www.seeedstudio.com/Grove-High-Precision-RTC-p-2741.html

I’m using the Greens so it conveniently plugs in to the Grove connector. The lithium coin cell was not available at the local stores and I had to order via Amazon.
This device uses 3.3V battery and it is plug-n-play with regards to the hardware. The Beagleboard distributions include a driver for it.

In addition to confusion with logic voltages, the Linux ecosystem for RTCs is pretty confusing as well. The man pages have outdated or insufficient information.
It was possible to get the RTC to work without touching the Device Tree.

I’ve got the RTC to work and it is timing my irrigation control system reasonably well. I’m still not confident with what I am doing with the hwclock command.
I’ve documented what I did in the PDF file page 26:

https://github.com/Greg-R/irrigate-control/tree/master/doc/latex

Good luck with the RTC and please share you results here!

Regards,
Greg

This looks like a much better solution given that this module is powered from 3v3.

Regards,
John

I have 2 of them running here connected to BBGWs and performance is satisfactory so far.

I’m convinced that the PCA9306 and the RTC PHILIPS PCF85063TP are excellent solutions. However, removing the resistors I think is not good. I’m going to use the bidirectional I2C-bus translator because it’s easier to find where I live.

Thank you everyone for the attention.

PS: William Hermans, the link is working fine for me. I don’t understand why it didn’t work for you… No problem!
http://www.ebay.com/itm/5-PCS-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-For-AVR-ARM-PIC-/172308340060?epid=846722400&hash=item281e609d5c:g:VxcAAOSwawpXsn0J

Hi!
I bought the I2C logic converter 3.3V => 5v and I’ve connected the RTC to the BBB, but running “i2cdetect -y -r 1” doesn’t find the RTC device. I’ve checked the wiring of the connections and I repeated the process a few times, but it doesn’t detect the RTC.

Any suggestion?

#1 You're sure you're connected to I2C-1 ?
#2 Did you load the device tree to get I2C-1 active ? It's not enabled by
default.

What version of Debian are you running.

On Debian 8, what was in the docs as I2C-1 is now I2C-2.

Hook your translator to pins P9-19 and P9-20 and run “i2cdetect -y -r 2”

I2C-2 is enabled in the device tree by default.

— Graham

It’s not so much the debian version, as it is the kernel. kernel 3.8.x is different from kernel 4.x. The easiest way to see what is attached it this:
root@wgd:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter

Grahan:
You’re 100% correct. Running “i2cdetect -y -r 2” instead of “1” at the end, it detected the RTC at address 0x68, as we can see in the available tutorials.
Answering your question, I’m using the latest available Debian release (bone-debian-8.8-iot-armhf-2017-07-01-4gb.img) available here:
https://rcn-ee.net/rootfs/bb.org/testing/2017-07-01/iot/

William Hermans:
When I run the command “i2cdetect -l”, I get this information:

root@beaglebone:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter

Now I can continue with the process normally and as soon as it works I report here.

Thank you again!!!

William B:

If you are using older code examples, now just change all references to I2C-1 to become I2C-2 and you should be on your way.

— Graham

Ok! Thanks for the tip!

Sounds about right . ..
root@wgd:~# cat /sys/bus/i2c/devices/2-0068/name
ds3232

Funny, I'm actually using an i2c RTC, forgot, and confused the temp sensor
I'm using over one wire. By the way, the DS3232 is also an accurate RTC,
but it does cost like $8.xx per. So not exactly cheap.

Is there any other difference in this latest version of Debian? I’m following a tutorial below, but the command “hwclock -r -f /dev/rtc1” is indicating failure to communicate with the new device:

TUTORIAL:
https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/set-rtc-time

ERROR:
root@beaglebone:~# hwclock -r -f /dev/rtc1
hwclock: Cannot access the Hardware Clock via any known method.

DEVICES:
root@beaglebone:/# ls -la /sys/bus/i2c/devices
total 0
drwxr-xr-x 2 root root 0 Jul 27 20:19 .
drwxr-xr-x 4 root root 0 Jul 27 20:19 …
lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0024 → …/…/…/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024
lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0034 → …/…/…/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0034
lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0050 → …/…/…/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050
lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0070 → …/…/…/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0070
lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0054 → …/…/…/devices/platform/ocp/4819c000.i2c/i2c-2/2-0054
lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0055 → …/…/…/devices/platform/ocp/4819c000.i2c/i2c-2/2-0055
lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0056 → …/…/…/devices/platform/ocp/4819c000.i2c/i2c-2/2-0056
lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0057 → …/…/…/devices/platform/ocp/4819c000.i2c/i2c-2/2-0057
lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-0 → …/…/…/devices/platform/ocp/44e0b000.i2c/i2c-0
lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-1 → …/…/…/devices/platform/ocp/4802a000.i2c/i2c-1
lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-2 → …/…/…/devices/platform/ocp/4819c000.i2c/i2c-2

Just adding:

root@beaglebone:/# i2cdetect -y -r 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: 50 – -- – UU UU UU UU – -- – -- – -- – --
60: – -- – -- – -- – -- 68 – -- – -- – -- –
70: – -- – -- – -- – --