This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

about RTC interrupt problem

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_();
}

Parents
  • 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.

Reply
  • 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.

Children
No data