Help save net neutrality! Learn more.

Programs run only if PICkit2 disconnected

  • Jack Hoffnung

    Jack Hoffnung - 2013-08-06

    I am using a PICkit2, and not having any trouble with compiling or downloading code to a PIC. However I notice that some programs won't run until I disconnect the programmer; then they run just fine. Is this expected?

  • Chuck Hellebuyck

    Do you have the /MCLR box checked (under the Vdd setting).
    If checked it will hold the device in reset until you either uncheck it or disconnect the PICkit 2.

    • Jack Hoffnung

      Jack Hoffnung - 2013-08-09

      Thanks so much; that was the piece of information I was missing. That will save me time while debugging.

  • YT2095

    YT2095 - 2013-11-16

    Iv been having this exact same problem now for a couple of years, Iv Just found a simple workaround that will let you keep your PK2 plugged in and you don`t have to keep opening the PK2 s/ware gui to unset the MCLR.

    if you go into your GCB folder, and locate the file called "prefs.dat" then have a look down to see the Pickit entry, you need to add "-R" to the end of that line thusly:

    params = -PPIC%ChipModel% -F"%FileName%" -B"%instdir%\programmers" -M -R

    then save it.

    you`ll have no problems with it being held in reset after programming anymore :)

    • Chuck Hellebuyck

      I don't see that in the GCB prefs.dat but I do see it in the Great Cow Graphical Basic compiler prefs.dat file so I assume that is what you refer to?

      Also, if you add a -T then the PICkit 2 can power your board. Limited to about 70 ma I believe but that is usually more than enough for most simple projects.

      You can also set the voltage with the -A option.
      3.3 volt setting

      5 volt setting

      params = -PPIC%ChipModel% -F"%FileName%" -B"%instdir%\programmers" -M -R -T -A5

      In The GCB@SYN which I use at for the CHIPINO this is set in the flashpic.bat file under the G@Stool folder.

      REM Call PicKit2 command-line programming Software:
      "PicKit2\pk2cmd.exe" -b"%G@SDir%\PicKit2" -pPIC%2 -f%1 -m -j -t -r -a5

      I added -j as well which shows a precentage of programming complete while programming. This helps to show progress for big programs.


Log in to post a comment.