Hi Alex,
I evaluated the MAX31328 and it was just perfect, apart from the footprint being slightly too large for what I wanted and that I need an external source of backup power to keep it running. So I looked again and found the RV-3028-C7 which is 1ppm, consumes 45nA and has an integral trickle charger for a supercap or hybrid. I chose a micro-supercap [upload|VazGLZMysDbolkNxzeGRa+i4zU8=] which is a Seiko CPH3225A. It was a snap to lay this out [upload|gms3dATGqxp52r0RSIROJ4r075o=]
There was a driver available from the makers of the RV-3028-C7, and there is an evaluation board. So I got both. Plugged the evaluation unit into the I2C (it has its own pull up resistors and I expected to have to whip these off, but I tried before doing that and it seems to be fine)
To install it in Torizon was a 5 minute job, I didn’t need to install the driver:
The thing seems “compatible” with the ds3231 but on address x52. Changes were made to the device tree (imx8qxp-colibri-eval-v3.dts) as follows
&i2c1 {
status = "okay";
rtc_i2c: rtc@52 {
compatible = "maxim,ds3231";
reg = <0x52>;
status = "okay";
};
};
The RTC boot up rules are stored in file /etc/udev/rules.d/99-rtc1.rules
A new file was created with a single line to guide boot up phase.
KERNEL==“rtc0”, SUBSYSTEM==“rtc”, DRIVER==“rtc-ds1307”, ATTR{name}==“rtc-rv3028”, SYMLINK=“rtc”, MODE=“0666”
he system was re-booted and some initial tests were performed:
◦ colibri-imx8x-06800883:~$ sudo hwclock -v -f /dev/rtc0
hwclock from util-linux 2.35.1
System Time: 1621467202.801072
Using the rtc interface to the clock.
Last drift adjustment done at 1620669420 seconds after 1969
Last calibration done at 1620669420 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2021/05/19 23:33:24
Hw clock time : 2021/05/19 23:33:24 = 1621467204 seconds since 1969
Time since last adjustment is 797784 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2021-05-19 23:33:23.252370+00:00
colibri-imx8x-06800883:~$ dmesg | grep rtc0
[ 2.012300] rtc-ds1307 17-0052: registered as rtc0
Removing the data strip to the module and RTC0 could no longer be found, confirming the RTC has been installed
Alex, do you think I should try to install the rv3028 driver or just leave this alone?
Cheers
Fatlinux