Programming Debugging PICkit5 vs PICkit3

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jay_dee
Posts: 236
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 96 times
Been thanked: 65 times

Programming Debugging PICkit5 vs PICkit3

Post by jay_dee »

Hi,
New project using an dsPIC33EV 256GM102, 5V version dsPIC.
I beleive this cannot be programmed with a PICkit3, same for any new PIC devices after June 2019.
MPLAB IPE v5.50 finds the PICkit3 but it wont let me apply any dsPIC33 settings to it, so...

I think I'll have to upgrade to the PICkit5, anyone got good experiance of this? I know some PICkits have had a painful first few years!

Are there any debugging advantages/features? whilst being still Flowcode based
I dont know any of MPLAB... but maybe worth learning if it has some good debugging features?

FC Ghost or ICD seem looked like a great idea but as I understand they only work if the target PCB has a GHOST chip on-board, so no good for your own PIC based PCBs
From what I can tell, the only de-bugging features offered by FC via a PICkit is BreakPoints.

Any thoughs guys? thanks, J.

BenR
Matrix Staff
Posts: 1971
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 519 times
Been thanked: 703 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by BenR »

Hello,

One of the things we have added to v11 is the ability to allow Flowcode ICD to work with anything that has a UART peripheral that connects to the PC via a USB to serial adapter. So things like Arduinos and ESP boards will allow ICD out the box. So far in testing this is working really well and is a lot more stable then via the dedicated Ghost interface.

Other devices can support ICD using something like this though we will need to nail down the UART and pin settings in the device definition file.
https://www.amazon.co.uk/Yizhet-FT232RL ... B07R17BMTL

Back to the PICkit question, we have a single PICkit 4 in house and it works quite well, though production have had some issue using it and have managed to destroy some chips with it so they are back using the PK3 again now. No experience of the PK5 as of yet I'm afraid.

jay_dee
Posts: 236
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 96 times
Been thanked: 65 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by jay_dee »

Thanks Ben, Great update.
I always have a UART breakout as I use it to dump Values to a App Dev program or a Terminal, so a UART ICD would be great and very universal.

I've taken the jump and have a PICkit5 on the way for £60 from Farnell.
So standby for a dumb "what does this error message mean" type post!
J.

chipfryer27
Valued Contributor
Posts: 1728
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 384 times
Been thanked: 594 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by chipfryer27 »

Hi Jay_Dee

Please keep us all updated regarding your experience with PICkit5. Looks like it will be the way forward.

Regards

jay_dee
Posts: 236
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 96 times
Been thanked: 65 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by jay_dee »

Hi. PICkit5...Well It seems to Work!
If you also are new to the PICkit5, DONT just Connect your PICkit5 to your PC. (I did!)

A)
First Download latest MPLAB IPE. In my case it was v6.25
The installer asked if it should install the latest MPLAB IDE and install the latest 8bit and dsPIC packages etc. I selected all of these.
Followed all of the install steps, default options and Free compiler options.
After everything is installed, REBOOT your PC, THEN connect the PICkit5.
( Some Forums report the reboot is critical for finding the correct driver. )

B)
I then ran MPLAB IDE (standalone programmer tool) to check if the PICkit5 was detected and working.
It showed the device, clicking <Connect> it outputs various firmware numbers. (If not see below)
I opened my FC file location and found the .hex file for my project.
I used IPE to send this to the PIC.
All worked. So at least I now know the PICkit5, programming adapter lead, Chip, PCB etc are all good.

C)
In FlowCode 10 > Complier Options > Programmer Tab. I changed the parameters setting to "TPPK5" to indicate its a PICkit5 programmer.
/P$(chip) /F"$(outdir)$(target).hex" /TPPK5 /M /OL

I also changed the location string to point to the exact version of IPE i wanted to use but I dont think this is nessacary.
C:\Program Files\Microchip\MPLABX\v6.25\mplab_platform\mplab_ipe\ipecmd.exe

ISSUES
1)
DONT DO THIS! I stupidly plugged the PICkit5 in before I installed the latest IPE and IDE, windows set the wrong/older driver.
When I later tried to test the PICkit5 using IPE it returned a message starting;
Transmission on endpoint 2 failed (err = -109)
You have set the program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again.
Googling and found a clue on Microchip Forum. Pluging in my PICkit5 to early! In Windows 10s 'Device Manager' I found two PICkit entries in under some USB and Com port settings ( sorry can recall exact details). Uninstall these.
After installing latest software versions (MPLAB IDE,IPE) and rebooting, plugging the PICkit5 into the PC, windows correctly assigned the driver and it shows in Device manager.
Microchip Tools > Microchip WinUSB Device

2) IPE 6.25 does not support PICkit3. So keep the older IDE if you are still using your PICkit3
3) If MPLAB IPE is open and connected, FlowCode cant access the PICkit5. obvious but it caught me out!
4) There is no dedicated LV pin on the PICkit5. I believe the programmer knows which chip needs the high voltage and those that dont. So for my dsPIC33EV chip it is programmed at the supply voltage of 5V, thus for these designs I can get rid of the classic diode on the ICSP connector that used to block the high voltage 12v.

I've not done any more than get a flashing LED on my dsPIC33EV board but as we all know, that can be harder than it should sometimes!! :)
Thanks as ever for the support. J.

WingNut
Posts: 271
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 44 times
Been thanked: 30 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by WingNut »

I too have the pickit5 after using pickit 4 for years. I found that if you allow mplab to import the settings from your older install then it will copy over all necessary settings including programming speed

jay_dee
Posts: 236
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 96 times
Been thanked: 65 times

Re: Programming Debugging PICkit5 vs PICkit3

Post by jay_dee »

Oh, If the FC team are working on a UART debug feature. Is a compatible AppDev component possible? just a thought. :) J.

Post Reply