Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Creating new MPLab Project (http://www.chiefdelphi.com/forums/showthread.php?t=41859)

Mike 14-01-2006 16:16

Creating new MPLab Project
 
So today I tried opening up the '06 code on my MPLAB 6.3. It wouldn't open, so I figured "OK, I can just make a new project." I did that, got the correct chip to program for, etc. Now it gave me an error on
Code:

Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
The error was
Quote:

C:\FIRST\code\user_routines_fast.c:143:Error [1203] too few arguments in function call
So, I did a search for Generate_Pwms. It returned
Code:

#ifdef _FRC_BOARD
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_13,unsigned char pwm_14,
                                  unsigned char pwm_15,unsigned char pwm_16);
#else
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_1,unsigned char pwm_2,
                                  unsigned char pwm_3,unsigned char pwm_4,
                                  unsigned char pwm_5,unsigned char pwm_6,
                                  unsigned char pwm_7,unsigned char pwm_8);
#endif

So I assume it is using the second function prototype. This is probably because I neglected to set the pre-processor _FRC_BOARD. I looked in all the menus and such, but couldn't find a listing of pre-processor directives and their values. How do I change that value?

Thanks

Alan Anderson 14-01-2006 18:13

Re: Creating new MPLab Project
 
I don't have a copy of MPLAB handy to check, but I'm pretty sure you'll find a "Compiler Options" choice under the Project menu.

Manoel 14-01-2006 18:22

Re: Creating new MPLab Project
 
With your project open in MPLAB:

Project > Build Options > Project

There, select the MPLAB C18 tab and, under Macro Definitions, add _FRC_BOARD.

You can also enable code optimizations by editing the "-Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-" strings.

These two posts discuss it in more detail.

Mike 14-01-2006 19:09

Re: Creating new MPLab Project
 
Ok, so I did that. I also had to have a custom error suppressantt added to my build options, so I now use the "User alternate settings" function. So to add a macro, I found out that I needed to append -D_MACRO_NAME to my build options. My total build options are now
Code:

-D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
But now I get the error
Quote:

Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mplink.exe" /l"c:\mcc18\lib" "18f8520.lkr" "C:\FIRST\code\camera.o" "C:\FIRST\code\ifi_startup.o" "C:\FIRST\code\ifi_utilities.o" "C:\FIRST\code\main.o" "C:\FIRST\code\serial_ports.o" "C:\FIRST\code\terminal.o" "C:\FIRST\code\tracking.o" "C:\FIRST\code\user_routines.o" "C:\FIRST\code\user_routines_fast.o" "C:\FIRST\code\FRC_alltimers.lib" "C:\FIRST\code\FRC_alltimers_8520.lib" "C:\FIRST\code\FRC_library.lib" "C:\FIRST\code\FRC_library_8520.lib" /o"FRC.cof"
MPLINK 3.50, Linker
Copyright (c) 2003 Microchip Technology Inc.
Assertion failed: 0, file ..\..\mplink\LanguageToolShared/mgproc.c, line 873

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Any idea of what's wrong now?

Astronouth7303 15-01-2006 14:26

Re: Creating new MPLab Project
 
Quote:

Originally Posted by Mike
Ok, so I did that. I also had to have a custom error suppressantt added to my build options, so I now use the "User alternate settings" function. So to add a macro, I found out that I needed to append -D_MACRO_NAME to my build options. My total build options are now
Code:

-D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
But now I get the error


Any idea of what's wrong now?

I believe this is akin to the infamous syntax error. It decided it didn't like you, or something.

First try cleaning the project and rebuilding (in case of file corruption). Then try changing some compilation options. (eg, optimization)


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

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