SPLatco Knowledge Base
Accuracy

The RTC on the HMI430/700 is factory calibrated to better than 1ppm.  This means it may lose or gain no more than 2 seconds per month.  The usual caveats about variations in temperature and humidity apply as both will also impact the clock accuracy and make the 2 second figure worse.  Anyway we do what we can to make it pretty good.

Note though, that there is an interesting point relating to how the HMI CPU keeps the RTC accurate.  At some point within a 36hr window, it will either add or remove one whole second.  So if you’re watching the clock just at the moment it decides to remove a second you’ll see the time go:

11:43:25
11:43:27

Yes dear reader, 1 whole second may disappear, in this case 11:43:26 ceased to exist.  This is the CPU tweaking the time to ensure that over the long term, it remains accurate.  It means that when the time said 11:43:25 it was much. much nearer 11:43:26.  So when the next second ticked over, the CPU adjusted the clock to 11:43:27 and it’s now accurate again.

If you are using the RTC to trigger events, your best plan is to use the RTCEvent functions as these can cope with missing or added seconds.  However if you’re doing yourself, simply avoid making “equal to” comparisons.  Instead use “greater than or equal to” so any missing seconds won’t foil your application.

Day of Week

This should make your day.  Unlike some other SPLat controllers, the day of week is calculated automatically.  For example:

   LoadX 24
RTCPopSS ;set the day
LoadX 9
RTCPopMM ;set the month
LoadX 14
RTCPopHH ;set the year
RTCWriteDate ;write the date to the RTC

Will automatically set the day to Wednesday (the date is 24 September 2014).  Note if you replace RTCWriteDate with RTCWriteDN, the day number will be set to match the date in the RTC registers without altering the actual date.  This can make it easy to display the day while your user is entering the date/month.year.