I made this really nice tutorial that will show you how to program your vex bot with MPLAB. You can download it from here.
does this mean i don’t need a programming kit to program my robot?
You still need the programming cable and software.
If any of you decide to try it, and find that I made a mistake somewhere, please let me know. Thanks!
I’m going to try it, TRU will get Vex programs in two lanuages, easyC and MPLAB, possibly RobotC cause im gonna get that in August with the FTC Kit
which reminds me, anybody got an RobotC tutorials somewhere???
Easy C! You can’t beat the service they have, just can’t beat it.
That was somewhat random…
And MPLab can do a lot more for an advanced C programmer than easyC…
I wasn’t going to comment, but…
EasyC is like Training Wheels. It keeps you from falling over and make Learning much easer, but sooner or later, your going to realize that it keeps you from discovering the real power of Programming in ‘C’. (Plus sooner or later someone will start making fun of you… WON’T BE ME! Your are all learning at your own pace, and I’m OK with that)
Where can you download MPLAB?
You can find the latest version of MPLAB on the Microchip site at www.microchip.com.
*** UPDATE 7/13/09 ***
If you get an error message saying the MPLAB cannot locate API.h and BuiltIns.h, then you have to copy and paste those files into your project’s main directory. For what ever reason, MPLAB doesn’t do that when you tell it to earlier on in the tutorial.
Also, a member reported having issues with needing the files “clib.lib” and “p18f8520.lib”
He found both of them in in [path to mcc18]\lib.
If there’s any more problems, please let me know!
BTW, I don’t recommend MPLAB for actually writing code. I personally use Notepad++ because of it’s amazing syntax recognition of many languages and just use MPLAB to build the projects. Just a tip.
Wow, it’s been a long time since I last worked on this tutorial!
I chuckle at the idea of someone making fun of someone for programming in EASYC. After 25 years of programming, and 5 years programming FRC robots in MPLAB (the VEX code is almost identical to the old FRC 'bots… VEX was developed from a training platform for FRC, after all) I choose to program my VEX robot in EASYC most of the time.
I totally agree that EASYC is a great way to learn, and that people should aspire to learn “real” C… and note that MarkO knows not to laugh at EASYC users… but EASYC is good for more than just training… it is highly optimized for performing a wide variety of tasks specific to VEX robots in a quick, efficient manner that appeals to experienced programmers, too.
I wrote that with EasyC 1.x and 2.x in mind. EasyC Pro is a whole different thing. I still write quick little things in EasyC 1.x, like, Timer goes negative at 32768 (Post #9).
With 27 years of Programming, 8 years of Embedded Systems Programming, and 3 years of Vex and FRC Programming, I was pointing out that you will want to move on to a more flexible environment for your Programming, as your needs grow.
EasyC 1.x has no User Functions, so there is little in the way of teaching a new programmer how to Modularize Ideas, and make reusable functions of them. EasyC 2.x has User Functions, but can be cumbersome to add external Routines. EasyC Pro (v3.x) fixes these “short comings”, well, since it is Version 3. I have not worked very much with EasyC 3.x, but I am hoping to get to it this summer, I have a few other Vex Projects ahead of it right now.
Just so you all know I Don’t Walk on Water, I failed my first ‘C’ Class (Winter Term, 1988), because I could not get past Pointers. After taking an 80x86 Assembler Class, I was OK with all of it…
Personally, I’m convinced that software that does things for the user may be great at getting people interested, but it’s terrible at training. I think it’s a great way for people to save time but when used in training it creates a horrible foundation.
Imagine if we taught our children to write complete sentences but never taught them the alphabet. What if they were never taught that sentences were made up of words and that words were made up of letters and that there were a limited number of letters. The few that figured out the secret of letters and words would have a much brighter future in those fields where writing was a necessity.
Imagine if we taught children how to graph functions on a computer without them really ever learning simple things like addition and subtraction. The few who could actually do addition and subtraction would have a future. Everyone else would be stuck within the limitations of the buttons they had learned to push because they wouldn’t have basics to build off of.
There are no shortage of programmers who don’t understand how software works because they’ve never touched assembler. It may take years before they realize what a huge disadvantage they have, just as it make take years for the sentence user to realize what a disadvantage they have compared to the person who knows how to use letters.
I’ve seen it in graphic arts, where people who started with the full blown version of Adobe Photoshop never learned how to do what a single button push does without pushing that button and as a result are limited to just the possible outputs of the button. The people who learned on “lesser” software (or lesser versions of the same software) know how to do that function “by hand” and as a result they aren’t limited to just what the button knows how to do.
The more the software does for the students, the less they learn to do for themselves. If they have no intent of learning how to create software, then button pressing is a perfect choice because it allows them to develop applications without learning. It’s great at generating interest, but it’s not teaching them what it does for them behind the curtain.
We’re confusing “Programming” with “Problem Solving”
VERY few engineers actually need to “Program.” ALL Engineers need to “Problem Solve.”
A tool that allows them to do that without getting hung up on the syntax and/or the “how” is actually an ideal productivity and learning tool.
I have been teaching kids to program for years and only recently realized it is much better for the young minds to learn the problem solving techniques than the syntax of a particular language. Easy C (and Labview) allow them to do that very quickly without the frustration associated with finding missing semicolons.
I do agree that those of us that spent years doing assy language programming have a huge advantage, but am not sure it is required these days given tools that “do it all for us …”
I downloaded your great tutorial but it seemed to be missing a step 3?
I followed what was there but got an error “not finding stdio.h”
I need some help please
thanks Muc John
Here is some additional Information…
The Step Three screen looks like:
Enter you Project Name and Project Directory.
I used “Template” for the Project Name and “C:\DATA\Vex\Template” for the Project Directory.
The Error you encountered is from Missing Information that is needed to Compile and Link the program.
Click on the Menu Item “Project–>Build Options–>Project”:
Click on the General Tab, if it is not the Top Tab, and move down to the Include Path :
Type in or Browse for the MCC18 Header Files, (Those are the *.h Files ). I chose the Browse method, so there is a Back Slash at the end of the Path. That is fine, it will compile OK.
Check the Library Path, it should be in the same Parent Directory as the Include Files, but instead of “[path to mcc18]\h”, should be “[path to mcc18]\lib”
( On my system, my Include Directory is “C:\mcc18\h”, and Library Directory is “C:\mcc18\lib”. )
Click Apply, and then Click OK.
Do a “Project–>Build All”, it should look like this:
Save your Work Space, this is now a Starting Template for you to start all of your Vex projects from.
You might want to copy this entire Directory (Folder) to another area, so that in the Future, you won’t have to go through all these steps again…
If you have further Issues, please don’t hesitate to post a message in the forum… We were all beginners at one time too…
Is there anyway of Updating your Document with the “corrections” you posted about the “lack of” File Copies, and the stuff I just posted???
Marko, your information worked great.:):)