View Single Post
  #9   Spotlight this post!  
Unread 13-02-2005, 20:50
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Third Encoder Channel

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.