我在做RTC定时唤醒功能,现在遇到的问题是LPC2368安装RTC中断函数后,单片机就运行不起来,屏蔽掉中断后,单片机就能运行。RTC初始化函数如下:
void RTCInit(void)
{
RTC_CCR = 0;
RTC_YEAR = 2000; //?????2012
RTC_MONTH = 9; //?????3?
RTC_DOM = 29; //?????23?
RTC_HOUR = 17; //??????12?
RTC_MIN = 8; //?????0?
RTC_SEC = 0; //?????0?
RTC_CIIR = 0x00; // ?????????????
RTC_CISS = 0;
RTC_CCR = 0x10;
RTC_AMR = 0xfd;
RTC_ALYEAR = 2000;
RTC_ALMON = 9;
RTC_ALDOM = 29;
RTC_ALHOUR = 17;
RTC_ALMIN = 9;
RTC_ALSEC = 5;
Install_IRQ(RTC_INT, (void *)RTCHandler, 12);
RTC_ILR = 0x03; // ????????
RTC_CCR = 0x11; // ????????CLKEN??1,??RTC
RTC_PREINT = 380; //???????????11059200/32768-1,?336 0x000001C8
RTC_PREFRAC = 48160; //???????????11059200-337*32768,?16384 0x000061C0
}
|