View Single Post
  #5   Spotlight this post!  
Unread 30-01-2005, 14:03
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: Confused about Interrupts

To the interrupt-capable amongst us, an additional conundrum. From reading Interrupts for Dummies, it appears that Dig IO pins 1-6 can be used for interrupts.

Why then, does Kevin's encoder routine use pins 1 and 6 for one side and 2 and 8 for the other?

If you want to use other Hall encoders, how many can you use? is 6 the magic number, or is only 2? (pins 1 and 2)

Jon from Team 236


Quote:
Originally Posted by karch
why is it that in setting up priority levels for interrupts, the parent intcon number changes:
INTCON3bits.INT2IP = 0; // Pin 1
INTCON2bits.INT3IP = 0; // Pin 2
INTCON2bits.RBIP = 0; // Pins 3, 4, 5, 6

but in setting up edge select, pin 1 and pin 2 are both intcon2bits:
INTCON2bits.INTEDG2 = 1; // Pin 1
INTCON2bits.INTEDG3 = 1; // Pin 2

and then when setting interrupt flags, they both turn into 3s?
INTCON3bits.INT2IF = 0; // Pin 1
INTCON3bits.INT3IF = 0; // Pin 2
INTCONbits.RBIF = 0; // Pins 3, 4, 5, 6

(not to mention pins 3,4,5,6 going from 2 to no number)

i got this code from the interrupts_for_dummies pdf in the white pages, so i'm assuming that this is correct code.

is it all just arbitrary, or what? what am i missing here?