View Single Post
  #5   Spotlight this post!  
Unread 14-02-2005, 21:31
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
Re: Need Help with Encoder - Won't Count Clicks

Sorry, thats just in my teams code I guess, I do not remember the default code, here is what the function looks like:
Code:
void Initialize_Interrupts(void) 
{
// initialize external interrupt 1 (INT2 on user 18F8520)
TRISBbits.TRISB2 = 1; // make sure the RB2/INT2 pin is configured as an input [108]
		//
INTCON3bits.INT2IP = 0; // 0: interrupt 1 is low priority (leave at 0 for IFI controllers) [91]
		// 1: interrupt 1 is high priority
		//
INTCON2bits.INTEDG2 = 1; // 0: trigger on the falling-edge [90]
		// 1: trigger on the rising-edge
		//
INTCON3bits.INT2IE = 1; // 0: disable interrupt 1 [91]
		// 1: enable interrupt 1
 
// initialize external interrupt 2 (INT3 on user 18F8520)
TRISBbits.TRISB3 = 1; // make sure the RB3/CCP2/INT3 pin is configured as an input [108]
		//
INTCON2bits.INT3IP = 0; // 0: interrupt 2 is low priority (leave at 0 for IFI controllers) [90]
		// 1: interrupt 2 is high priority
		//
INTCON2bits.INTEDG3 = 1; // 0: trigger on the falling-edge [90]
		// 1: trigger on the rising-edge
		//
INTCON3bits.INT3IE = 1; // 0: disable interrupt 2 [91]
		// 1: enable interrupt 2
}
It might be in your 'Initialize_Encoders();' routine, so check in there to see if its there before adding another function.

edit:
- if you are adding the function, be sure to set the right interrupts you re using, and if not, make sure that they are set correctly as of now -

How are "Get_Left_Encoder_Count();" and "Get_Right_Encoder_Count()" defined in your code?
And what does your 'InterruptHandlerLow()' (inside of user_routines_fast.c) function include?
__________________
- from B B frank


Last edited by AIBob : 14-02-2005 at 21:40.