Use PICKIT2 to program PIC32’s

Hak8or writes regarding his experiences with pic32prog, a flash programming utility for Microchip PIC32 microcontrollers.

For everyone who is still stuck with a PICKIT2, like me, instead of buying a pickit3 we can all use this with a PICKIT2 to program the more high end PIC32’s. I am not exactly sure at the current state of this, but it seems to be still actively developed, latest update was this year.

For more information on this open source project visit the pic32prog’s Google code project page.

Via the contact form.

Join the Conversation


  1. I believe the standard PICKit2 Windows software can program (but not debug) PIC32s as well. At least this was true a couple of years ago before I upgraded to the PICKit3, but support may be limited as newer PIC32s have come out.

  2. I was specifically referring to devices not officially supported by the PICKIT2 like the PIC32MX7xx’s and the new PIC32MX220’s and PIC32MX110’s. IF you guys know how to get the pickit2 to program them by editing the PK2Devicefile.dat than please do tell! :P

  3. I too found the pic32prog google code repository, recently. The mpsse (half) implementation I found interesting, I wasn’t aware of those FT chips. It also has interfaces for USB bootloader.

    I was under the impression PICKIT2 officially supported code upload for pic32 already via MPLAB, Guess I was wrong =(

    1. Typical I had this open else where.

      at the very last is something i read before my nap and didn’t recall at all..

      Be aware that the current Pickit2 V2.61 stand alone program can only do the pic32mx320 to 460 chips.
      Microchip say they will not be activley supporting it now the Pickit3 is out

      1. “Microchip say they will not be activley supporting it now the Pickit3 is out”

        Turns out this statement was very wrong in 2010 and was still very wrong in 2011 as Microchip have continued to issue updated device files, the last update being in November 2011.

  4. Anyone have any idea how to build pic32prog on a windows 7 system? I am not really familiar with all this, so I have failed so far.

    I downloaded the source from google code, and found a compile.bat file. Running that in command prompt did not really work, I realized that I needed to install mingw to either C:/mingw or D:/mingw.

    Well, I installed mingw, tried the same thing (running compile.bat) from command prompt and get this:
    ———————————————–Copy from terminal start ——————————-
    *** Use MinGW compiler ***

    C:\MinGW\msys\1.0\home\hak8or\pic32prog>mingw32-make.exe -f make-mingw
    i586-mingw32msvc-gcc -Wall -g -O -DMINGW32 -Ilibusb-win32 -c -o pic32prog.o pi
    process_begin: CreateProcess(NULL, i586-mingw32msvc-gcc -Wall -g -O -DMINGW32 -I
    libusb-win32 -c -o pic32prog.o pic32prog.c, …) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make.exe: *** [pic32prog.o] Error 2

    ———————————————–Copy from terminal end ——————————-

    So I install mysys (terminal for mingw from what I understand), put pic32prog into the “home” folder in mingw (C:\MinGW\msys\1.0\home\hak8or\pic32prog), and run “make” in the pic32prog folder. Here is what I get:
    ———————————————–Copy from terminal start ——————————-
    hak8or@hak8or-desktop ~/pic32prog
    $ make
    make: svnversion: Command not found
    gcc -Wall -g -O -I/opt/local/include -Ihidapi -DSVNVERSION='””‘ -c -o pic32pro
    g.o pic32prog.c
    make: svnversion: Command not found
    gcc -Wall -g -O -I/opt/local/include -Ihidapi -DSVNVERSION='””‘ -c -o target.o
    make: svnversion: Command not found
    gcc -Wall -g -O -I/opt/local/include -Ihidapi -DSVNVERSION='””‘ -c -o executiv
    e.o executive.c
    make: svnversion: Command not found
    gcc -Wall -g -O -I/opt/local/include -Ihidapi -DSVNVERSION='””‘ -c -o hid.o hida
    hidapi/hid-mac.c:25:36: fatal error: IOKit/hid/IOHIDManager.h: No such file or d
    compilation terminated.
    make: *** [hid.o] Error 1
    ———————————————–Copy from terminal end ——————————-

    So, I am guessing that I have to compile the HIDAPI folder first. Anyways, I tried to “make” the other folders, and it did not solve the problem still. Would it be possible for someone to just get me the compiled file or tell me how to do so? :P

    1. What idiot decided to add SVN specifics into the build process? :-o

      The actual termination seems to be a missing header, if I read that correctly. Can you check if that exact file exists and if it exists at that exact path/dir? Maybe you’re missing an include path or something has been renamed. If that’s an autogenerated header (yech), you may have to build that part first.

    2. I missed this, did you solve it?

      you will need to run “make -f make-mingw”

      at the top of the make-mingw there is CC= for both gcc and the long version.

      The other issues might be the usb lib,if it doesn’t find them put them in the base directory is easiest.

      there are some issues using the MXx20 They have a smaller boot area ect, it will try to write the device config in the wrong spots.

      There is a switch for make so that “make -DBOOT_KBYTES=3” overides whats in the file but i forget what it is. You can edit the defines top of the pic32prog.c BOOT_KBYTES=3 and FLASH_KBYTES=32

  5. Thanks for the help guys! Much appreciated! :)

    I stopped trying with getting this to work a while ago though, I ended up just sticking with some high end DISPIC33’s and PIC24’s in the meantime. I need to get a pickit3 anyways so I can debug them, so eventually I won’t need to fiddle around to get it working.

  6. Last version of pic32prog (r31) has some essential enhancements:
    1) It works on Windows (via hid.dll, no driver needed).
    2) New pic32mx1/mx2 family is fully supported.
    3) PICkit3 is supported. The adapter should have a scripting firmware: use PICkit 3 Scripting Tool to upgrade.

  7. So, did anyone work out how to compile the source code under windows and can provide meaningful directions?

    I have created a new PIC32 programmer and while doing so I noticed a issue or two with pic32prog that causes it to be very slow but I cannot prove it without a recompile to test the theory…

  8. OK! After much stuffing around I got the latest version (r96) to compile with windows. The trick was to edit compile.bat to use the cygwin make file.

    mingw32-make.exe -f make-cygwin

    There were still all those svn source warnings but they didn’t stop a successful compile. Now on with the main show…

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.