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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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
-A3.3
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?
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.
Thanks so much; that was the piece of information I was missing. That will save me time while debugging.
I
v been having this exact same problem now for a couple of years, I
v 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 :)
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
-A3.3
5 volt setting
-A5
params = -PPIC%ChipModel% -F"%FileName%" -B"%instdir%\programmers" -M -R -T -A5
In The GCB@SYN which I use at greatcowbasic.com 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.