Page 1 of 2

PicKit4 as a programmer in IDE

Posted: Wed Jun 10, 2020 1:21 pm
by bitfogav
Hey guys, I am trying to install PicKit4 as a programmer tool into the IDE, I have followed the excellent instructions as per the wiki page Adding MPLABX IPECMD.
I have MplabX and Mplab v8.92 installed and running windows 10 64bit, but I have been unsuccessful in getting the PicKit4 to work with the IDE.
The PicKit 4 works fine using it in MPLAB X IPE v5.40.

The command window loads after I compile the programme in the IDE, but before I can read anything on the pop up command window, it closes, and nothing uploads to the microchip. I have tried entering the correct parameters to keep the command window open but this doesn't work?.

This is no big deal but would be nice to use this feature in the IDE.

My question is, is there any pointers that I have missed or could have missed, relating to windows 10, as I'm also a new user to windows 10.

Re: PicKit4 as a programmer in IDE

Posted: Wed Jun 10, 2020 3:23 pm
by Jerry Messina
Did you try adding OB option? That should put it in batch mode and keep the window open.
Maybe that would help...

Re: PicKit4 as a programmer in IDE

Posted: Wed Jun 10, 2020 3:35 pm
by bitfogav
Thanks for you're suggestion Jerry. I have been using the following parameters, but no that doesn't seem to keep the command window open.

-TPPK4-OB-W-M-OL-P$target-device$-F$hex-filename$

That's why I wasn't sure if something relating to windows is stopping it or some compatibility issue?.

Re: PicKit4 as a programmer in IDE

Posted: Wed Jun 10, 2020 4:15 pm
by Jerry Messina
Ahh. Try this:

Code: Select all

-TPPK4 -OB -W -M -OL -P$target-device$ -F$hex-filename$
Each option must be immediately preceded by a switch, which can be either a dash “-’ or a slash “/” and options must be separated by a single space.
If that fixes it I'll add a note to the wiki page to make that clear.

Re: PicKit4 as a programmer in IDE

Posted: Wed Jun 10, 2020 11:52 pm
by bitfogav
Yes that's fixed it.. :D

Doh!! what a simple mistake, I should have copied and pasted the parameter into the IDE :lol: thanks Jerry for your help.

Re: PicKit4 as a programmer in IDE

Posted: Thu Jun 11, 2020 12:20 pm
by bitfogav
I should have also read the documentation 'IPECMD.htm'! :lol:

I also see you can use the PicKit3 too with the same command line and parameters, makes the command line a very versatile tool.

I was also wondering how the PicKit set the correct target voltage, and I think I'm right in saying that the command line program will select the correct voltage depending on the selected device, but this can be set manually using the following parameter followed by the voltage value.

Code: Select all

-W(value)

Re: PicKit4 as a programmer in IDE

Posted: Thu Jun 11, 2020 12:49 pm
by Jerry Messina
There are some individual commandline programs (pk3cmd.exe, icd3cmd.exe) but I think it's easier to just use the single ipecmd.
It allows you to use any of the current programmers (no pickit2 support, but that one's getting a bit old anyway). Heck, they've even "discontinued support" for the pickit3 & ICD3 in MPLABX since they're no longer available.
I was also wondering how the PicKit set the correct target voltage, and I think I'm right in saying that the command line program will select the correct voltage depending on the selected device, but this can be set manually using the following parameter followed by the voltage value.
Yes, '-W' uses the default voltage for the device, or you can specify it ie '-W2.5', '-W3.3', '-W5.0' etc.
If you want to use the target's supply then leave off the '-W' option

One thing to note if you're using the PK3/ICD3 is once MPLABX has touched your programmer, if you want to use it with MPLAB 8.92 or one of the old standalone utilities you'll have to force it to reload the programmer's OS. MPLABX reprograms it with firmware that's not compatible w/the old programs.

Re: PicKit4 as a programmer in IDE

Posted: Wed Jul 15, 2020 10:28 am
by richardb
I don't mean to hijack this thread but it is programmer related.


Working remotely is generally ok but could be smoother if i could leave the programmer connected to a remote system.

I have noticed that the pickit 3 when used with the mplabx ipe if the power is cycled or the pc restarted the pic kit is left in reset. is there any way around this?

Regards


Richard

Re: PicKit4 as a programmer in IDE

Posted: Thu Jul 16, 2020 10:58 am
by bitfogav
richardb wrote:
Wed Jul 15, 2020 10:28 am
I have noticed that the pickit 3 when used with the mplabx ipe if the power is cycled or the pc restarted the pic kit is left in reset. is there any way around this?
Hi Richard.

I'm not sure if this will fix the PicKit 3 reset, but there is a setting in the settings tab in IPE which allows you to change the Reset mode. If this isn't exactly what you are looking for then it's possibly down to the limitations of the PicKit 3/IPE..

settingsIPA.png
settingsIPA.png (42.39 KiB) Viewed 5014 times

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 5:40 am
by richardb
Thanks, its already set to "release from reset"

i assume you guy's see this issue ? i'm wondering if its just my setup.

Rich

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 9:14 am
by Jerry Messina
Haven't really looked for it.

So the problem is if the PC is restarted then the pickit3 will hold the MCLR line low after the PC reboots?

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 12:54 pm
by richardb
Yes.

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 1:32 pm
by Jerry Messina
Then that sounds like it's just the Pickit3 doing that on its own...
I can't think of any way to stop that until you run the program and have it release reset.

Maybe run the commandline programmer at startup and tell it to release reset?
No idea if that would work or not.

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 2:01 pm
by richardb
That's not a bad idea, thanks Jerry. I will investigate.

Re: PicKit4 as a programmer in IDE

Posted: Fri Jul 17, 2020 2:03 pm
by bitfogav
richardb wrote:
Fri Jul 17, 2020 5:40 am
i assume you guy's see this issue ? i'm wondering if its just my setup.
I've tested this as a have a test board setup right now with a pickit 3 but I can't confirm my pickit 3 holds reset, even with the pickit 3 still connected to the pic and not powered, if I disconnect my pickit 3 or restart my PC then my PIC works exactly how its programmed.. But that being said I do always use the following reset circuity on my projects or test boards.. But like Jerry said maybe it is the pickit 3?..
pickitDiode.png
pickitDiode.png (11.4 KiB) Viewed 4974 times