Rcif flag problem

Thread Starter

aneeshmp200745

Joined Feb 24, 2010
9
sir im try to implement a system with GSM MODEM which is integrated in such away that pic microcontroller as heart gsm based device control
i used serial receiving part as interrupt once any messege comes its goes to interrupt routine but it is not exiting from interrupt service routine i found that RCIF flag stay as high always can anyone help me

thanks in advance!!
 

Papabravo

Joined Feb 24, 2006
22,116
There are at least two other things you need to do. You need to enable the Receive Complete Interrupt by setting RCIE (Receive Complete Interrupt Enable) to a 1, and there is a Global Interrupt Enable (GIE) which also needs to be set to a 1.
 

Papabravo

Joined Feb 24, 2006
22,116
RCIE AND GIE ARE ENABLED but and it goes to interrupt routine my problem is it is not coming out from ISR
You probably need to clear RCIF with an instruction sequence. Consult the datasheet. Don't forget to exit the interrupt routine with a RETFIE instruction or you won't clean things up properly.
 

Thread Starter

aneeshmp200745

Joined Feb 24, 2010
9
yes im exiting from interrupt routine but it is not coming back to main program i cleared the flag RCIF I USE isr for GSM MESSAGE READ im writing code in embedded c not in assembly

hoping....help
 

Papabravo

Joined Feb 24, 2006
22,116
Is the interrupt routine identified as an interrupt routine so the compiler knows to end it with RETFIE instead of another variant? Most compilers allow you to look at the assembly language output so you can check what is going on.
 
Top