i've written a progam for RTC but its not working please check.
main()
{
Init_UART0(9600);
InitTimer();
uart0Puts("Initialize OK \n\r");
RTC_Init();
while(1)
{}
}
__irq void RTC_ISR(void)
{
if(RTC_ILR & 0x01)
{
uart0Puts("Counter incrementing\n\r");
RTC_ILR = 0x01; //clear interrupt
}
VICVectAddr=0x00000000;//dummy write to signal end of enterrupt
}
void RTC_Init(void) //Pclk=12Mhz
{
RTC_CISS = 0x00;
RTC_CIIR = 0x01; //enable seconds counter interrupt
RTC_CCR = 0x01; // Enable clock
RTC_ILR = 0x01; //enable clock interrupt and inactive alarm interrupt
RTC_PREINT = 0x0000016D; //set RTC prescalar for 12Mhz;=(PCLK/32768)-1
RTC_PREFRAC= 0x00001B00; // = PCLK - ((PREINT + 1) x 32768)
VICVectAddr13=(unsigned long)RTC_ISR;
VICVectCntl13=0x0000002D;
VICIntEnable= 0x00002000;
}
thanks for the reply