Quote:
|
Originally Posted by Jay Lundy
You don't have to do it like that. Dig I/O pins 3-6 are interrupt on change, so just plug it into dig io pin 3 and when RBIF triggers check to see that it is indeed pin 3 that changed (since 3-6 all trigger the same flag). You can sense both rising and falling edges on the same pin.
|
Just FYI, interrupts 1 and 2 can also exhibit this behavior if you flip the INTEDGx bit in the interrupt handler. As a starting point, I'd suggest using the code in receiver.c/.h because it pretty much does exactly what you need to do (pulse width discrimination). I'm not sure if it's usable (IFI may have wired-in a output buffer on the CCP pins), but you might also look into using the CCP Capture mode to do this.
-Kevin