__irq void RTC_IRQHandler(void)
{
SendDailySMS=1;
RTC_AMR = 255; // disable alarm interrupt, will be reEnabled in code
RTC_ILR = (1UL<<1); // Clear RTC alarm interrupt flag /
VICVectAddr = 0; // Acknowledge Interrupt /
}
int main(void)
{
basic coonfiguration
//init RTC
PCONP|=1<<9;
RTC_CCR=0x21; use 32k crystal
RTC_AMR &= ~(0x6) ;
RTC_AMR |= ~(0x6) ; //only hour and minute are important for alarm interrupt
VICVectAddr13 = (unsigned long) RTC_IRQHandler; // set interrupt vector 13
VICVectPriority13 = 15 ;
VICIntEnable |= (1UL<<13); // Enable RTC Interrupt
while(1)
{
//rest of my code
}
} |