Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

The Flight > Managing Multiple Interrupts - Pg. 81

Interrupts // set the ALARM for a _ALRMPTR = 2; // ALRMVAL = 0x1124; // ALRMVAL = 0x0006; // ALRMVAL = 0x0000; // specific day (my birthday) start the loading sequence MONTH-1/DAY-1 WEEKDAY/HOUR MINUTES/SECONDS 81 // set the repeat counter _ARPT = 0; // once _CHIME = 1; // indefinitely Now all you need to do is to set up the Alarm Mask as in: _AMASK = 0b1001; // set alarm once a year And enable the alarm and RTC interrupt in place of the Timer1 interrupt: _ALRMEN = 1; _RTCIF = 0; _RTCIE = 1; // enable alarm // clear interrupt flag // enable interrupt Finally, this is what the interrupt service routine will look like... // 1. RTCC interrupt service routine void _ISR _RTCCInterrupt( void) { // 1.1 clear the interrupt flag