Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Witty Pi 4 L3V7: looses time 10sec per day

6 Posts
2 Users
0 Likes
258 Views
 yww
(@yww)
Posts: 3
Active Member
Topic starter
 

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!

 

1721127959-Screen-Shot-2024-07-16-at-185107.png
 
Posted : 16/07/2024 1:05 pm
(@admin)
Posts: 476
Member Admin
 

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.

 
Posted : 16/07/2024 1:43 pm
 yww
(@yww)
Posts: 3
Active Member
Topic starter
 

Posted by: @admin

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.

 

 
Posted : 17/07/2024 1:29 pm
(@admin)
Posts: 476
Member Admin
 

@yww What value have you written into register #37? 

What command did you use and what output did you get?

 
Posted : 17/07/2024 5:05 pm
 yww
(@yww)
Posts: 3
Active Member
Topic starter
 

Posted by: @admin

@yww What value have you written into register #37? 

What command did you use and what output did you get?

I used "i2cset -y 1 8 54 0" and "i2cset -y 1 8 55 0" in terminal, and no ouput was shown.

 

 
Posted : 18/07/2024 9:37 am
(@admin)
Posts: 476
Member Admin
 

@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

 
Posted : 18/07/2024 10:20 am
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.