Thread: MPLab
View Single Post
  #3   Spotlight this post!  
Unread 12-01-2008, 22:10
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 315
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: MPLab

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