Quote:
|
Originally Posted by stephenthe1
hi, I tried doing the same thing, but I ran into problems because interrupts 3-6 are "ganged together". how do I reference one at a time? I couldn't figure out how to clear the interrupt flag either. basically, are there any magic lines of code to access one instead of all 4.
|
The magic lines of code are what I cribbed from Kevin's
interrupts.c example.
Initialization is easy (easier than the other two interrupts, because there's no rising/falling edge selection). Testing to see which pin caused the interrupt involves remembering the state of PortB between interrupts and comparing the current state to see where they differ. My software also specifically checks to make sure the pin is in the proper state, so that I'm only calling the service routine on the desired edge of the signal.