PIC 18F458 Information

Below is a quick outline of the majority of the information you'll need to begin programming the 18F458 PIC on your stack. All software is currently available for the Windows OS ONLY.


Documentation

Before doing anything with software, I would first suggest to learn a little about PIC programming in assembly (the language we'll be using) and the details/specifications of the PIC 18F series itself. Download and read/skim these three manuals.

PIC Microcontrollers While the book deals primarily with the PIC16F84, it's still an informative reference for PIC programming in general.
PIC Programming in Assembly Again, although this tutorial was not written with the 18F458 PIC in mind, it's still a good read on the subject. I would suggest reading through this in its entirety before even attempting to program in assembly.
PIC18Fxx8 Datasheet Basic information on the 18Fxx8 series, including info on pin names, registers, etc. Do NOT print this; we have a copy in the lab.



Software

Next, you'll need to download and install all of the necessary software to program, including the following:

MPLAB IDE This software is used to develop, test, debug, and finally build the software used on your PIC (version 7.10 is currently available for download). When you're done writing your code, you can then create a HEX file which you will then send to your PIC microcontroller via the next piece of software.
WARP-13a After creating your HEX file, you'll need some way to actually send it to your PIC. To do so, you'll need to download the latest WARP-13a software. Using this software (and the programmer explained below), you'll physically send your code to the PIC.

NOTE: The FIRMWARE is already installed on the actual programming board IC; you do NOT need to download/install this. However, you will still need to download the SOFTWARE.



Hardware

With a general understanding of PIC programming and all of the necessary software downloaded, you can now proceed to the third step: setting-up and connecting the programmer to your computer. Be sure to connect the components listed below in order to begin programming.

Serial cable In order to connect to the WARP programming board, you'll need to use with A) a standard 9-pin serial cable or B) a 9-pin serial to USB cable. Several of each type are located in the lab for use.
• WARP programming board This piece of hardware serves as the bridge between your powered stack and the software located on your computer. It connects via the serial cable to the computer and through its build-in connector to the programming port on each stack board.
• Power adapter This final piece of hardware powers the WARP board, and must be connected in order for anything to work. While it seems like a common piece, I've included it in this list because it can cause a few headaches if you're not careful. ONLY a 16VDC or 12VAC power supply can be used with the WARP board! No other type will work properly (if the red LED is on, you know the adapter is working).



Test programs

In order to determine if your PIC is functioning properly, you'll need to develop and use test programs for the various components of your PIC. Below is a list of the test programs written to date.

Blinking Both LEDs This test can be used on every stack board that contains a PIC (i.e. every stack board with the exception of the Power board). It's a simple program that causes the two LEDs on the edge of the board to turn on, then off, every .5 seconds.
Blinking One LED This program is exactly the same as the one above with one exception: only one LED is programmed to blink.



Set-up / Assembly

Now that you have everything in place, simply connect your computer to the WARP board via the serial/USB cable, then the WARP board to your stack using the WARP board's attached cable. Make sure that both the WARP board AND your stack are powered and turned on! You will not be able to program if either of them are powered off.

After connecting all of the hardware components, open your newly-installed WARP-13a software, subsequently opening your HEX file thereafter. Upon opening your HEX file, be sure to make the appropriate configurations as outlined below:

After making the necessary configs and making sure, once again, that your hardware is all securely connected, click the PROGRAM button. After a minute or two, you will receive one of two messages: Verification successful or unsuccessful. If successful, your program should be functioning properly on your PIC. If not, go back and check over your board for soldering mistakes and faulty components, your code for bugs, and your configurations and hardware connections for errors. If all else fails, ask someone for help!

Questions, comments, suggestions? Feel free to email me at cappaert@csail.mit.edu.