RTC timing issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTC timing issue

682 Views
BASAV
Contributor I

HI!

 

I am using MC9S08DZ60 controller for my project and am configured RTC for 10 msec period interrupt generator. But am getting 12 msec. i.e 2 msec error. what could be the problem? clock input for RTC is 1-kHz internal low-power oscillator only  which is independent of MCG block. and the prescaler 8. tried with different configurations but error is persistent.

 

Here is my initialization code. 

#define RTC_MODULO      10 /*At 1KHz internal low power oscillator with prescaler 8 for 10ms interrupt */void bsp_rtc_init  ( void ){       bsp_io_rtcmod =  RTC_MODULO;     /*At 1KHz internal low power oscillator with prescaler %8 */        bsp_io_rtcsc = (BSP_IO_RTC_RTCLKS_1K_LPO | BSP_IO_RTC_RTIE | BSP_IO_RTC_RTCPS_DIV8);                                       /* Select clock,Setup prescalar, Enable interrupt. */}

 

 

 

 

Labels (1)
0 Kudos
1 Reply

242 Views
bigmac
Specialist III

Hello,

 

The 1KHz internal low power oscillator can have a period anywhere within the limits 700 to 1300 microseconds, and this is likely to be quite dependent on supply voltage and operating temperature.  It is not a precision oscillator.  The measured 20 percent error is within the oscillator tolerance.

 

Regards,

Mac

 

0 Kudos