Hi,
I'm using Witty Pi 4 L3V7 connected to my Raspberry pi 4B. I write system time to RTC after connect to Internet, and found RTC time around 10 seconds behind the real time after about 24 hours. This issue happened after an accidentally shutdown before the RTC scheduled. I tested for a week and the problem always existed. The 5V power is always connected
Is there someone WHO may help me solving that issue?
Thanks in advance!
The I2C register No.37 is to store the offset value for RTC calibration. Usually this value has been properly set in the factory, but it can be lost if firmware was updated without keeping the EEPROM values, or the device has been working undervoltage.
It is possible to calibrate the RTC again by measuring the CLKOUT frequency in (unpopulated) P5 header, or count the actual time drift.
Here is an excel file that can calculate the offset value for I2C register No.37:
WittyPi_RTC_Calibration.xlsx
This Excel file provides two approaches (by frequency or by time drift) to calculate the offset value. Properly setting the I2C register No.37 will make the RTC accuarate.
I tried to fix i2c following the excel file, but sadly this issue still happened. I changed another Witty Pi 4 L3V7 connected to the same raspberry pi, and no obvious time loss occurred on this new RTC up to now.The I2C register No.37 is to store the offset value for RTC calibration. Usually this value has been properly set in the factory, but it can be lost if firmware was updated without keeping the EEPROM values, or the device has been working undervoltage.
It is possible to calibrate the RTC again by measuring the CLKOUT frequency in (unpopulated) P5 header, or count the actual time drift.
Here is an excel file that can calculate the offset value for I2C register No.37:
WittyPi_RTC_Calibration.xlsxThis Excel file provides two approaches (by frequency or by time drift) to calculate the offset value. Properly setting the I2C register No.37 will make the RTC accuarate.
@yww What value have you written into register #37?
What command did you use and what output did you get?
@yww why did you use the wrong index 54 and 55? The correct index is 37, or heximal 0x25. There is listed example in that excel file.
And why did you use the wrong value '0'? There is no way this offset value goes to zero. It is usually a value between 0x70~0x80.
You can't expect a good result by writing a wrong value to a wrong register.
If you can't figure out how to use that excel file, you may just run the command below and it should be better than nothing.
i2cset -y 1 8 37 0x77