Go to Post ROBUST, ROBUST and ROBUST if you want to win - dan 322 [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 18-02-2008, 10:44
Sykan's Avatar
Sykan Sykan is offline
Lead Programmer
AKA: David
FRC #0540 (Team 540)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Virginia
Posts: 24
Sykan is on a distinguished road
Interrupt Trouble

i've been testing my encoders and encoder 1 doesn't count intill the other encoder has something to count

i donno but it doesn't seem that interrupt 1 is called intill interrupt 2 is called and vis versa.

any ideas?

Thank you, in Advanced
  #2   Spotlight this post!  
Unread 18-02-2008, 11:04
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,721
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Interrupt Trouble

Are you using MPLAB or EasyC? Are you using Kevin Watson's encoder code? Can you post your interrupt handler code? We need some more information before we can make intelligent suggestions. Offhand, I can suggest that your interrupt handler isn't correct in some fashion, you've forgotten to enable interrupts on the encoder pin, you've plugged the encoder into the wrong place, your encoder simply isn't working properly or isn't sending strong enough signals.... Unless you want to spend the day running down every single random idea we can toss out, please post more info about what's connected where physically, and what your program actually is.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 18-02-2008, 11:53
Sykan's Avatar
Sykan Sykan is offline
Lead Programmer
AKA: David
FRC #0540 (Team 540)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Virginia
Posts: 24
Sykan is on a distinguished road
Re: Interrupt Trouble

The Encoders are connected to Port 1 and 2 of digital input.
i'm Using Kevins Code with Mplab

Sense i'm using the KOP Encoder i've changed the Interrupt handler to
if (pwm16 >= 127){
Encoder_1_Count += ENCODER_1_TICK_DELTA;
}
else {
Encoder_1_Count -= ENCODER_1_TICK_DELTA;
}
for both oh/course with the correct corresponding Motor and Encoder Count.

i've Enabled the Int in the ifi_frc.h, the Encoder.h and the Initialize_Encoder_1(); in the teleop.c

I haven't Changed anything else
  #4   Spotlight this post!  
Unread 18-02-2008, 13:02
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: Interrupt Trouble

Quote:
Originally Posted by Sykan View Post
i've been testing my encoders and encoder 1 doesn't count intill the other encoder has something to count

i donno but it doesn't seem that interrupt 1 is called intill interrupt 2 is called and vis versa.

any ideas?

Thank you, in Advanced
I'll look at your code if you zip it up and send it to me.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 18-02-2008, 15:51
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: Interrupt Trouble

Quote:
Originally Posted by Sykan View Post
i've been testing my encoders and encoder 1 doesn't count intill the other encoder has something to count

i donno but it doesn't seem that interrupt 1 is called intill interrupt 2 is called and vis versa.

any ideas?

Thank you, in Advanced
Having had a quick look at your code, nothing jumps out. What exactly is malfunctioning?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 18-02-2008, 16:07
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,721
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Interrupt Trouble

I'm kind of curious if he's updating pwm16 atomically so it's guaranteed to be in a valid state in the ISR. If he's left the default routine in and then updates it later in the routine he could get some odd effects every 26.2ms or so.... Also, there' always doing a clean build in case something's gone haywire.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #7   Spotlight this post!  
Unread 18-02-2008, 16:44
tern540degrees's Avatar
tern540degrees tern540degrees is offline
Registered User
AKA: Ben
FRC #0540 (Talon)
Team Role: Leadership
 
Join Date: Oct 2007
Rookie Year: 2008
Location: Richmond, VA
Posts: 1
tern540degrees is an unknown quantity at this point
Re: Interrupt Trouble

We figured it out. The signal was grounded through the frame. Thanks for all of the help.
__________________
"...each man calls barbarism whatever is not his own practice..." That makes us all barbarians.
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
interrupt enable 3dude_2231 Programming 6 10-02-2008 16:08
Inventor software trouble/ FIRST Base trouble nasa-senpai General Forum 2 24-01-2007 09:15
Interrupt question Kashi Chan Programming 2 07-03-2005 08:28
enable interrupt Dean Programming 2 13-02-2005 07:37
Interrupt limitations? randomperson Programming 2 27-12-2003 21:40


All times are GMT -5. The time now is 19: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