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

Serial ISR for ADUC842

Hello sir,

I need to write an ISR for serial interrupt.

void serial_int (void) interrupt 4 //ISR for Serial interrupt

{

if((IE & BIT4) == BIT4) //UART interrupt source

REN = 1; // enables serial port reception { while(RI == 0) {} RI = 0; ucRxChar1 = SBUF;
} this is how i have written the ISR...
I am unable to run my program...
it is giving error...
is der any other way to write ISR?

REGARDS
MAYURI

Parents
  • Do you really think an interrrupt handler should have a busy-loop where it waits for the hardware to be ready for something? Isn't the intention with an interrupt handler that the processor interrupts the normal program execution when the hardware gets ready for something?

    What hapens if you have an ISR that gets stuck in an infinite loop? Will the main program ever run then?

    By the way - did you seriously dislike the look of your post with the code posted using the proper tags as described directly above the message input box? What made you think using the tags was a bad idea best avoided?

Reply
  • Do you really think an interrrupt handler should have a busy-loop where it waits for the hardware to be ready for something? Isn't the intention with an interrupt handler that the processor interrupts the normal program execution when the hardware gets ready for something?

    What hapens if you have an ISR that gets stuck in an infinite loop? Will the main program ever run then?

    By the way - did you seriously dislike the look of your post with the code posted using the proper tags as described directly above the message input box? What made you think using the tags was a bad idea best avoided?

Children