View Single Post
  #1   Spotlight this post!  
Unread 21-07-2005, 19:45
dababyjebus dababyjebus is offline
Greg Echelberger
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: VA
Posts: 6
dababyjebus will become famous soon enough
Programming Vex w/ MPLab

To program the Vex robot for this coming year you will need to buy a programming module (which aren't coming out until mid-august) or to make your own. The software that is going to be put out for programming it is called easyC which is very similar to FLL block programming. This is, for the time being, the only way officially supported for vex programming. EasyC installs in all the libraries and files that you will need to program in MPLab though. It installs the mcc18 compiler under easyC\mcc18\ (imagine that) and all the libs, headers, objects, and linkers under easyC\VeX\.

In order to program in MPLab, you will need to start by creating a new project under Project\Project Wizard and choose PIC18f8520 as your device. This can be found by checking the default linker script found in easyC\VeX\Linker\18f8520user.lkr. Next you must choose microchip C18 ToolSuite. Any tools in the content window with an X next to it should be found in easyC\MCC18. Then choose a name for your project and place to save it. (It is almost always good to keep projects in MPLab very close to your hard drive root directory because it refuses to compile files with location names longer than (62 chars?)) Then add UserAPI.h from easyC\UserAPI\ to the headers in your project. Do the same with 18f8520user.lkr, all the object files, and Vex_library.lib.

Everything should be configured correctly now, but there is one more catch. Before you can start coding your main function you must implement void IO_Initialization() with DefineControllerIO(4, etc...). EasyC puts this implementation in $projname + IO.c and the main function implementation in $projectname + .c. The 4 refers to how many of the first inputs are analog, and the rest are 16 1s for input or 0s for output. With all this done, your project should compile perfectly and then just use the ifi vex loader supplied with easyC or downloaded from http://www.vexlabs.com/vex-robotics-downloads.shtml.

Brad Miller should be putting up his own library for programming the VeX robots on http://sf.net at some point which is similar but more advanced than the one provided by easyC and will remove any reliance on easyC.

Last edited by dababyjebus : 21-07-2005 at 19:51.
Reply With Quote