Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   New C18 3.0+ Compatible FRC Code (http://www.chiefdelphi.com/forums/showthread.php?t=60377)

billbo911 06-01-2008 18:03

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by CPress (Post 670078)
Where can I get that?

Please define "that".

If you mean MPLAB 8.0 and C18 v3.1, please read the very first page.
If you are referring to MPLAB 7.4 and C18 v2.7, look in the KOP for the CBOT CD.

JohnC 06-01-2008 23:20

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by Code Monkey (Post 667533)
For those who have not already installed the MCC upgrade, make sure you put it in the same directory with the upgraded MPLAB 8.0. Otherwise the linker can't find the libraries. I know by the trying it the wrong way.

For people having issues with new MPLAB IDE and new C18 playing nice together:

When installing/updating your C18 compiler, (I went with 3.15 and am going to add the #endif that was mentioned earlier) there is a page of options after choosing which components to install that has the following:

[ ] Update MPLAB IDE to use this MPLAB C18
[ ] Update MPLAB IDE to use this MPLINK Linker, MPLIB Librarian, and MPASM Assembler

Check them! ;)

SuspectZero 07-01-2008 00:45

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by JohnC (Post 670631)
For people having issues with new MPLAB IDE and new C18 playing nice together:

When installing/updating your C18 compiler, (I went with 3.15 and am going to add the #endif that was mentioned earlier) there is a page of options after choosing which components to install that has the following:

[ ] Update MPLAB IDE to use this MPLAB C18
[ ] Update MPLAB IDE to use this MPLINK Linker, MPLIB Librarian, and MPASM Assembler

Check them! ;)

Edit: apparently that doesn't actually do the trick. I still get this:
MPLINK 4.15, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - could not find file 'clib.lib'.
Errors : 1

Link step failed.

for the clib.lib error go to Project> Build Options> Project> Directories Tab. in the Show Directories menu, select library search path. delete the old one and create a new one where the clib.lib is located (a simple search on your computer should be able to find it). i dont know if you should but you can also do the same with the Linker-Script Search path, in which you should delete the old directory location and create a new one going to the lkr folder in your mcc18 folder. that should fix the problem :)

can someone point me in the direction of a tutorial in which i can use this code to program our new 2008 bot? also is there a way of reading the printf statements in an executed program without having to upload onto our robot?

Guy Davidson 07-01-2008 01:01

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by SuspectZero (Post 670746)
can someone point me in the direction of a tutorial in which i can use this code to program our new 2008 bot? also is there a way of reading the printf statements in an executed program without having to upload onto our robot?

If you take Kevin's simple code and just read it, there's a fair chance you'll be able to do the simple stuff (i.e. left joystick forward = left motor forward) by yourself pretty easily. Reading the aliases in ifi_frc and seeing that the joysticks are referred do as p1_y for the y-axis, for example, and that pwm channels are simply pwm01 through 16 also helps. Where you want to start writing code is the Teleop() function in teleop.c, as that is the function that is called upon receiving data in the teleoperated mode.

As far as prtinf goes, if you place your robot on blocks (so that the wheels are spinning freely and not touching anything) and you keep the programming cable connected to the computer, you will see the results of all printf's in the terminal window that pops up after you're done downloading code usinng IFI Loader.

Hope this helps.

