Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

interrupt problem

Status
Not open for further replies.

Tong

New Member
hi every one, i am actually using the Mikroc as my compiler, and now i am doing the receive UART interrupt. however i just manage to jump to ISR but does any one know how to return from the ISR? Previously i use the hardware interrupt which just clear the INTCON.INTF bit then it will return, yet this time the UART interrupt i clear the PIR1.RCIF and RCREG, it wont work, i really dont know what happen? thanks in advance for the helping hand.
 
Try this -


Code:
unsigned char RXDATA;

void interrupt isr (void)
{
         if (PIR1.RCIF)
         {
                RXDATA = RCREG;
         }

}

Placing the received data from RCREG into variable RXDATA should clear the RCIF flag.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top