Ganged Interrupt Edge Detection

Do Interrupts on the RB Port (Ganged Interrupts) have any edge detection registry assignments?

If enabled, all four fire off on both edges. If you are interested in executing an ISR on only one edge, just examine the state of the pin in the ISR and execute your code only when it is at the right logic level (e.g., if it’s a one, a rising edge just happened). If you’re using my code, I pass the logic level into the ISR for you.

-Kevin

If enabled, all four fire off on both edges. If you are interested in executing an ISR on only one edge, just examine the state of the pin in the ISR and execute your code only when it is at the right logic level (e.g., if it’s a one, a rising edge just happened). If you’re using my code, I pass the logic level into the ISR for you.

-Kevin

How should I go about reading that logic level?
-Stephen

(e.g., if it’s a one, a rising edge just happened)

That just means 1 or 0 basically

And what registry value outputs that information?
Thanks Stephen

if you look in the default code in the interrupt handler

  else if (INTCONbits.RBIF && INTCONbits.RBIE)  /* DIG I/O 3-6 (RB4, RB5, RB6, or RB7) changed. */
  {
    int_byte = PORTB;          /* You must read or write to PORTB */
    INTCONbits.RBIF = 0;     /*     and clear the interrupt flag         */
  }     

PORTB is the register. You have to read/write to it before you can clear the flag. Have a look at how Kevin does it in his encoder code, and do you know bitwise operators and the such?

Yea, but I got the impression that in his encoder code, he used the registry value to distinguish which interrupt had fired, not which edge was being detected.

Thats where the 0 or 1 part comes into play. Take a look at the spec sheet and you will see what is in the PORTB register, and also look into bitwise operators (specifically XOR)

Encoder_3_Int_Handler(Port_B & 0x10 ? 1 : 0); // call the encoder 3 interrupt handler (in encoder.c)

I see it now, the XOR gate operator for Port_B_Delta is to distinguish which interrupt fired. Then the line of code above inputs a 0 or 1 into the function to tell whether a rising or falling edge has interrupted. Thank you for all your help wt200999