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.
Charles Tsai said:Hi Nadav,
Which 32.768kHz oscillator will you use? I'm referring to the oscillator datasheet for its tolerance and stability over temperature.
Hi Charles, I'm not sure what you mean, I didn't write that code so I'm still learning about the RTC.
Here is the init function:
void RTC_init(void) { int32_t ui32Status = 0u; // Enable the Hibernation module. // SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); // // Wait for the Hibernate module to be ready. // while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE)) { } HibernateEnableExpClk(SysCtlClockGet()); HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE); HibernateRTCEnable(); if(HibernateIsActive()) { // // Read the status to determine cause of wake. // ui32Status = HibernateIntStatus(false); // // Test the status bits to see the cause. // if(ui32Status & HIBERNATE_INT_PIN_WAKE) { // // Wake up was due to WAKE pin assertion. // } if(ui32Status & HIBERNATE_INT_RTC_MATCH_0) { // // Wake up was due to RTC match register. // } // // Restore program state information that was saved prior to // hibernation. // //HibernateDataGet(pui32NVData, 64); // // Now that wake up cause has been determined and state has been // restored, the program can proceed with normal processor and // peripheral initialization. // ui32Status = HibernateIntStatus(0); HibernateIntClear(ui32Status); RTC_GetTime(); } }
Hi,
The RTC can be clocked by three different clock sources? Please see below. The first two are either an external 32.768kHz oscillator or an external 32.768kHz clock source. You were asking how the temperature can affect the oscillator. Since these are external components you will need to refer to the datasheet of the external oscillator of your choice. The vendor of the your external oscillator should have information in the datasheet about the temperature effect on the oscillator stability and tolerance.
Which code line defines the clock source?
is it :
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
Hi Nadav,
Which board you are talking about? I assume this is your own custom board, right?
You will get much worst accuracy if you use the internal LFIOSC. The LFIOSC is part of the device and it is therefore documented in the datasheet for its electrical timing spec. Please see below. As you can see the frequency varies quite largely between 10kHz and 75kHz. It is definitely not the choice of your oscillator if you want a wall clock accuracy. If you want accuracy you must use an external crystal. Please go to Mouser.com or Digikey.com to find your crystal oscillator and read their datasheets. You should be able to find 32.768kHz oscillator with very low ppm.