Programming Help

Has anyone taken the time to list the equivalent mlab functions to Easy C functions? If so, I could use a copy to help me get started with mlab. Or, maybe there’s a link somewhere to this info.

Here is a tutorial on how to use the EasyC API with MPLAB:

At 10 AM Sunday the 13th the link ( to the vexfan site is dead…

Is that what I was supposed to learn to expect when/if I try to combine the EasyC API with MPLAB? :slight_smile:


I would re-post the tutorial, but I don’t use the EasyC API any more, and I can not recall how to do it :-(.

Link’s back up, good stuff…:slight_smile:

I’m reposting here in case the Vex Fan site goes down again.

Here is how you can make MPLAB use the API that EasyC supplies you with (no having to “hand code” it).

  1. Get MPLAB (any version (tested on 7.30)), IFI_Loader (optional) and install them.
  2. Open MPLAB, goto Project->Set Language Tool Locations.
  3. Set the executables for Microchip C18 Toolset to the tools in EasyC install path\EasyC\Mcc18\bin. The file name is in parentheses.
  4. Make a new project (Project->New…).
  5. Now to set the build options. You need to set these to the following directories (others are your choice). Include path must be set to: “EasyC install path\easyC\VeX\UserAPI”. Library path must be set to: “EasyC install path\mcc18\lib”. Linker-Script path must be set to: “EasyC install path\mcc18\lib”.
  6. Now to add some files to the project. Add the UserAPI.h file found at “EasyC install path\VeX\UserAPI”. Next, add all of the .o files in “EasyC install path\VeX\Object”. Now, add Vex_library.lib found in “EasyC install path\VeX\Library”. Finally add 18f8520user.lkr found in “EasyC install path\VeX\Linker”.
  7. Create a new file titled “bot.c” or something simillar (must be .c) Add the following to it
#include "UserAPI.h"

void IO_Initialization(void){
	//Controller Port #: 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16
	DefineControllerIO(4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);

void main(void){
        //robot code here
  1. You are now ready to start coding the robot

NOTE: When you compile a program in MPLAB, you have to manualy find the .hex file for upload. It is placed in your “Output directory” from the build options panel.

Any idea why I’m getting:

Deleting intermediary files… done.
Executing: “C:\Program Files\Intelitek\easyC\Mcc18\bin\cpp18.exe” -p=18F8520 “Test1.c” -fo=“Test1.o” /i"C:\Program Files\Intelitek\easyC\VeX\UserAPI" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
-p=18F8520: unknown option
Halting build on first failure as requested.
BUILD FAILED: Wed Aug 16 20:26:33 2006


I set compiler to cpp18 instead of mcc18:cool: