zerog2k / stc_diyclock

STC DIY Clock redux (STC15F204EA, STC15W404AS, STC15W408AS)
MIT License
173 stars 66 forks source link

rough time correction #47

Closed venustrg closed 4 years ago

venustrg commented 4 years ago

very rough time correction. if your watch is used at a relatively constant temperature and constantly goes ahead 5 seconds a month, just build with -DWITH_MONTHLY_CORR=-5 to compensate these 5 seconds. a period is calculated after which a correction of 1 second is required. not so accurate timer is used, because my STC15W404 has no enough program space to implement something like unixtime for rtc or setting adjustment value.

such a correction cannot be called precise, but it is better than nothing. it's possible to achieve decent accuracy without multiple quartz replacements.

and of course this doesn't work while running on battery/capacitor.

please test.

venustrg commented 4 years ago

tested, and correction works great while powered from power supply. i'm waiting for stc15w408 to add sntp sync.