2009-03-09 03:01 AM
2009-03-09 03:01 AM
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.2010-05-17 01:17 PM
Make sure the RTC clock is at least 4 times slower than PCLK2.