Go to Post OMG, yet another blatant attempt by FIRST at being open and transparent! What is this place coming to?? :p - DonRotolo [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 14-02-2005, 19:56
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Need Help with Encoder - Won't Count Clicks

I need help getting these encoder clicks to work in the 2005 FRC. It works fine in the demo encoder.hex. But I can't it to work with the current frc.

What am I doing wrong??

Thanks
Adam
Attached Files
File Type: txt user_routines.c.txt (19.8 KB, 34 views)
  #2   Spotlight this post!  
Unread 14-02-2005, 20:03
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

I am not sure whats included inside of the 'Initialize_Encoders();' function, but I believe that you need to initialize the interrupts first by running function 'Initialize_Interrupts();' before you run 'Initialize_Encoders();' inside of function 'User_Initialization()', like so:
Code:
void User_Initialization (void)
{
...
Initialize_Interrupts();
Initialize_Encoders();
Putdata(&txdata);			 /* DO NOT CHANGE! */
...
}
__________________
- from B B frank

  #3   Spotlight this post!  
Unread 14-02-2005, 20:55
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Need Help with Encoder - Won't Count Clicks

Error - could not find definition of symbol 'Initialize_Interrupts' in file 'C:\FrcCode2005v2.4\user_routines.o'.
Errors : 1

  #4   Spotlight this post!  
Unread 14-02-2005, 21:30
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: Need Help with Encoder - Won't Count Clicks

Quote:
Originally Posted by Kingofl337
Error - could not find definition of symbol 'Initialize_Interrupts' in file 'C:\FrcCode2005v2.4\user_routines.o'.
Errors : 1

Then I would suggest that you add it...
__________________
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...
  #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.
  #6   Spotlight this post!  
Unread 16-02-2005, 18:30
whakojacko's Avatar
whakojacko whakojacko is offline
Registered User
FRC #1072 (hrt)
Team Role: College Student
 
Join Date: Feb 2003
Rookie Year: 2003
Location: San Jose, California
Posts: 137
whakojacko is on a distinguished road
Send a message via AIM to whakojacko Send a message via MSN to whakojacko
Re: Need Help with Encoder - Won't Count Clicks

EDIT: we got it working fine
__________________
Harker Robotics:1072
http://www.harker-robotics.org

Last edited by whakojacko : 16-02-2005 at 19:21.
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
encoder vs. motor stephenthe1 Programming 55 06-01-2005 22:07
Updated Encoder Code Available Kevin Watson Programming 2 04-01-2005 01:00
Choosing an Encoder for the Drive-train MikeDubreuil Electrical 11 21-10-2004 00:50
quick question: TIMERS Xufer Programming 58 18-03-2004 08:49
how to add steps in the provided encoder program for the edu Zaramel2002 Programming 3 11-02-2004 08:35


All times are GMT -5. The time now is 08:14.

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