Programming the VEX Controller

Can the VEX Controller be programmed? If so, what do I need? Also, what language will be used for programming?

Yes, the Vex Controller can be programmed using the C programming language. The Programming Kit available on the web uses easyC. Also, we have VexLabs MPLAB Programming Kits available which comes with cables, programming board, MPLAB and a C18 compiler from Microchip. The VexLabs MPLAB Programming Kits are not available online. Please see our Downloads page for more info.

1 Like

Is anyone aware of a JVM that can be used on the Vex Controller?

No, the Vex Controller can only be programmed in C or Assembly Language, these are the only languages supported by the Microchip Compiler.


Ricky Torrance
Electrical Engineer
VexLABS

1 Like

I don’t know much about programming, but I am familiar with C programming. Any suggestions on getting started for the beginner?

We have more documents on our IFIRibotics web site to help you get started. We have developed 2 other Robot Controllers, the FRC and the Mini; both pages have more documents that you can look at. Although you can not use any of the code from these sites, you can gain a lot of information and examples. All the controllers use the same Microchip processor and all use “C” as the programming language, therefore; the code is very similar. By comparing the Reference Guides to the Default Code, you can see examples of how the default code works. I would start from the Mini Controller page (http://www.ifirobotics.com/edu-rc.shtml) and then use the Start Programming link (http://www.ifirobotics.com/mini-rc-read-me.shtml). After reviewing all the manuals, try making small changes to the Default code. If you make a mistake, no problem; just download the Vex Default Code and your unit is just like it came from the factory. Soon, you should be well on your way to writing your own code.


Ricky Torrance
Electrical Engineer
VexLABS

1 Like

I have the full array of tools from developing code for our FRC robot last spring. It looks like Can I use the same tools to program the VEX. I have the CBOT compiler, MPLAB and I understand I need a different version of the IFI loader. Am I accurate in my accessment?

Yes, you can use the same tools for developing your code and use the current version of the IFI Loader to download your hex file. The other item you need is the Programming Module which is included in the easyC or the Prototype Programming Kit.


Ricky Torrance
Electrical Engineer
VexLABS

1 Like

I’m 16 years old and am looking forward to get this vex kit. Will I be able to control the robot without programming C++. Is there something I can learn on?

No programming is required, the unit comes with default code. The Vex System is the good place to start learning C. The easyC Programming Kit comes with software developed by Intelitek. This is a graphical tool that allows you to begin programming in C much easier. If you have further questions about easyC, you will need to contact Intelitek at support@intelitek.com or call 1-800-777-6268.


Ricky Torrance
Electrical Engineer
VexLABS

1 Like

Is there a way to program without easy C (meaning I want to create my own .c file)?

Yes there is a way to program with out using easyC. You can use Microchip’s MPLAB IDE and Microchip’s C18 Compiler (these come with our Prototype Programming Kit), see our Downloads page for more info .

1 Like

If I program something in easyC and download it to the Vex, does it wholly replace the startup code or does the new code somehow coexist with the startup code? I want to implement interrupt-driven buffered serial i/o without breaking the ability to communicate through the program port.

When code (Default/User) is download to the Vex Controller, the previously downloaded hex file (Default/User Code) is completely written over with the new hex file.

1 Like

Our school district owns 5 Vex controllers and one programming kit. We are unable to download programs or the default code (using EasyC) to one of the controllers. We always get the message “make sure your controller is connected and turned on”. All other controllers work fine. So, I downloaded your IFI_Loader and have attempted to use it to download the factory firmware. But I get a message saying to hold down the programming button until the PRGRM STATE LED is orange. However it stays green. Attempts to download yield “Opening port…no robot controller found.”

**Since other units work fine, you will most likely have a problem with that one Controller. You can return it if it is still under warranty. If not, please call us for repair, but here are a few things to try first: Try downloading new Master Code and Default Code to the Vex Controller using our IFI Loader. **

1 Like

I am a new Vex user. I purchased the programming kit (EasyC) and have also downloaded the MPLAB IDE and C18 compiler. What do I need to do to get this config working? I am not certain how to set MPLAB to use the Radio Shack programmer. It only offers MPLAB ICD 2 as a programmer choice. Is there a doc that shows what header files, libraries, etc. are needed to start programming with MPLAB?

For help on using MPLAB you need to contact Microchip http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002. As stated on our Download page: The MPLAB IDE allows you to open your workspace and edit the files, the Compiler allows you to create a new .hex file, and the IFI Loader allows you to download these .hex files to the Vex Controller. Thus you do not use MPLAB to program but only to create/build a .hex file. You must use MPLAB version 7.2 and the C18 Compiler version 2.4 that comes with our C-BOT disk. Our IFI Loader is used to download or program the Vex Controller. For the files you need in MPLAB, just open the workspace using MPLAB and it will load the files you need.

I have installed the Prolific USB driver that came with the EasyC install disk. I believe the correct procedure is to create a .hex file with MPLAB/C18 and then use the IFI Loader to install - outside of the MPLAB environment.

My current problem is that I have installed:
o MPLAB IDE v7.30
o MPLAB C18 Compiler v3.02
o MPLIB v4.02
o MPLINK v4.02

I have also downloaded the Vex starter code at http://www.vexlabs.com/docs/vex-startup-code.zip

The problem is that the library files in the starter code contain COFF files that are not compatible with the MPLAB tools listed above. I get the following error at link time:

Error - Coff file format for ‘ifi_library.o’ is out of date.
Error - Could not build member ‘ifi_library.o’ in library file ‘C:\VEX\VexCode\Vex_alltimers.lib’.
Errors : 2

Is there anyplace where I can get an updated version of the starter code? If not, I don’t see any easy way to get an older version of the MPLAB toolsets

No, there is no updated version. You are correct. You must use MPLAB version 7.2 and the C18 Compiler version 2.4 that comes with our C-BOT-COMPILER disk. The C-BOT disk is on our Downloads page .

1 Like
  1. Does the kit come with a full license of easyC and C18? I see Microchip sells C18 for $499. What is the difference. Is it limited to Vex chips, programmer, etc?

  2. I own several other tools for PIC programming, CCS C Compiler, PIC Basic, Pic Start programmer. Can any of these be used?

**1. The Programming Kit, that is available online, comes with version 2 of easyC and a C18 Compiler that work with the Vex micro-processor - PIC18F8520. Microchips Compiler works with all their micro-processors.

We also sell a VexLabs MPLAB Programming Kit that is available only over the phone. This Kit comes with MPLAB, a Vex C18 Compiler, a Programming Module, and our IFI Loader. See our Downloads page for details.

  1. You must use one of the above programming kits to program the Vex controller.**
1 Like

How can I use MPLAB with PIC18 and the ICD2 to program Vex? Since I would like to be able to develop and test Vex applications using the ICD2 and MPLAB simulator. In addition I need to be able to use the bootloader to download the application *.hex to flash.

You can not program Vex with these tools or use the bootloader, you must use a programming kit to program the Vex Controller.

1 Like

I noticed that the programming connector RJ14 is the same as Microchip’s ICD2 and other third party ICSP connectors.

  1. Is the pinout the same?
  2. Could an ICD be used on the microcontroller module?
  3. Could the programmer be used to program other PIC chips?

1) No
2) No, you must use a Vex Programming Kit
3) No, the programmers are Vex compatible only.

