PG1B


You've got your programmer. You've got your PIC. It's time to get burning.

This tutorial will cover the software setup and various chip locations using the PG2C socketed programmer. Getting your programmer to work for the first time can be frustrating and time consuming. We wrote this tutorial to try to expedite things. And, look at the bright side - Once you get your setup correct, you should be able to program without every having to mess with it again!


Warning: Never insert or remove a PIC from the PG2C while the programmer is in program mode. Do not run programs that dump weird things to the com port on which the programmer is attached. Fried PICs and fried programmers will result!


The PG2C Serial programmer. First the basics -

Cable : You will need a basic 9 pin serial cable - Male to Female. You should have one of these tucked away some where in your closet.

Power : All power needed is generated by the serial port! 

Software : Use ICProg! Why? Because it programs the greatest number of PICs including the new 16F676, 16F819, and 12F675! Download the zip file and open it. There is only one file (the way all programs should be) - icprog.exe. Store this file somewhere handy like the desktop - you will be using it quite a bit!

Windows NT and XP users! : Click here.

So you've got the software installed. Now you've got to get it talking to the PG2C. To setup ICProg - under the 'Settings' menu select 'Hardware'.


Hardware: Select JDM Programmer

From here select the JDM Programmer (should be default) from the drop down box. May sure there are no check boxes in the Inverted boxes. Everything else should be default. Click 'OK' to close the window.


HEX What?


The Basic ICProg Window

Now open a HEX file to test with - blink always worked well for us! Make sure it's small - you don't really need to fill up the PIC just yet, do you? The HEX file should have the fuses encoded - ICProg will recognize these and select the fuses and oscillator settings for you. You must select the processor by hand. Programming 16F873 is very different from 16F873A!

Checkout the Blink page for test hex files for various PICs.


PIC Locations -

The locations for all the different pin PICs are indicated on the board by the silkscreen.


16F628 in the 18Pin PIC Position on the PG2C

You must look very closely but multiple Pin 1 indicators are located in between the 2nd and 3rd sockets. The Pin one indicator for the 28 and 40 pin PICs is the white line between the two sockets at the top of the picture. Pin 1 for the 14 and 8 pin PIC devices is the second line down (seen in the picture). The 18 pin Pin 1 indicator line is the furthest down (currently covered by the 16F628). You can see the pin 1 'dimple' on the PIC matches to the indicator in between the sockets. For slim PICs - 16F873, F84A, F682, etc. the PIC must straddle sockets 2 and 3 as shown in the picture. For larger PICs - 16F877, the PIC must straddle the outer sockets 1 and 4.


Get your PIC located correctly in the socket. Now go back to the ICProg software and hit the button with the lightening bolt. The PG2C will flash the programming LED during programming. The PIC should be successfully verified!


The dreaded generic ICProg error

What to do if you get the message 'Programming failed at Code address 0000h' - This is the generic error code that means something (anything) is wrong.

Make sure that:

  • the serial cable is plugged into ComX - make sure you have ComX selected in the hardware setup.

  • the PIC is oriented in the socket correctly or - the ICSP cable is attached firmly and correctly to whatever development board you may have.

  • you have selected the correct PIC for your board. Again 16F873 is different from 16F873A.

Now that you've got the software and the socket working, start using the ICSP cable with the new ICSP Tutorial.


Installing the Windows NT/2000/XP Driver -

XP and NT do screwy things with the serial and parallel IO that previous Windows versions did not. This special driver allows you to successfully use your parallel/serial programmer with any Windows machine.


The Options Window

First you will need to download the NT/2000 Driver from the ICProg website downloads page. Put the NT/2000 driver file in the same directory as the ICProg.exe file. In ICProg, click on 'Settings' in the main window and open the 'Options' window. Select the 'Misc' tab. Click 'Enable NT/2000/XP Driver'. ICProg will then restart with the new driver and everything should be peachy.


Dah! -

What should you do if you've read through this tutorial twice and you are still having problems?

You may want to checkout the support forum at ICProg. But please post all questions on the SFE Support Forum - we don't want to bug Bonny Gijzen, author of ICProg, with Olimex specific questions.

Comments 0 comments