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.

This entry was posted in open source, PIC, programmers and tagged , .

Comments

  1. Ben says:

    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. Sarkari Naukri says:

    Thanks. very useful.

  3. hak8or says:

    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

  4. arhi says:

    Niiiiiiiiiiiiiiiiiiice :D

    Would be cool to make some gdb proxy for them too .. I hate the slowness of pickit3 :(

  5. AndThen says:

    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 =(

    • AndThen says:

      Typical I had this open else where.
      http://www.microchip.com/forums/m498808-print.aspx

      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

      • Trev says:

        “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.

  6. hak8or says:

    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 ——————————-
    C:\MinGW\msys\1.0\home\hak8or\pic32prog>compile.bat
    **************************
    *** 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
    c32prog.c
    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

    C:\MinGW\msys\1.0\home\hak8or\pic32prog>
    ———————————————–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
    target.c
    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
    pi/hid-mac.c
    hidapi/hid-mac.c:25:36: fatal error: IOKit/hid/IOHIDManager.h: No such file or d
    irectory
    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

    • tissit says:

      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.

    • AndThen says:

      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

  7. hak8or says:

    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.

  8. Serge V. says:

    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.

  9. JTR says:

    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…

  10. JTR says:

    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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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