OCCRA
Go to Post I'm not gonna reinvent the wheel cause I can already buy it :) - Stephen Kowski [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #76   Spotlight this post!  
Unread 01-01-2008, 10:26 AM
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 690
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Kevin Watson View Post
Here is a snapshot of the current build:

http://kevin.org/frc/ifi_frc_beta_2.zip

-Kevin
That's looking excellent.

trivial note: I don't know whether you update your comments along the way, or once the build has stabilized, but I just wanted to mention that the ifi_frc.c file still has all the old reference to user_code.c in it's comments.

Another thing I realized when I loaded this project was that your development environment and mine don't match, so it caused a hickup that may trip up first time users (me two years back

You have the CC18 environment loaded under the MPLAB program folder, wheras mine is loaded under the c:/ root. I have no idea if this was a decision of mine, or the compiler default (i think so), or a consequence of me simply "upgrading" last year's install, but it means that when I load your project, two things happen:

1) MPLabs prompts me as to whether I want to keep my old CC18 compiler and Linker folders or use the ones in the project (I say keep the old one)

2) I get a linker error because MPLAB can't find the clib library. I need to go to Build-Options/Directories/Library, and set the path from c:/program files/mplab/cc18/lib to c:/cc18/lib

My only reason for bringing this up is to determine what you, and the likely "critical mass" of users will be using. If CC18 should be loaded under MPLAB then I'll move mine. If this is contrary to the install default, then a "pre-install" readme would be a good idea to prevent (minimize) the initial confusion of new users.

