We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i m using CDP68HC68T1 RTC to trigger the interrupt once after one minute i receive data from zigbee. however, now the problem is that the interrupt of RTC will trigger once when i receive the data. this is a part of program for RTC interrupt.
void ext_int0(void) interrupt 0 { EX0=0; sprintf(s,"start alarm "); for(i=0; i<strlen(s); i++) Uart_Tx1(s[i]); LED=1; LED_ON(); LED_ONflag=1; LED_stop=1; LED_sec=0; //Read Status Reg to activate interrupt (set alarm interrupt) CS2 = 1; Read_SPI(STATUS_REG); SPI_Out(0x0A); //00001010 CS2 = 0; _nop_(); _nop_(); }
it is typically not a good idea to call a function from within the isr or to run time consuming jobs from within the isr.
and from the code posted, it is not possible to see where the delay is implemented: it seems the rtc will trigger ext_int0 and it will send the string / spi right away.
so you basically wrote the code to not do what you intend to do.