Hello everyone,
I am working on MSP430F5419A uc.
I initialize the alarm on everyday at 6 o'çlock. But it is not generating an interrupt on this time .
Here i am pasting the my code.please review the code and give valuable suggestions..
void rtcA_init(unsigned char en)
{
Calendar currentTime;
unsigned char alarm_time;
RTCCTL01 = RTCBCD + RTCHOLD + RTCMODE + RTCAIE +RTCRDYIE ;
// RTC enable, BCD mode,
// alarm every Minute,
// enable RTC interrupt
// Init time
//Setup Current Time for Calendar
currentTime.Seconds = rtc_time.sec;
currentTime.Minutes = rtc_time.min;
currentTime.Hours = rtc_time.hour;
currentTime.DayOfWeek = 0x01;
currentTime.DayOfMonth = rtc_time.day;
currentTime.Month = rtc_time.month;
currentTime.Year = rtc_time.year + 0x2000;
//Initialize Calendar Mode of RTC
/*
* Base Address of the RTC_A_A
* Pass in current time, intialized above
* Use BCD as Calendar Register Format
*/
RTC_A_calendarInit(RTC_A_BASE,
currentTime,
RTC_A_FORMAT_BCD);
alarm_time = 0x06;
RTC_A_setCalendarAlarm(RTC_A_BASE,
RTC_A_ALARMCONDITION_OFF,
alarm_time,
RTC_A_ALARMCONDITION_OFF,
RTC_A_ALARMCONDITION_OFF);
RTC_A_clearInterrupt(RTC_A_BASE, RTCAIFG);
RTC_A_enableInterrupt(RTC_A_BASE, RTCAIE);
RTC_A_startClock(RTC_A_BASE);
}
Regards,
Sanjay Mudale.