1 Like

I have read in this forum that it is possible to develope .hex files in MPLAB 7.2, compile them with Microchip’s C18 compiler and load them with the IFI Loader. I have bought the easyC programming kit and downloaded MPLAB 7.2 and the newest loader.

Can I use the C18 compiler included in the easyC kit with these components? How do I set up the workspace? MPLAB didn’t identify and include the supporting files as I’d hoped it might. Please be very specific, I’m very new at this.

No, the compiler is embedded into the easyC software. You can get a compiler on our C-BOT disk. Our default code (zip file) comes with a workspace file that sets things up in MPLAB for you.

1 Like

Following the instructions in the manual, I attempted to download the master code on one of my Vex modules. Unfortunately, I suffered a glitch on my USB serial port 2600 bytes into the download (due to an incompatibility between my computer and the USB driver) and it failed. Now, whenever I attempt to download the master code to that controller, it fails with a message “No firmware version is available”.

I have since switched to another computer for downloading, and can download to my other Vex controller just fine, but can still not download master code to the messed-up module. Is there a way to recover from this condition?

Try this - Go to our Downloads web page http://www.vexlabs.com/vex-robotics-downloads.shtml and get the Vex Starter Code zip file and our IFI Loader if you do not have them. Inside this zip file you will find a VEX_MASTER_V5.BIN file. Using the instructions called UpdatingMasterFirmware.pdf download this Master bin file to the Vex Controller using our IFI Loader. After this is complete, you will need to download your User or the Default Code to the Vex Controller using our IFI Loader.

1 Like

My new vex kit had no section on programming, just a tab sheet. I see vague references to PIC and MPLab stuff. I already design with PIC’s (ok, let’s just say I love my MPLab ICE-2000 In-Circuit Emulator). I see references to C programming.

  1. Do I need something ‘special’ for my MPLab to work with the Vex beside the 3rd-party downloader program?
  2. Can I program in Assembly Language like I usually do, or am I limited to C? (Yes I write C code, no problems, just usually prefer Assembly)
  3. Is there a Vex programmer’s guide somewhere I haven’t found yet?
  4. Is there something better (than MPLab) for programming with the Vex?
  5. I love Forth (great for robotics programming), anyone know of a Forth for Vex?
  6. Was my kit missing some documentation?
  7. Is there a “best choice” for teaching others to program for the Vex?

1. Can only guarantee our version of Microchips MPLAB IDE ver.7.2 and C18 compiler ver 2.4 will work with Vex.
2. Yes you can program in Assembly Language or C.
3. The Programming Inventors Guide is supplied with the easyC Programming Kit. It is also available online on our web page.
4. You must use MPLAB or easyC to program the Vex Controller.
5. Do not know about Forth.
6. See answer 3.
7. Depending on your programming ability, you must decide whether easyC or MPLAB IDE is the best choice for your needs.

1 Like

I’ve worked with the Paralax BoeBot in an AI course and was pleasantly surprised that they also offered the Javelin Stamp (a native Java chip) in lieu of their standard Basic Stamp. Is such a microchip under consideration (or at least a micro Java JVM for the Vex robots?

No. There are no plans at this time for such a change.

1 Like