One of the new “toys” I bought for Charlie is an Adafruit hardware RTC module for the Pi. They come in two varieties, ones with female headers that push down on the first six GPIO pins, and ones with open solder holes that can be placed where convenient and wired to the i2c buss.
There are also “plain vanilla” and “high precision” varieties.
The main reason I want to do this is so that - among other things - my logs make sense. As it is, especially in DexterOS, the dates/times in the logs are meaningless which makes the data virtually impossible to analyze in any meaningful way.
Question 1:
What i2c addresses are used by the GoPiGo and it’s associated add-on boards, such as the IMU board or the distance sensor? The Adafruit hardware RTC boards use 0x68 as their i2c address - will that conflict with anything on the GoPiGo?
Question 2:
Though I am sure I could make this work in Raspbian for Robots, has anyone tried implementing a hardware RTC in DexterOS?
# The I2C address is software programmable (volatile), and defaults to 0x52 >> 1 = 0x29.
# __init__ changes the address (default to 0x54 >> 1 = 0x2A) to prevent conflicts.
ADDRESS = ADDRESS_DEFAULT
def __init__(self, address = 0x2A, timeout = 0.5, bus = "RPI_1SW"):
Thank you for mentioning I2C address 0x68. I thought I recognized that address, it turns out to be the same address the MPU-9250 IMU uses. I bought the 9250 IMU because it is $8.50 and received a slightly better review than the BNO055 of the DI IMU, but I had a typo (0x6B) instead of 0x68 that I have been chasing for an hour this morning. To save $20, I will probably have to spend a month writing the GoPiGo3 interface.
So, the IMU used 0x68? That’s bad. That’s what the RTC is programed to use, baked into the kernel. Can it be reprogrammed to use a different, non-conflicting address?
I, myself, would be wary of using an i2c address that is already allocated as a standard address for something else and baked into the kernel all the way back to the kernel maintainers.
While I haven’t tested this, I know you can put the IMU in one of the AD Ports, which puts it in a different I2C bus than the Pi default. So there would be no conflict.
To be tested, though.