real time clock (RTC)&External interrupt

i have rtc and i want to add in this a external interrupt so that whnever external event occour(perss external button) my rtc time etc. will save n display on my hyperterminal PLZZZZZZZZZ HELP ME,

my code as follows;

/***********************************************************************

  • arm_rtc_main.c

************************************************************************/

#include<lpc21xx.h>

#include<board.h>

#include “rtc.h”

RTC Rtc_st_rtc_input;

RTC Rtc_st_rtc_output;

int main(void)

{

/for testing purpose/

Rtc_st_rtc_input.ui_date =23;

Rtc_st_rtc_input.ui_month = 12;

Rtc_st_rtc_input.ui_year = 2012;

Rtc_st_rtc_input.ui_hour = 11;

Rtc_st_rtc_input.ui_minute = 59;

Rtc_st_rtc_input.ui_second =55;

Rtc_st_rtc_input.ui_ampm = 1;

Rtc_st_rtc_input.ui_time_format = 1;

/Interrupt initialisation for second’s interrupt/

(*VICIntSelect)=0x0;

(*VICVectAddr0) = (unsigned)Rtc_SEC_INC_ISR;

(*VICVectCntl0) = 0x2D;

/*Interrupt initialisation for time out interrupt */

(*VICIntSelect)=0x0;

(*VICVectAddr1) = (unsigned)TIMER_ISR;

(*VICVectCntl1) = 0x24;

VICIntSelect = 0x0; / making adc interrupt as IRQ interrupt */

*VICVectAddr2 = ( unsigned ) ADC_ISR; /*Assigning the isr address */

*VICVectCntl2 = 0x32; /*assigning external switch pin to slot 0 as to give highest priority */

(*VICIntEnable) = 0x00042010;

Rtc_init_rtc(); /initialize rtc/

Rtc_validation();

if(Rtc_ui_date_invalid == 0 && Rtc_ui_time_invalid == 0)

{

Rtc_user_set();

}

delay_timer();

(*ADCR)=ADC_CONFIG; /Configure & start adc/

while(1)

{

if (Adc_ui_conversion_complete == YES)

{

Adc_scaling();

}

}

return 0;

}

Huh?

Please read the docs for your chip, eg. LPC2148 produces a RTC interrupt when the Alarm Mask Register matches the clock time.

The 2 external RTC chips I have used have both had 3 Alarms settings that trip interrupts. Use the hw, don’t reinvent it.

Regards.