Go to Post While grandmothers are pretty cool, I would be hesitant in letting them determine what is and is not a robot. - Kellen Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2005, 21:30
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Calling Incorrect Interrupt Handler

I'm having a few problems with my program, and I've spent quite a while trying to figure out how to fix them, to no avail.

I am using Kevin Watson's encoder driver. I did encoder testing on the EDU RC, and everything worked fine. I switched to the FRC RC, and I have hooked up the encoders as stated in the file description. So, DIG IN 1 should cause interupt 2, which will in turn call the Left_Encoder_Int_Handler(). I do not have an encoder hooked up as the right side encoder (dig in 2) The encoder itself is working fine, but it increments the right side variable instead of the left. Also, when I plug the encoder into dig in 2, which should handle the right side encoder, neither right or left gets incremented. I have configured my phase B pins in the correct way, but I dont think this is part of the problem. Does anyone know what may be wrong?
  #2   Spotlight this post!  
Unread 09-02-2005, 22:48
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Calling Incorrect Interrupt Handler

Tom,

On the RC, DIO1 is tied to interrupt 1 and DIO2 is tied to interrupt2.

Are you trying to run the EDU code on the RC? If so, be advised that they are not compatible.

Regards,

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 09-02-2005, 23:00
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Calling Incorrect Interrupt Handler

Quote:
Originally Posted by Mike Betts
On the RC, DIO1 is tied to interrupt 1 and DIO2 is tied to interrupt2.
I beg to differ.
Quote:
only the first 6 digital I/O pins (pins 1 – 6) can be set to generate interrupts (INT2 – INT7)
Quote:
The interrupts (INT2 and INT3) on pins 1 and 2 are separate and independently configurable. However, the interrupts (INT4, INT5, INT6 and INT7) on pins 3 – 6 are ganged together.
Both of those quotes are from the Interrupts for Dummies white paper, but I know I've seen it in official documentation, too.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #4   Spotlight this post!  
Unread 09-02-2005, 23:05
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Calling Incorrect Interrupt Handler

Mike,

I am not using edu code on the bot, at the time i was using Kevin's EDU-Encoders workspace, but now I am using the FRC-Encoders.

I am pretty sure pin 1 is INT2

From user_routines_fast.c...
Code:
if (INTCON3bits.INT2IF && INTCON3bits.INT2IE)       /* The INT2 pin is RB2/DIG I/O 1. */
  { 
    INTCON3bits.INT2IF = 0;
	Left_Encoder_Int_Handler(); // call the interrupt 1 handler (in encoder.c)
  }
  else if (INTCON3bits.INT3IF && INTCON3bits.INT3IE)  /* The INT3 pin is RB3/DIG I/O 2. */
  {
    INTCON3bits.INT3IF = 0;
	Right_Encoder_Int_Handler(); // call the interrupt 2 handler (in encoder.c)
  }
  #5   Spotlight this post!  
Unread 09-02-2005, 23:42
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Calling Incorrect Interrupt Handler

Quote:
Originally Posted by Tom Bottiglieri
...I am pretty sure pin 1 is INT2...
Here's the PIC18F8520 to robot controller pin mapping.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 12-02-2005, 20:00
ScottWolchok ScottWolchok is offline
Pwnt.
#0217 (ThunderChickens)
Team Role: Programmer
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Utica, MI
Posts: 23
ScottWolchok will become famous soon enoughScottWolchok will become famous soon enough
Send a message via AIM to ScottWolchok
Re: Calling Incorrect Interrupt Handler

I am having the exact same problem. I could swear that the encoders even worked correctly a day or two ago! I have checked the connections several times - the left encoder's phase A is definitely on pin 1, and its phase B is on pin 6, but turning the left encoder increments the right encoder count and turning the right encoder does nothing at all. However, the left encoder count does change from 0 to -1 when the right encoder count is less than 0. I have gone so far as to simply compile and load the Navigation_FRC demo from kevin.org, but I still experience the problem. I have also switched encoders, encoder cables, and FRCs. Can anyone offer some advice?
  #7   Spotlight this post!  
Unread 12-02-2005, 21:15
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: Calling Incorrect Interrupt Handler

This sounds strangely like a problem I just had. It turned out that nothing was wrong with the encoder code (of course), just a printf statement.

Note that Get_Right_Encoder_count() returns a long! So you cannot
just put it into a printf with a %d type. If you have 2 %ds, you will
get 1/2 of the long for each one, the upper part is usually 0.

The thing to do is to use %ld to let printf know to expect a long value.
__________________
Don Reid
  #8   Spotlight this post!  
Unread 14-02-2005, 18:06
ScottWolchok ScottWolchok is offline
Pwnt.
#0217 (ThunderChickens)
Team Role: Programmer
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Utica, MI
Posts: 23
ScottWolchok will become famous soon enoughScottWolchok will become famous soon enough
Send a message via AIM to ScottWolchok
Re: Calling Incorrect Interrupt Handler

Quote:
Originally Posted by Don Reid
This sounds strangely like a problem I just had. It turned out that nothing was wrong with the encoder code (of course), just a printf statement.

Note that Get_Right_Encoder_count() returns a long! So you cannot
just put it into a printf with a %d type. If you have 2 %ds, you will
get 1/2 of the long for each one, the upper part is usually 0.

The thing to do is to use %ld to let printf know to expect a long value.
Yeah, that's exactly it. I casted the return values to int, and they still seem to be backwards, but I just swapped the wiring and carried on.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Timer interrupt hic-cupping - HELP roknjohn Programming 9 15-03-2004 17:56
Interrupt Handlers and Variable Scope kaszeta Programming 2 14-02-2004 18:30
Interrupts Questions mightywombat Programming 0 03-01-2004 14:50
What is an interrupt handler? Adam Y. Programming 7 14-08-2003 10:26


All times are GMT -5. The time now is 15:23.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi