Re: MOD54415 RTC Accuracy
Posted: Wed Nov 19, 2014 7:04 pm
Conclusions
- The RTC on the processor of the 54415 is a very useful addition that effectively comes at just the additional cost of a battery (re-chargeable or standard) and resistor.
- The 2kB battery backed RAM is also a useful addition for often changed parameters (eg machine cycle counters for Pass / Fail etc), that are best not saved in flash memory.
- Over a sample of 3 modules (all bought at the same time June 2014), the default accuracy of the RTC was found to be about 38ppm. The RTC all lost time ie their time was behind real time. (by 14 seconds over 4.25 days)
- This equates to about 1 min 40 sec per month or about 10 minutes per 6 months (when Day light saving time correction would have to be manually performed anyway so the clock could be corrected at this time).
- This might be adequate for many applications.
- The RTC can be compensated by applying a correction INTERVAL and VALUE (see Freescale manual section 37 and all the notes above!)
- Watch out! the Freescale description of the compensation mechanism is quite ambiguous and can be misleading.
- For simple compensation, once the required compensation INTERVAL and VALUE have been calculated (by observing the RTC operation over a significant time period compared with an accurate time source), they can be written to the RTC compensation register and compensation will continue without any further software support necessary.
- To make the RTC run faster use a negative correction VALUE. To run slower, use a positive correction VALUE.
- The correction is applied to the first second in a compensation INTERVAL that can be set between 1 to 255 seconds (0 disables compensation - which is the condition on first power on). In combination with the correction value this gives very fine control over compensation that can be applied.
- If a backup battery is connected to V Standby, the INTERVAL and VALUE data is retained and the compensation continues during battery backup operation. (So technically the compensation register does not need to be written on every power on reset - but it will do no harm to write the required compensation values on power on).
- Of course the RTC will vary with crystal temperature. If really fine precision is required you could use a look up table or calculate the temperature compensation needed assuming you are measuring the board temperature. Crystal frequency tolerance is +-20ppm and temperature coefficient is -0.034ppm/degC.
- Compensation for both crystal frequency and temperature (if necessary) must be combined into the one set of compensation INTERVAL and VALUE figures.
- If it is important to your application that every individual elapsed second of the RTC is identical then you will need to compensate every second (INTERVAL = 1) and choose a VALUE accordingly. This will undoubtedly result in worse long term accuracy. It's a compromise.
- Finally from my testing with 3 MOD54415 boards the compensation data to correct for 14 seconds error in 4.25 days is INTERVAL =4 seconds, VALUE = -5 counts. Theoretically this will correct for 14.007 seconds over 4.25 days leaving an error of only 0.007 seconds (or 0.3 seconds in 6 months).
I hope you find this useful ...
- The RTC on the processor of the 54415 is a very useful addition that effectively comes at just the additional cost of a battery (re-chargeable or standard) and resistor.
- The 2kB battery backed RAM is also a useful addition for often changed parameters (eg machine cycle counters for Pass / Fail etc), that are best not saved in flash memory.
- Over a sample of 3 modules (all bought at the same time June 2014), the default accuracy of the RTC was found to be about 38ppm. The RTC all lost time ie their time was behind real time. (by 14 seconds over 4.25 days)
- This equates to about 1 min 40 sec per month or about 10 minutes per 6 months (when Day light saving time correction would have to be manually performed anyway so the clock could be corrected at this time).
- This might be adequate for many applications.
- The RTC can be compensated by applying a correction INTERVAL and VALUE (see Freescale manual section 37 and all the notes above!)
- Watch out! the Freescale description of the compensation mechanism is quite ambiguous and can be misleading.
- For simple compensation, once the required compensation INTERVAL and VALUE have been calculated (by observing the RTC operation over a significant time period compared with an accurate time source), they can be written to the RTC compensation register and compensation will continue without any further software support necessary.
- To make the RTC run faster use a negative correction VALUE. To run slower, use a positive correction VALUE.
- The correction is applied to the first second in a compensation INTERVAL that can be set between 1 to 255 seconds (0 disables compensation - which is the condition on first power on). In combination with the correction value this gives very fine control over compensation that can be applied.
- If a backup battery is connected to V Standby, the INTERVAL and VALUE data is retained and the compensation continues during battery backup operation. (So technically the compensation register does not need to be written on every power on reset - but it will do no harm to write the required compensation values on power on).
- Of course the RTC will vary with crystal temperature. If really fine precision is required you could use a look up table or calculate the temperature compensation needed assuming you are measuring the board temperature. Crystal frequency tolerance is +-20ppm and temperature coefficient is -0.034ppm/degC.
- Compensation for both crystal frequency and temperature (if necessary) must be combined into the one set of compensation INTERVAL and VALUE figures.
- If it is important to your application that every individual elapsed second of the RTC is identical then you will need to compensate every second (INTERVAL = 1) and choose a VALUE accordingly. This will undoubtedly result in worse long term accuracy. It's a compromise.
- Finally from my testing with 3 MOD54415 boards the compensation data to correct for 14 seconds error in 4.25 days is INTERVAL =4 seconds, VALUE = -5 counts. Theoretically this will correct for 14.007 seconds over 4.25 days leaving an error of only 0.007 seconds (or 0.3 seconds in 6 months).
I hope you find this useful ...