Rcif flag problem

Discussion in 'Embedded Systems and Microcontrollers' started by aneeshmp200745, Mar 17, 2010.

  1. aneeshmp200745

    Thread Starter New Member

    Feb 24, 2010
    9
    0
    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!!
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,790
    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.
     
  3. aneeshmp200745

    Thread Starter New Member

    Feb 24, 2010
    9
    0
    RCIE AND GIE ARE ENABLED but and it goes to interrupt routine my problem is it is not coming out from ISR
     
  4. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Are you looping in the ISR? Or are you exiting to return?
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,790
    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.
     
  6. aneeshmp200745

    Thread Starter New Member

    Feb 24, 2010
    9
    0
    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
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,790
    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.
     
  8. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    why not post your code so it would be much easier instead of playing this guessing game???

    B. Morse
     
Loading...