This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5529: Missing 1 PS1 Interrupt Every 43522 Seconds.

Part Number: MSP430F5529

I have an MSP430F5529 design which uses the RTC_A to coordinate data captures.  I have RTCRDY and RT1PS enabled, and the PS is set for 64Hz.  For 43522 Seconds in a row it works perfectly.   I get the RDY interrupt,  followed by 64 PS interrupts. Then after 43522 seconds, I only get 63 PS interrupts.   Then it picks up and goes fine for another 43522 seconds.   I have the RTC calibration set to 0 so I don't think it is the Calibration logic advancing the clock.    I've attached the RTC_A register dump from the device,  logged when the error happens.    Anyone seen this before ?

RTC__Real_Time_Clock
RTCCTL01 0xB014 Real Timer Control 0/1 [Memory Mapped]
RTCBCD 1 RTC BCD  0:Binary / 1:BCD
RTCHOLD 0 RTC Hold
RTCMODE 1 RTC Mode 0:Counter / 1: Calendar
RTCRDY 1 RTC Ready
RTCSSEL 00 - RTCSSEL_0 RTC Source Select 1
RTCTEV 00 - RTCTEV_0 RTC Time Event 1
RTCTEVIE 0 RTC Time Event Interrupt Enable Flag
RTCAIE 0 RTC Alarm Interrupt Enable Flag
RTCRDYIE 1 RTC Ready Interrupt Enable Flag
RTCTEVIFG 1 RTC Time Event Interrupt Flag
RTCAIFG 0 RTC Alarm Interrupt Flag
RTCRDYIFG 0 RTC Ready Interrupt Flag
RTCCTL23 0x0000 Real Timer Control 2/3 [Memory Mapped]
RTCCALF 00 - RTCCALF_0 RTC Calibration Frequency Bit 1
RTCCALS 0 RTC Calibration Sign
RTCCAL5 0 RTC Calibration Bit 5
RTCCAL4 0 RTC Calibration Bit 4
RTCCAL3 0 RTC Calibration Bit 3
RTCCAL2 0 RTC Calibration Bit 2
RTCCAL1 0 RTC Calibration Bit 1
RTCCAL0 0 RTC Calibration Bit 0
RTCPS0CTL 0x0101 Real Timer Prescale Timer 0 Control [Memory Mapped]
RT0SSEL 0 RTC Prescale Timer 0 Source Select 0:ACLK / 1:SMCLK
RT0PSDIV 000 - RT0PSDIV_0 RTC Prescale Timer 0 Clock Divide Bit: 2
RT0PSHOLD 1 RTC Prescale Timer 0 Hold
RT0IP 000 - RT0IP_0 RTC Prescale Timer 0 Interrupt Interval Bit: 2
RT0PSIE 0 RTC Prescale Timer 0 Interrupt Enable Flag
RT0PSIFG 1 RTC Prescale Timer 0 Interrupt Flag
RTCPS1CTL 0x0102 Real Timer Prescale Timer 1 Control [Memory Mapped]
RT1SSEL 00 - RT1SSEL_0 RTC Prescale Timer 1 Source Select Bit 1
RT1PSDIV 000 - RT1PSDIV_0 RTC Prescale Timer 1 Clock Divide Bit: 2
RT1PSHOLD 1 RTC Prescale Timer 1 Hold
RT1IP 000 - RT1IP_0 RTC Prescale Timer 1 Interrupt Interval Bit: 2
RT1PSIE 1 RTC Prescale Timer 1 Interrupt Enable Flag
RT1PSIFG 0 RTC Prescale Timer 1 Interrupt Flag
RTCPS 0x8081 Real Timer Prescale Timer Control [Memory Mapped]
RTCIV 0x0000 Real Time Clock Interrupt Vector [Memory Mapped]
RTCTIM0 0x0935 Real Time Clock Time 0 [Memory Mapped]
RTCTIM1 0x0600 Real Time Clock Time 1 [Memory Mapped]
RTCDATE 0x0820 Real Time Clock Date [Memory Mapped]
RTCYEAR 0x2017 Real Time Clock Year [Memory Mapped]
RTCAMINHR 0x0000 Real Time Clock Alarm Min/Hour [Memory Mapped]
RTCADOWDAY 0x0000 Real Time Clock Alarm day of week/day [Memory Mapped]
RTCSEC 0x35 Real Time Clock Seconds [Memory Mapped]
SECONDS6 0 Real Time Clock Seconds Bit: 6
SECONDS5 1 Real Time Clock Seconds Bit: 5
SECONDS4 1 Real Time Clock Seconds Bit: 4
SECONDS3 0 Real Time Clock Seconds Bit: 3
SECONDS2 1 Real Time Clock Seconds Bit: 2
SECONDS1 0 Real Time Clock Seconds Bit: 1
SECONDS0 1 Real Time Clock Seconds Bit: 0
RTCMIN 0x09 Real Time Clock Minutes [Memory Mapped]
MINUTES6 0 Real Time Clock Minutes Bit: 6
MINUTES5 0 Real Time Clock Minutes Bit: 5
MINUTES4 0 Real Time Clock Minutes Bit: 4
MINUTES3 1 Real Time Clock Minutes Bit: 3
MINUTES2 0 Real Time Clock Minutes Bit: 2
MINUTES1 0 Real Time Clock Minutes Bit: 1
MINUTES0 1 Real Time Clock Minutes Bit: 0
RTCHOUR 0x00 Real Time Clock Hour [Memory Mapped]
HOUR6 0 Real Time Clock Hour Bit: 6
HOUR5 0 Real Time Clock Hour Bit: 5
HOUR4 0 Real Time Clock Hour Bit: 4
HOUR3 0 Real Time Clock Hour Bit: 3
HOUR2 0 Real Time Clock Hour Bit: 2
HOUR1 0 Real Time Clock Hour Bit: 1
HOUR0 0 Real Time Clock Hour Bit: 0
RTCDOW 0x06 Real Time Clock Day of week [Memory Mapped]
DOW6 0 Real Time Clock DOW Bit: 6
DOW5 0 Real Time Clock DOW Bit: 5
DOW4 0 Real Time Clock DOW Bit: 4
DOW3 0 Real Time Clock DOW Bit: 3
DOW2 1 Real Time Clock DOW Bit: 2
DOW1 1 Real Time Clock DOW Bit: 1
DOW0 0 Real Time Clock DOW Bit: 0
RTCDAY 0x20 Real Time Clock Day [Memory Mapped]
DAY6 0 Real Time Clock Day Bit: 6
DAY5 1 Real Time Clock Day Bit: 5
DAY4 0 Real Time Clock Day Bit: 4
DAY3 0 Real Time Clock Day Bit: 3
DAY2 0 Real Time Clock Day Bit: 2
DAY1 0 Real Time Clock Day Bit: 1
DAY0 0 Real Time Clock Day Bit: 0
RTCMON 0x08 Real Time Clock Month [Memory Mapped]
MONTH6 0 Real Time Clock Month Bit: 6
MONTH5 0 Real Time Clock Month Bit: 5
MONTH4 0 Real Time Clock Month Bit: 4
MONTH3 1 Real Time Clock Month Bit: 3
MONTH2 0 Real Time Clock Month Bit: 2
MONTH1 0 Real Time Clock Month Bit: 1
MONTH0 0 Real Time Clock Month Bit: 0
RTCAMIN 0x00 Real Time Clock Alarm Min [Memory Mapped]
RTCAE 0 Real Time Clock Alarm enable
MINUTES6 0 Real Time Clock Minutes Bit: 6
MINUTES5 0 Real Time Clock Minutes Bit: 5
MINUTES4 0 Real Time Clock Minutes Bit: 4
MINUTES3 0 Real Time Clock Minutes Bit: 3
MINUTES2 0 Real Time Clock Minutes Bit: 2
MINUTES1 0 Real Time Clock Minutes Bit: 1
MINUTES0 0 Real Time Clock Minutes Bit: 0
RTCAHOUR 0x00 Real Time Clock Alarm Hour [Memory Mapped]
RTCAE 0 Real Time Clock Alarm enable
HOUR6 0 Real Time Clock Hour Bit: 6
HOUR5 0 Real Time Clock Hour Bit: 5
HOUR4 0 Real Time Clock Hour Bit: 4
HOUR3 0 Real Time Clock Hour Bit: 3
HOUR2 0 Real Time Clock Hour Bit: 2
HOUR1 0 Real Time Clock Hour Bit: 1
HOUR0 0 Real Time Clock Hour Bit: 0
RTCADOW 0x00 Real Time Clock Alarm Day of week [Memory Mapped]
RTCAE 0 Real Time Clock Alarm enable
DOW6 0 Real Time Clock DOW Bit: 6
DOW5 0 Real Time Clock DOW Bit: 5
DOW4 0 Real Time Clock DOW Bit: 4
DOW3 0 Real Time Clock DOW Bit: 3
DOW2 0 Real Time Clock DOW Bit: 2
DOW1 0 Real Time Clock DOW Bit: 1
DOW0 0 Real Time Clock DOW Bit: 0
RTCADAY 0x00 Real Time Clock Alarm Day [Memory Mapped]
RTCAE 0 Real Time Clock Alarm enable
DAY6 0 Real Time Clock Day Bit: 6
DAY5 0 Real Time Clock Day Bit: 5
DAY4 0 Real Time Clock Day Bit: 4
DAY3 0 Real Time Clock Day Bit: 3
DAY2 0 Real Time Clock Day Bit: 2
DAY1 0 Real Time Clock Day Bit: 1
DAY0 0 Real Time Clock Day Bit: 0

 

  • Hi James,

    I think this could still be the calibration mechanism causing this, even though you have everything set to 0 for calibration bits. See the user's guide www.ti.com/lit/pdf/slau208 section 22.2.4 "Real-Time Clock Calibration" - there is a note at the very end of the section that says:

    "

    NOTE: Minimum Possible Calibration

    The minimal calibration possible is -4 ppm or +8 ppm. For example, setting RTCCALS = 0 and RTCCAL = 0h would result in a -4 ppm decrease in frequency. Similarly, setting RTCCALS = 1 and RTCCAL = 0h would result in a +8 ppm increase in frequency.

    "

    Therefore your registers that you show have RTCCALS = 0 and RTCCAL = 0, which means a -4ppm decrease in frequency.

    Regards,

    Katie

  • 64Hz has a period of 15.6 milliseconds. A 4 ppm correction would only be 0.004 milliseconds. Why would a correction of 0.004 cause the loss of one PS interrupt?
  • Hi Nick,

    Seeing the MSP430F5xx/6xx user's guide www.ti.com/lit/pdf/slau208 section 22.2.4 Real-Time Clock Calibration, the second paragraph:

    "

    Calibration is accomplished by periodically adjusting the RT1PS counter based on the RTCCALS and RTCCALx settings. In calendar mode, the RT0PS divides the nominial 37268-Hz low-frequency (LF) crystal clock input by 256. A 64-minute period has 32768 cycles/sec × 60 sec/min × 64 min = 125829120 cycles. Therefore a –2-ppm reduction in frequency (down calibration) approximately equates to adding an additional 256 cycles every 125829120 cycles (256/125829120 = 2.035 ppm). This is accomplished by holding the RT1PS counter for one additional clock of the RT0PS output within a 64-minute period.

    "

    You are counting the RT1PS interrupts, correct? RT1PS is sourced from 32768/256, and for the calibration RT1PS is held 1 cycle (which is 256 ACLK cycles) every 64 minutes. Now, in your initial post you described seeing 64 interrupts for some time, 63 interrupts, and then 64 interrupts again for some time, which each set of 64 interrupts being 1s? If you continue to run for a period of time do you always see 64 after that? My theory is that the second where you see 63 interrupts happens to be the one where the calibration occurs. If you continued to run for an entire 64 minutes, you would then see another cycle where there were 63 interrupts instead of 64. That is what I suspect is happening - can you confirm? One way to test would be to set up for the count of the number of interrupts to be output each time 1 second rolls over, say over UART, and the calendar time from the registers, and allow this to run for over a couple hours. Then you could see how often the 63 count shows up and if it makes sense to be happening on intervals of 64 minutes.

    Regards,

    Katie

**Attention** This is a public forum