jtdowney 07-01-2008 11:42

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by Kevin Watson (Post 669351)
The officially supplied version is 2.4, but a free upgrade to 3.10 (don't use 3.15) is available on Microchip's website. I haven't tested it yet, but the freebie student version will probably work just fine. For those who want to stick with 2.4, I just built a version that will work with the older compiler. After I do a bit of testing, I'll post a link to it.

-Kevin

I can confirm that as long as you make the change Mark McLeod described in this post. The C18 3.15 Student Edition compiler works just fine.

paulcd2000 07-01-2008 16:03

Re: New C18 3.0+ Compatible FRC Code
 
Hey, i really like the look! I'm having this problem when i try to compile:

Code:

MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find file 'C:\2008 FRC\frc_library_24\ifi_frc_8722_24.lib'.
Errors    : 1

how to fix?

EDIT: Fixed it (for anyone else, add the library file again (project menu) wherever you installed it)

now i'm getting:

Code:

MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - Coff file format for 'ifi_frc_library.o' is out of date.
Error - Could not build member 'ifi_frc_library.o' in library file 'Z:\My Documents\robotics\ifi_frc_24\ifi_frc_8722_24.lib'.
Errors    : 2


EHaskins 07-01-2008 16:13

Re: New C18 3.0+ Compatible FRC Code
 
1 Attachment(s)
Quote:

Originally Posted by paulcd2000 (Post 671371)
Hey, i really like the look! I'm having this problem when i try to compile:

Code:

MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find file 'C:\2008 FRC\frc_library_24\ifi_frc_8722_24.lib'.
Errors    : 1

how to fix?

The project file is messed up a little. I attached a zipped copy of the .mcp file for the gyro and non-gyro versions. Replace the existing one with that one, and it should work.

THIS IS .MCP FILES ONLY! NO CODE!

EDIT: Are you using c18 v3+ to compile the v2.4 code?

paulcd2000 07-01-2008 16:18

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by EHaskins (Post 671384)
EDIT: Are you using c18 v3+ to compile the v2.4 code?

i believe i am. you download that from the microchip website? i have...
V 3.1

EHaskins 07-01-2008 16:19

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by paulcd2000 (Post 671392)
i believe i am. you download that from the microchip website? i have...
V 3.1

If you are using v3.1 you need to download the verison of the code for c18 v3+. It is listed on the first post of this thread.

paulcd2000 07-01-2008 16:23

Re: New C18 3.0+ Compatible FRC Code
 
i did download that one.

EDIT: oops... i didn't! Ok, well which of the various links is it? is it "the snapshot of the latest build"

EHaskins 07-01-2008 16:27

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by paulcd2000 (Post 671398)
i did download that one.

The library file reference in the error you posted is the v2.4 version.(you can tell by the "_24" ending of the library file and the project directory) Unless kevin included the wrong library you accidentally grabed the wrong file.

The first three links are 3+. The other two are v2.4.

Guy Davidson 07-01-2008 16:44

Re: New C18 3.0+ Compatible FRC Code
 
Kevin,

In the gyro.h file there are definitions for several different gyros. However, the new KoP gyro is not one of them. Do you think you will be able to add a set of constants for it next time you rebuild?

Thanks.

B.Johnston 07-01-2008 20:10

Re: New C18 3.0+ Compatible FRC Code
 
Sorry,

Not to drag everyone back to v2.4... but

Ive tried both a last years install and this years mplab v7.2 with 2.4 and it won't even open the 2.4 verion of the beta's project file.

There has been previous mention of mplab7.4 with 2.7.

This is not the version in our Canadian Kits.

Could we please clarify?

Kevin Watson 07-01-2008 20:44

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by sumadin (Post 671429)
Kevin,

In the gyro.h file there are definitions for several different gyros. However, the new KoP gyro is not one of them. Do you think you will be able to add a set of constants for it next time you rebuild?

Thanks.

I believe the KOP gyro has the same sensitivity (the important parameter to match) as the ADXRS150, which is already supported. I'll look into it and get back to you...

-Kevin

Kevin Watson 07-01-2008 20:51

Re: New C18 3.0+ Compatible FRC Code
 
Quote:

Originally Posted by 1680Bruce (Post 671668)
Sorry,

Not to drag everyone back to v2.4... but

Ive tried both a last years install and this years mplab v7.2 with 2.4 and it won't even open the 2.4 verion of the beta's project file.

There has been previous mention of mplab7.4 with 2.7.

This is not the version in our Canadian Kits.

Could we please clarify?

All versions of the code have project files created with version 8.00 of MPLAB. You can either upgrade to 8.0 for free or just use the project wizard to create a new project. Sorry about the hassle, but it seems like every new version of MPLAP uses a different format for the project files.

-Kevin


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

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