Chapter 18 Real-Time Counter With Calendar (RTCV2)
S12ZVHY/S12ZVHL Family Reference Manual Rev. 1.05
Freescale Semiconductor
651
divider circuits generates compensation cycle periodic interrupt and 4 Hz periodic interrupt. Depend on
the CCS setting, the cycle period can be 5, 15, 30, 60 seconds. The COMPIE bit in the RTC control regis-
ter 4(RTCCTL4) can enable compensation cycle interrupt. When the compensation logic start at the last
second compensation cycle, it will generate the interrupt. And user can calculate the next compensation
value and update these registers.
When a 4 Hz time base tick happens, it indicated by TB0F flags. And a CPU interrupt request is gener-
ated if the corresponding interrupt enable is also set.
18.5.4 RTC Clock Compensation
The RTC module is built with compensation circuit. The circuit is used to compensate frequency errors of
the input RTC clock, so that a more accurate 1-Hz RTC clock output can be achieved. Using this method,
it is possible to use a less expensive crystal. If the crystal temperature profile and the current temperature
is known, the compensation circuit can also be used to compensate crystal frequency errors due to ambi-
ent temperature change and crystal aging.
The compensation logic use the RTCMOD, CCS and Q of RTCCCR to decide the free run timer counter.
User first need to decide the CCS, which determines the compensation precision. The larger CCS value,
higher the precision, longer the compensation period. During each compensation cycle, the free run timer
counter will first count 1 for Q times , then count RTCMOD for the “compensation peirod-Q”
times. Note if Q >= compensation period, it means that free run timer counter will count 1 for
“compensation period” times
The RTCMOD is the integral portion of actual frequency. Q value can be calculated base on
Section Table 18-14., “the CCS, precision and Q value”
First example, if the RTC clock is from OSCCLK_32K and it has 2000PPM frequence drift due to the
crystal and temperature etc factors, the RTCCLK frequency will be 32833.536HZ. We set RTCMOD
value to 32833 first. The fraction value will be 0.536, and we can get CCS=0, Q=3 or CCS=1, Q=8 or
CCS=2, Q=16 or CCS=3, Q=32.
Second example, if the RTC clock is from OSCLK and it has -2000PPM frequence drift due to the crystal
Table 18-14. the CCS, precision and Q value
CCS
Compensation
period (second)
Compensation Precision
Q
0
5
1/(2 * 5 * RTCMOD)
(1)
1. the RTCCLK has only two possible input frequency, 31.25KHz or 32.768KHz. If RTCMOD value is set as requirement, user
can use 31250 or 32768 to replace the RTCMOD value here to easy the compensation precision calculation.
integer of ((fraction value+1/(2*5)) * 5)
1
15
1/(2 * 15 * RTCMOD)
integer of ((fraction value+1/(2*15)) * 15)
2
30
1/(2 * 30 * RTCMOD)
integer of ((fraction value+1/(2*30)) * 30)
3
60
1/(2 * 60 * RTCMOD)
integer of ((fraction value+1/(2*60)) * 60)
Содержание MC9S12ZVHL32
Страница 21: ...S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 Freescale Semiconductor 21 PAGE INTENTIONALLY LEFT BLANK...
Страница 22: ...S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 22 Freescale Semiconductor PAGE INTENTIONALLY LEFT BLANK...
Страница 686: ...Chapter 20 ECC Generation module SRAM_ECCV1 S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 686 Freescale Semiconductor...
Страница 752: ...Chapter 22 Supply Voltage Sensor BATSV2 S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 752 Freescale Semiconductor...
Страница 774: ...Chapter 23 LIN Physical Layer S12LINPHYV2 S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 774 Freescale Semiconductor...
Страница 788: ...Appendix A MCU Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 788 Freescale Semiconductor...
Страница 794: ...Appendix B ADC Electricals S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 794 Freescale Semiconductor...
Страница 798: ...Appendix D IRC Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 798 Freescale Semiconductor...
Страница 802: ...Appendix F MSCAN Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 802 Freescale Semiconductor...
Страница 806: ...Appendix G NVM Electrical Parameters S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 806 Freescale Semiconductor...
Страница 810: ...Appendix H BATS Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 810 Freescale Semiconductor...
Страница 816: ...Appendix K OSC32K Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 816 Freescale Semiconductor...
Страница 822: ...Appendix L SPI Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 822 Freescale Semiconductor...
Страница 826: ...Appendix M LINPHY Electrical Specifications S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 826 Freescale Semiconductor...
Страница 829: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 830 Freescale Semiconductor O 1 144 LQFP...
Страница 830: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 Freescale Semiconductor 831...
Страница 831: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 832 Freescale Semiconductor...
Страница 832: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 Freescale Semiconductor 833 O 2 100 LQFP...
Страница 833: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 834 Freescale Semiconductor...
Страница 834: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 Freescale Semiconductor 835...
Страница 835: ...Appendix O Package Information S12ZVHY S12ZVHL Family Reference Manual Rev 1 05 836 Freescale Semiconductor...