Mplab Question

Hello! I am a total noob with programing though I know how to program C. I got the Mplab programing kit some time ago and what I wanted to know was how to get started, for example, how to program it on the vex micro, what libraries should I use, how to use those libraries, how to program inputs and outputs, and that kind of stuff. Please explain in a very simple way, I am a total noob with this kind of stuff.

Thank you!

Generally, you start a new MPLAB project by grabbing a copy of the “VEX Starer Code” from here. You make a copy of that project and edit a few files, inserting into the various commented places:

user_routines.c & .h:
[INDENT]Macros & Variables
User_Initialization() // executes once at startup
Process_Data_From_Master_uP() // executes every 17ms or so[/INDENT]

user_routines_fast.c & .h:
[INDENT]InterruptHandlerLow () // if you are writing custom interrupt handlers
User_Autonomous_Code() // for autonomous mode
Process_Data_From_Local_IO() // executes as frequently as possible[/INDENT]

You can of course start a project from scratch, but this is a great way to get a project up and running quickly. Over time, you’ll evolve your own minimal project that you use as a project starter.

Cheers,

  • Dean