Good, I am glad we are making sense out of what you are doing :-)
It is very helpful to state up from/beginning exactly what you are trying to accomplish, that way we can help provide methods to obtain that goal.
[code:1:b73f270fb5]
If Op_state = 0 Then 'op mode
Call Pca8565_gettime()
If Pca8565_second <> Second_temp Then 'only need to change time display once a second
Call Display_time_a_pm() 'Call Display_time()
Second_temp = Pca8565_second
End If
End If[/code:1:b73f270fb5]
In my "do" loop I get the time info and every second I refresh the display.
Unless you are displaying seconds, then you really only need to do the display update once every minute.
As for calibration, I use a variable cap to warp the xtal to get as accurate as I can for an uncompensated oscillator. I have no methods for getting internet time in my application. It is fairly accurate time keeping, more accurate than my pc, which I am sure they did not warp the xtal.
I know Dallas/maxim have more accurate rtc, but are alot more expensive as well.
In my application, it is breeze to set the time, since I use separate encoders to set each one,
DayofWeek,month,day,year,hour,min. I do not adjust the second, as I reset it to zero, when I do the time update.
The only code I have left to figure out is daylight savings time correction.
'As of 2007, the standard North American period for Daylight Saving Time is from the second Sunday of March to the first Sunday of November Daylight Saving Time begins and ends at 2 am local time'
Got any ideas for that?
Rick
↧