PIC Tutorial Zero - Programming
Obviously one of the first things we need to know how to do is how to get the program into the chip!. There are various programmers and software available, some free, some shareware, and some commercial products. The idea behind this series is of a low cost tutorial, so it will be based on my free WinPicProg software, and any suitable parallel port hardware - usually based on the original David Tait design. Personally I'm using the P16PRO40 hardware, although this series will only be using an 18 pin chip, we may introduce another chip or two later on, so it's worthwhile going for the P16PRO40 rather than a programmer that only accepts 18 pin chips. The circuit for the programmer is freely available (so you can build it yourself if you like), and can be downloaded from my WinPicProg page, there are various links there where you can buy kits for the programmer as well.
Having got the hardware, we now need to install the software, this requires two downloads, one for the program itself, and one for the 32 bit driver DLL, 'port95nt.exe', download both programs from the link above and save them to your hard drive. The driver should be installed first, simply run the exe file and it will be installed on your computer, then unzip the 'winpicprog.zip' file and store the two files in a suitable directory on your computer - I haven't added an install program as it increases the size of the download by a huge amount, and there's nothing complicated about installing it manually - just put the two files in any directory you like.
Now, make sure the programmer hardware is connected up and turned on, then run WinPicProg, this will auto-detect which port you are connected to and display the port address it uses. If this doesn't happen you may have a hardware fault, or no power to the programmer, or a different programmer that requires the I/O pins configuring differently. This can be done from the 'Options/Hardware' menu option - however, if you use the P16PRO40 hardware the defaults that the program uses are correct.
Once you have the programmer hardware connected and working, you need to try programming a chip, to do this you select 'Open', either from the 'file' menu or from the speedbutton just below - this produces a file-requester where you can browse for the file you want, these files end in '.HEX' and are files produced by MPASM, the MicroChip assembler. Simply select the file you wish to load and click on the 'Open' button, the file will be loaded and displayed in the HEX Buffer mode. To program the chip all you have to do now if press 'Write', WinPicProg will give you a few messages as it proceeds, and will display error messages and abort if it finds any problems.