Log in

View Full Version : MPLab


d_vnk
12-01-2008, 21:57
I'm working for the new team 2428 out of Sewickley, PA, and am having problems regarding MPLab. Well, more than just problems. Unfortunately I have not a clue were to start, how to program, and how to do much of anything with this software and I am looking for the most basic help imaginable. If anyone could direct me in the right direction, or has some helpful advice, I greatly appreciate it.

Joohoo
12-01-2008, 22:07
First off welcome to this community. I won't try to say what has already been said before, I would suggest that you look here http://www.chiefdelphi.com/forums/showthread.php?t=30976 for some help.

If you need help beyond what is there then try finding a team nearby to get some more direct help. I find that even though Chiefdelphi is a great way to learn, I find that having someone you can talk face to face about your problems is a much more efficient way to fix your problems and learn more.

jee7s
12-01-2008, 22:10
I'd suggest starting off with some available default code, so you can at least you can get the robot up and running.

As for customization...to properly use MPLAB, you need a combination of architecture and programming knowledge. The syntax is (essentially) ANSI C (not C++ or C#), and there are many books available on C programming. To really interface with the controller properly, you need to read up on the processor architecture (Microchip's PIC18F8722). This means deciphering things like this:

TMR0L (the low byte of timer 0)
TMR1IF (timer one is full/overflowed)

Thankfully, IFI's default code renames the ports to the names you see printed on the outside of the box. Also, Kevin Watson's FRC code handles a lot of the deciphering I mentioned above. Both are good starting places.

A big thing to keep in mind is that the PIC doesn't do floating point efficiently. This means that fractions/decimals/rationals slow the processor down. As an example:

i / 2
is more efficient than
0.5 * i

so, stick to integers as best you can.

In the end, programming the controller is a lot like algebra. But, C has its twists, so you need a good book on C to reference for syntax and errors.

-JEE