Thanks for all the time you put in.

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor (2011 CMP Eng. Inspiration, 2010 Chesapeake Chairmans Award, 2009 Pittsburgh EI Award, 2008 Buckeye EI Award, 2006 Chesapeake Alliance Winner)
FTC2818 Coach (2011 CMP Divisional Finalist, 2011 MD Winning Alliance, 2010 MD & OH Winning Alliance Captain, 2009 MD Inspire Award and Championship Finalist).
FTC4240 Mentor (2011 CMP Divisional Finalist Captain, 2011 MD Winning Alliance Captain).
FLL Team NeXTGEN Mentor (2011 CMP 3rd place Strategy & Innovation, US Open 09, Champions Award: '11 MD, 09 PIT, 08 & 07 MD)

  #77   Spotlight this post!  
Unread 01-01-2008, 01:45 PM
ay2b's Avatar
ay2b ay2b is offline
Registered User
AKA: Andy
FRC #2928
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 1994
Location: Seattle, WA
Posts: 200
ay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant futureay2b has a brilliant future
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Kevin Watson View Post
Okay, it's easy enough to do, but disabled mode is nominally called three times each round (before autonomous, between autonomous and teleop, and after teleop). Should Disabled_Init( ) be called each time, or only the first time? If only the first time, under what conditions would the default_init_flag get reset?
I believe it should be called every time that the robot enters into disabled mode.
__________________

2011 - SD Quarterfinalists (980), LA Quarterfinalists (980)
2010 - LA (2404) Finalists (980), AZ Motorola Quality (980)
2009 - LA Semifinalists (980); Las Vegas Quarterfinalists (980); SD (2404); IRI #1 Seed, Finalist (980)
2008 - SD Quarterfinalists (980), LA Champions (980), LA Rookie Inspiration Award (2404); CalGames Finalists
2007 - So.Cal Finalists (980), SD Quarterfinalists (980); CalGames Finalists
2006 - So.Cal Regional Champion (4), Toronto Judge's Award Day 1 (4)
2005 - SVR Champions, Delphi "Driving Tomorrow's Technology" (980); AZ Xerox Creativity (980); So.Cal Finalists, RadioShack Innovation in Control (980); Championship Archimedes Division Semifinalists; IRI Finalists (980)
2004 - So.Cal Regional Champions, Leadership in Controls (980); AZ GM Industrial Design (980); Championship Galileo Division #2 Seed; IRI Champions
2003 - PNW Semi-finalists (488)
2002 - PNW Finalists (488)
2000 - X-bot / 488 - Mentor / Founder
1994 - Sunny Delight - Driver - champion
  #78   Spotlight this post!  
Unread 01-02-2008, 05:42 PM
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by lukevanoort View Post
You could basically copy and paste the code from the encoder driver's ISRs into the ISRs in this version (or put them in another file and call them from the ISRs, which would probably be more readable) and add the Get_Encoder_x_Count() function. Actually, if you just didn't call the initialization functions, you could probably use the current encoder code verbatim (well, for encoders one and two anyway, for 3-6 you'd probably just want to reuse the code from encoder 1-2 instead of the encoder driver's functions for encoders 3-6). I would say that it would probably be less than 20mins to code.
Thanks. For now, I commented out the code for encoders 3-6, and I use the code for 1 and 2 by having the Int_1_Handler() in interrupts.c call on Encoder_1_Int_Handler() in encoder.c. This sounds like it should work, and I'll post here if it works or if it fails and I can't figure it out by myself.

How about gyros? I noticed that your gyro code from last year uses both gyro.c/h and adc.c/h. I copied both of thme, and I've been fumbling for a while with integrating them and timers.c. I have not been able to do that yet, generating a red-light-of-doom in the process. Any ideas or advice?

EDIT: Kevin, I believe I may have found a problem. Interrupts.h uses #define ENABLE_INT_# (for # being 1,2,...), while ifi_frc.c checks #ifdef ENABLE_INTR_# when checking for the ISR. That is an oversight, right? I searched the rest of the files and could not find another reference to ENABLE_INTR_#.

Last edited by Guy Davidson : 01-02-2008 at 07:40 PM. Reason: Found a problem
  #79   Spotlight this post!  
Unread 01-02-2008, 07:23 PM
billbo911's Avatar
billbo911 billbo911 is offline
Registered User
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 1,837
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Kevin Watson View Post
Okay, it's easy enough to do, but disabled mode is nominally called three times each round (before autonomous, between autonomous and teleop, and after teleop). Should Disabled_Init( ) be called each time, or only the first time? If only the first time, under what conditions would the default_init_flag get reset?

-Kevin
Another thought popped into my head about Disabled_Init(). The three times a robot gets disabled is true in most years games, but some years it happens a lot more. Remember 2005, every time the human player stepped off the enable mat to load a Tetra on a robot, that robot was disabled. So, with this in mind, the function would definitely need a flag that would only allow it to initialize on reboot or power up.
__________________
So long and thanks for all the fish!

CalGames 2009 Semi Finalist, CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist, 2010 Madtown Creative Design Award
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2013 Pow3rhou53 Pwnage Gracious Professionalism Award.
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division, Gracious Professionalism Award.
  #80   Spotlight this post!  
Unread 01-02-2008, 08:23 PM
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,331
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: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by sumadin View Post
Thanks. For now, I commented out the code for encoders 3-6, and I use the code for 1 and 2 by having the Int_1_Handler() in interrupts.c call on Encoder_1_Int_Handler() in encoder.c. This sounds like it should work, and I'll post here if it works or if it fails and I can't figure it out by myself.

How about gyros? I noticed that your gyro code from last year uses both gyro.c/h and adc.c/h. I copied both of thme, and I've been fumbling for a while with integrating them and timers.c. I have not been able to do that yet, generating a red-light-of-doom in the process. Any ideas or advice?

EDIT: Kevin, I believe I may have found a problem. Interrupts.h uses #define ENABLE_INT_# (for # being 1,2,...), while ifi_frc.c checks #ifdef ENABLE_INTR_# when checking for the ISR. That is an oversight, right? I searched the rest of the files and could not find another reference to ENABLE_INTR_#.
You might want to wait on the encoders as I have a scheme to make the encoder ISRs more efficient. I'll be coding it up sometime in the next few days.

I'll also port the ADC code too at some point (I need to find a better way of installing ISRs).

I'll look into the INTR vs. INT issue this evening. It's probably just some knuckle-headedness on my part. Thanks for catching it.

-Kevin
__________________
Kevin Watson
Engineering consultant to
Space Exploration Technologies (SpaceX) and
Google Advanced Technologies and Projects
http://kevin.org
  #81   Spotlight this post!  
Unread 01-03-2008, 02:03 PM
Mike Mahar Mike Mahar is offline
Registered User
FRC #0138
 
Join Date: Jan 2007
Location: Amherst, NH
Posts: 64
Mike Mahar will become famous soon enough
Re: New C18 3.0+ Compatible FRC Code

How do you get a version 8 MPLAB? The disks that we've received from FIRST were all version 7.20. IFIRobotics' web site still claims that they only work with 7.20. I didn't notice the MPLAB requirement and now I have a hybred system that won't compile my 2.4 code nore will it open Kevin's new workspace.
  #82   Spotlight this post!  
Unread 01-03-2008, 02:14 PM
Tom Bottiglieri Tom Bottiglieri is offline
Custom User Title
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,010
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
Send a message via AIM to Tom Bottiglieri
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Mike Mahar View Post
How do you get a version 8 MPLAB? The disks that we've received from FIRST were all version 7.20. IFIRobotics' web site still claims that they only work with 7.20. I didn't notice the MPLAB requirement and now I have a hybred system that won't compile my 2.4 code nore will it open Kevin's new workspace.
www.microchip.com
It's free
  #83   Spotlight this post!  
Unread 01-03-2008, 02:15 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins Send a message via Skype™ to EHaskins
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Mike Mahar View Post
How do you get a version 8 MPLAB? The disks that we've received from FIRST were all version 7.20. IFIRobotics' web site still claims that they only work with 7.20. I didn't notice the MPLAB requirement and now I have a hybred system that won't compile my 2.4 code nore will it open Kevin's new workspace.
MPLab v8 can be downloaded directly from Microchip.com.

I have had no issues running c18 v2.4 or v3.10 with MPLab v8.

Your 2.4 code will not compile with c18 v3, and the MPLab v8 workspaces will not open in older versions of MPLab. If you want to be able to compile your 2.4 code, you'll need to copy the mcc18 folder from a computer with 2.4 installed, and change the header, linker, and library serch folders of you 2.4 projects to point to the 2.4 folders.
__________________
Eric Haskins KC9JVH
  #84   Spotlight this post!  
Unread 01-03-2008, 02:34 PM
Code Monkey Code Monkey is offline
Registered User
FRC #1622
 
Join Date: Dec 2007
Location: San Diego
Posts: 10
Code Monkey is an unknown quantity at this point
Re: New C18 3.0+ Compatible FRC Code

Last year we got an updated adc code which only used 1 interrupt per sample, instead of 2. Is this already implemented in the new adc code? Also last year we had to use a new processor .h file for the encoders. I see the encoder work is in progress, so this will also disappear, I hope?

Isn't it new to be able to program for the disabled mode? Is there a hint there?
  #85   Spotlight this post!  
Unread 01-03-2008, 02:41 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins Send a message via Skype™ to EHaskins
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Code Monkey View Post
Isn't it new to be able to program for the disabled mode? Is there a hint there?
Previously the same code would be run in the robot was Disabled or Enabled. The outputs were just disabled.
__________________
Eric Haskins KC9JVH
  #86   Spotlight this post!  
Unread 01-03-2008, 03:02 PM
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by EHaskins View Post
Previously the same code would be run in the robot was Disabled or Enabled. The outputs were just disabled.
Actually, you could always determine if the robot was disabled or enabled, the default IFI code just didn't make use of it and neither did most teams' custom code.

My team, and probably several others (I know Chief Delphi does it or at least did it at one point), implemented mode determination to help prevent integrator wind up in PID loops.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
  #87   Spotlight this post!  
Unread 01-03-2008, 03:04 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins Send a message via Skype™ to EHaskins
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by lukevanoort View Post
Actually, you could always determine if the robot was disabled or enabled, the default IFI code just didn't make use of it and neither did most teams' custom code.

My team, and probably several others (I know Chief Delphi does it or at least did it at one point), implemented mode determination to help prevent integrator wind up in PID loops.
That's the only reason I ever did it.
__________________
Eric Haskins KC9JVH
  #88   Spotlight this post!  
Unread 01-03-2008, 03:25 PM
Code Monkey Code Monkey is offline
Registered User
FRC #1622
 
Join Date: Dec 2007
Location: San Diego
Posts: 10
Code Monkey is an unknown quantity at this point
Re: New C18 3.0+ Compatible FRC Code

Looking back at other posts, I see that now. It is nice for newer teams to see that they could initialize the gyro while siting and waiting for the match to begin. Now that is explicit. This newer code does look straight forward.

I won't get a chance to actually download this into a CD prior to kick off, but will spend my lunches studying it.

Thanks to all of you already solving problems!
  #89   Spotlight this post!  
Unread 01-03-2008, 05:08 PM
Capt. Quirk Capt. Quirk is offline
Registered User
AKA: Bill Mazzacane
FRC #1704 (Robotic Steelers)
Team Role: Mentor
 
Join Date: Aug 2007
Rookie Year: 2007
Location: SoCalif
Posts: 64
Capt. Quirk will become famous soon enoughCapt. Quirk will become famous soon enough
Re: New C18 3.0+ Compatible FRC Code

I see there is a .lkr file 18f8520, does that mean I can play with it on a VEX bot?
  #90   Spotlight this post!  
Unread 01-03-2008, 05:09 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins Send a message via Skype™ to EHaskins
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Capt. Quirk View Post
I see there is a .lkr file 18f8520, does that mean I can play with it on a VEX bot?
No, you also need a version of the library for vex.
__________________
Eric Haskins KC9JVH
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
Does the camera code suits to all versions of MPLAB and C18? razer Programming 3 01-04-2007 01:50 PM
Trying to follow C18 interrupt context code... dcbrown Programming 5 12-21-2006 08:01 AM
Error w/ FRC code JamesBrown Programming 2 01-08-2005 03:17 PM
Programming code Fix FRC Ferazel2001 Programming 6 02-08-2004 01:46 AM
FRC default code hedgehogger Programming 2 01-21-2004 05:41 PM


All times are GMT -5. The time now is 09:17 AM.

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


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