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.
#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:
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:
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.
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.
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:
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: