Make sure the following two lines are added to /boot/config.txt:
1 2 |
dtparam=i2c_arm=on dtoverlay=i2c–rtc,pcf85063a,i2c_csi_dsi |
Reboot the board. The RTC should show up in the kernel log:
1 2 3 |
pi@raspberrypi:~ $ dmesg | grep pcf [ 7.155444] rtc–pcf85063 10–0051: registered as rtc0 [ 7.160928] rtc–pcf85063 10–0051: hctosys: unable to read the hardware clock |
and you can use various hwclock commands.
Synchronize system clock to hardware clock:
1 |
sudo hwclock –w |
Synchronize hardware clock to system clock:
1 |
sudo hwclock –s |
Read the hardware clock:
1 |
sudo hwclock –r |
Leave a Reply