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.

TM4C1294NCPDT: RTC drift in second and subsecond mode .

Part Number: TM4C1294NCPDT

I have two launchpad boards EK- TM4c1294 , In my application i need to synchronize time between two boards , for that one board act as master and other as slave

Master sends a signal using gpio interrupt to slave board (At same time Master RTC is enabled), upon receiving interrupt signal through gpio slave starts

its own RTC ,

Both master and slave are set for match interrupt in hibernate rtc module at time 65 seconds and 12458 subseconds . Inside interrupt handler i am toggling

gpio and examining both signal in oscilloscope tektronix 2012 .       The toggling pulses in oscilloscope  are apart  from  some 250 us .

 On repeating i am getting  same result .

Now my question is , can  rtc in different  chips can have different accuracy or it has to do something with on chip crystal accuracy .

Both boards are from TI , i am using external crystal for accuracy it has 12 pf capacitor attached to it as per schematic .

This is my rtc init subroutine :

{

SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE));
HibernateEnableExpClk(g_ui32SysClock);
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
HibernateRTCEnable();
HibernateRTCSet(0);

HibernateRTCMatchSet(0,65);

HibernateRTCSSMatchSet(0,12458);

HibernateIntEnable(HIBERNATE_INT_RTC_MATCH_0);

HibernateIntClear(HIBERNATE_INT_PIN_WAKE | HIBERNATE_INT_LOW_BAT | HIBERNATE_INT_RTC_MATCH_0);
HibernateIntRegister(HibernateHandler);

}

If i change slave or master with other boards then difference vary with board but remain same for a pair .

Thanks & Regards  .

 

  • Hello Alok

    Each crystal has +/- ppm stability range. As long as the clock is within the range the manufacturer will claim spec compliance. However the minor differences between the two crystals would result in offset over a period of time.

    Now one of the possible causes for 250us variation could be the code execution delay between the master and slave that you have. Did yuou possibly investigate that?
  • Dear Amit,
    After 65 second and 12458 subsecond , i am generating interrupt at interval of 10 seconds
    i.e like 75 second 12458 subsecond , 85 sec 12458 ss, 95 second 12458 ss a, and so on until 200,
    but in oscilloscope signal drift is not constant , nearly 25 - 27 us drift is adding up per 10 second.

    In other word's apart from code execution delay , difference between two rtc should be constant over time
    but this is not happening , difference in signal is varying over time .

    Any suggestion from you will be very helpful .

    Thanks & Regards
    Alok
  • Hello Alok

    No. The RTC clock has a PPM variation over voltage and temp. So no two randomly picked crystals can have the same property. You would be seeing the variation from crystal to crystal. Now can you make sure that the 32.768KHz is indeed the exact value across the capture time frame. On a scope you can set persistence capture mode which should generate a smear on the opposite edge of capture. 25-27 us is a bit to large unless the crystal has a bad tolerance.
  • alok nigam said:
    Both master and slave are set for match interrupt in hibernate rtc module at time 65 seconds and 12458 subseconds

    alok nigam said:
    The toggling pulses in oscilloscope  are apart  from  some 250 us .

    250uS in 65S is < 4ppm

    Your crystals would need to be <2ppm to expect better. Any reason to expect better?

    Robert

  • Hello Robert ,
    I am using CMR200T-32.768KDZY-UT crystal it has +-20 ppm frequency tolerance .
    Thanks & Regards
    Alok
  • Hello Amit ,
    In launchpad board "CMR200T-32.768KDZY-UT" crystal is used which has +-20 ppm frequency tolerance .
    Thanks & Regards
    Alok
  • Hello Alok,

    I believe Robert has effectively answered your questions. I am not sure why you are bringing up the crystal on the Launchpad?
  • Hello Amit ,
    I am not bringing crystal on launchpad , it is the default crystal that comes with launchpad .
    And i just wanted to have second opinion .
    Thanks for your support and suggestion it was really helpful .
    Thanks & Regards
    Alok