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.

RTC Data fluctuates at power off Condition.

Other Parts Discussed in Thread: TM4C1294KCPDT

Hello,

I am currently working on TM4C1294KCPDT. I started RTC in Hibernate Calendar mode.The problem i am facing with is my RTC data fluctuate in seconds at Power off condition.I am using a 32.768KHz external crystal Oscillator.To maintain RTC Working at Power off condition i am using a BR2032 Battery.

Following are the connections shown of my board :

My Code to start RTC is as follow:

SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);

HibernateEnableExpClk(SYS_CLOCK);

HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);

HibernateRTCEnable();

HibernateCounterMode(HIBERNATE_COUNTER_24HR);

Can you Please help me to solve this problem.

Thank you

Rajani

  • Hello Rajani,

    Rajani Singh said:
    The problem i am facing with is my RTC data fluctuate in seconds at Power off condition

    Do you mean on Hibernate?

    Also does it vary every cycle or there is no pattern to when it would vary?

    How does the CPU know that it has changed?

    Regards

    Amit

  • Hello,

    Thanks Amit for your quick reply.

    My RTC data fluctuate means when i remove power for around 9-10 hours and after that when i give power to it and check its register value
    i.e HIB_CAL0 and HIB_CAL1 then i found that all the parameters are updated as per time but my Seconds value i.e HIB_CAL0_SEC are either
    lagging or leading by some value from the correct one.And the variation does not have a fixed pattern.

    Thanks

    Rajani
  • Hello Rajani

    If the data not being correct is the second counter, then it may be that the 32K clock is drifting over time. In such cases a TRIM can be applied to correct the overall time count.

    Regards
    Amit
  • 1 second in 9 hours is ~30ppm. That's roughly the tolerance of the usual crystal (some are worse, some are better). Add in strain and temperature effects and worse would not be surprising.

    Amit's trim suggestion should calibrate your initial tolerance variation.

    Robert
  • Hello Robert,

    The post stated a data corruption which caught me by surprise only to later reveal it is time mismatch.

    Regards
    Amit
  • Quite different scenarios indeed

    Robert
  • Hello,

    Can i know exactly the TRIM you Mentioned is Hardware TRIM or you are talking about the register provided Hibernation RTC Trim (HIBRTCT)
    in Datasheet of TM4C1294KCPDT.

    I Set Trim Value as :

    SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
    HibernateEnableExpClk(SYS_CLOCK);
    HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
    HibernateRTCEnable();
    HibernateCounterMode(HIBERNATE_COUNTER_24HR);

    HibernateRTCTrimSet(0x7FFF);

    And i am facing with the same issue as before.my RTC Second count is still fluctuating.

    Thanks
    Rajani
  • Hello Rajani,

    You need to see which way the mismatch is occurring. If it is slowing down then you need to change the TRIM to compensate and this is described in the data sheet.

    Regards
    Amit
  • Rajani, are you testing on one board/crystal or several?

    Robert
  • Hello,

    As I mentioned in my Earlier Post that data fluctuation is not in fix format.I got Fluctuation in both way i.e leading as well as lagging and also the fluctuation amount are not same every time so How can i decide what the Value should be of my TRIM register.

    Thanks
    Rajani
  • Hello Rajani,

    Do you have a reference source like ethernet? If yes, then you can use NTP to realign the on-chip RTC.

    Regards
    Amit
  • Rajani Singh said:
    leading as well as lagging and also the fluctuation amount are not same every time

    That's why I asked how many boards you are testing.

    If this is a single board then there are multiple things that need to be considered (TRIM is not going to help much, if at all)

    • First what is your crystal specified for? Initial accuracy? drift over time? drift over temperature?
    • What loading does it need?
    • What are you using for the backup supply, have you checked its value and stability?
    • And finally you need to check over multiple boards to be sure you are not chasing a construction problem of some sort (bad part, bad solder etc...)

    Robert

  • Hello,

    I have tested it on Four different board and even many times changed my crystal also but result was same every time i.e my seconds value is not as per the expectation.sometimes it is leading and sometimes it is lagging.
    Can you please give me any suggestion so that i can solve this problem.?

    thank you,
    Rajani
  • First since this is multiple boards, then Amit already gave you the solution to deal with board to board variation.

    Second, you still have not addressed the other questions I asked.

    Robert
  • Hello,

    Thanks a lot for your suggestion.

    Yes i have ethernet reference source on my board.
    My request regarding the NTP process you are talking about is,Can you please guide me the steps so that i can use NTP to realign
    the on-chip RTC ?

    Thank you,
    Rajani
  • Hello Robert,

    I am using Crystal of 32.768KHZ and for backup supply i am using BR2032 battery of 3.5 V connected over pin 68 as shown in my first post. Yes I have checked it before using it and the value it given was 3.5 V without any power.And all the time when I check battery's voltage,it always comes 3.5 V without any drift on both power on as well as power off condition on multiple board.

    Thank you

    Rajani

  • You still need to check supply stability, crystal loading, crystal initial tolerance specification, crystal drift specifications both time and temperature.

    Robert