Skip to main content
johankrug
Associate
March 9, 2009
Question

No RTC Interrupt (??)

  • March 9, 2009
  • 2 replies
  • 954 views
Posted on March 09, 2009 at 11:01

No RTC Interrupt (??)

This topic has been closed for replies.

2 replies

johankrug
johankrugAuthor
Associate
March 9, 2009
Posted on March 09, 2009 at 11:01

Hi,

I'm a bit.. desperate.. I have a STR 715 (ofcourse with built-in RTC) with 32.768Khz crystal. So... It should work.. But, it doesn't.

I'm using the following code to initalize the RTC for every second an interrupt (ripped from the ST-example-code. =) ).

Code:

/* Configure RTC prescaler */

RTC_PrescalerConfig ( 0x8000 );

/* Clear Pending Flags */

RTC_FlagClear ( RTC_OWIR );

RTC_FlagClear ( RTC_AIR );

RTC_FlagClear ( RTC_SIR );

RTC_FlagClear ( RTC_GIR );

/* Enable RTC IRQ channel */

EIC_IRQChannelConfig( RTC_IRQChannel, ENABLE );

EIC_IRQChannelPriorityConfig( RTC_IRQChannel, 1);

EIC_IRQConfig( ENABLE );

/* Enable Second Interrupt */

RTC_ITConfig( RTC_SIT, ENABLE );

RTC_ITConfig( RTC_GIT, ENABLE );

The problem is; no interrupt will be generated.. Not one.. Not for a second, or ten seconds.. It just never goes into the RTC-ISR..

I've copied everything from the ST code examples. Checked and double-checked everything.. And I don't know why it refuses to handle the ISR. :S. And it drives me crazy.. :S

I'm using Keil uVision3 with keil compiler V2.41

Any ideas?

Thnx

Jay Kay.

Kaouther BELHADJ
ST Employee
May 17, 2010
Posted on May 17, 2010 at 22:17

Make sure the  RTC clock is at least 4 times slower than PCLK2.