Other Parts Discussed in Thread: TM4C1294NCPDT, TM4C129ENCPDT
The DS-TM4C123GH6PM-15842.2741 SPMS376E datasheet dated June 12, 2014 contains the following description of RTC Trim in section 7.3.5.3:
The discrepancies between the operation of RTC Trim in the datasheet and an actual TM4C123GH6PM rev B1 part are:
1) In the case when the match interrupt is configured with RTCM0=0x1 and RTCSSM=0x7FFD the device gets only one match interrupt, rather than the two match interrupts suggested by the datasheet.
The output from the test program created to investigate the behaviour of RTC Trim:
6) Test match for sub-seconds of 0x7FFD, along with a trim value of 0x8002. The trim value causes the sub-seconds to go backwards, such that according to the datasheet the the match interrupt should occur twice. However, only one match interrupt occurs. Since a RTC trim is applied which causes the time to go backwards two discontinuities are reported. Tested RTC with HIBRTCM0=0x2c1 HIBRTCSS=0x7ffd HIBRTCT=0x8002 HIB#02 workaround : Yes Reset RTC time on first match interrupt : No Num RTC match interrupts=1 RTC match interrupt around times (0x2c1,0x7ff9) (0x2c1,0x7ffa) (0x2c1,0x7ffb) (0x2c1,0x7ffc) (0x2c1,0x7ffd) *interrupt* (0x2c1,0x7ffe) Num RTC time discontinuities=2 RTC time discontinuity (0x2c0,0x7fff) -> (0x2c1,0x7ffd) RTC time discontinuity (0x2c1,0x7fff) -> (0x2c1,0x0)
The test program reported that it only received one match interrupt. The program enables RTC match interrupt, and polls the RTC time to detect:
- The RTC time at which a match interrupt occurs.
- If there is a discrepancy such that the RTC time doesn't change by advancing by one sub-second increment at a time.
A TM4C1294NCPDT rev A1 and TM4C129ENCPDT rev A2 behave in the same way as the TM4C123GH6PM rev B1.
2) In the case of TRIM Value of 0x7FFC the actual behaviour is as follows (based upon an edit of figure 7-6 in the datasheet to show the counter goes forwards rather than backwards):
The output from the test program for this test case was:
9) Test match for sub-seconds of 0x3, along with a trim value of 0x7FFC. The trim value causes the sub-seconds to advance, such that a RTC match interrupt is seen. Since a RTC trim is applied which makes the time go forwards one discontinuity is reported. Tested RTC with HIBRTCM0=0x2c1 HIBRTCSS=0x3 HIBRTCT=0x7ffc HIB#02 workaround : Yes Reset RTC time on first match interrupt : No Num RTC match interrupts=1 RTC match interrupt around times (0x2c0,0x7ffc) (0x2c0,0x7ffd) (0x2c0,0x7ffe) (0x2c0,0x7fff) (0x2c1,0x3) *interrupt* (0x2c1,0x4) Num RTC time discontinuities=1 RTC time discontinuity (0x2c0,0x7fff) -> (0x2c1,0x3)
A TM4C1294NCPDT rev A1 and TM4C129ENCPDT rev A2 behave in the same way as the TM4C123GH6PM rev B1.
Are there errors in the datasheet description of the RTC trim?
For reference the test program used is attached, which was developed using CCS 7.2 and TivaWare 2.1.4.178. The program also demonstrates that TM4C123 devices can be affected by errata HIB#01 and HIB#02 unless the errata are worked-around in software. TM4C129 devices don't suffer from those errata.