What's the current usability of Microchip ICD4? - Page 1
Forum section: electronics / general

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 04, 2021, 08:52:27 am
content: Hi there,I have to set up a toolchain for PIC development, what's the go-to toolchain at the moment? Is ICD4 still lacking features or has it become the best tool for the job? Google spits out very mixed results, but no recent stuff. Cost is not an issue (my time is more expensive).Appreciate any feedback from PIC developers, thanks!

author: ace1903
author_rank: Regular Contributor
timestamp: February 04, 2021, 09:28:45 am
content: You can search my posts regarding ICD4 here.Overall summary: ICD4 sits in its box most of the time.Maybe the situation is improved now but I gathered too many frustrations with it to use it now.If you decide to buy it, be sure to get it with a power adapter.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 04, 2021, 10:50:32 am
content: <rant>Well, so far I am very underwhelmed about Microchips dev tools. As far as i can tell, ICD4 comes without any adapters. For 250 bucks they could thrown in a lousy ICSD cable. But n00oo, you have to order that separately. I don't even care about the bloody price, just give me something I can use out of the box without having to do 2 hours of research what I need to order to actuallyuseit.Same with MPLAB X. When you first start it, there's a nice message:"Yeah, you know, we've just written files to your hard drive for the past 20 minutes, but guess what? A compiler wasn't among them. Haha!"Then you google for 30 more minutes to find the bloody compilers that you have to download and install separately.What product manager sees that and thinks "Yeah, that's what customers want. We'll go with that!". Imagine buying a car only to find out it comes without an engine.When I need to spend 10+ hours to get a damn hello world blinky working, that raises more red flags than a communist labour day parade.</rant>

author: tumbleweed
author_rank: Newbie
timestamp: February 04, 2021, 11:27:31 am
content: To me, the worst thing about the ICD4 is that it can't supply power to the target unless you use an external power adapter.That's an easy thing to miss since its predecessor (the ICD3) was good for 150mA w/out anything additional.

author: IDEngineer
author_rank: Super Contributor
timestamp: February 04, 2021, 03:46:02 pm
content: When Microchip had a sale on ICD3's a while back, I bought a spare... based on all the frustrated ICD4 comments I'd been seeing. Apparently little has changed!

author: oPossum
author_rank: Super Contributor
timestamp: February 04, 2021, 04:32:05 pm
content: I have been using SNAP, PICKit4 and ICD4 for various PIC32MX and PIC32MZ parts. Haven't had any problems and they are all much faster than the PICKIt3 and ICD3. My only disappointment is the lack of AVR support on the ICD4. The SNAP and PK4 support them.

author: JPortici
author_rank: Super Contributor
timestamp: February 04, 2021, 04:32:30 pm
content: Hm. I've got a number of PK4 here, overall i'm satistfied even though sometimes i pick up the good old ICD3 (mainly for older chips, as support for older chips is lacky)quick tip on microchip's website: they have an excellent landing page systemmicrochip.com/mplabx will redirect to MPLABX's page + downloadsmicrochip.com/xc8 will redirect to the XC compiler page + downloadsand so onReason why MPLABX download is so large and takes so long to install, they moved the device support files from the compilers to the IDE/IPE... several thousands of small files.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 04, 2021, 04:34:51 pm
content: I find ICD4 OK, noticeably faster than ICD3.The only issue I regularly have is that if the target loses power, it can be fussy about reconnecting, and sometimes this requires exiting and restarting MPLABX

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 04, 2021, 04:56:02 pm
content: Quote from: mikeselectricstuff on February 04, 2021, 04:34:51 pmAs I remember, this is a behavior that has more or less plagued the whole ICD2 and ICD3 series as well.Note that if you're targetting PIC32, or the former Atmel ARM MCUs, you can also use JTAG/SWD and a non-proprietary programming probe.

author: JPortici
author_rank: Super Contributor
timestamp: February 04, 2021, 09:22:51 pm
content: I think that only Jlink supports PIC32 MZ for programming.. or am i wrong?What about debugging?The problems i have is that sometims the debugger loses sync and i have to restart the session. And if i remove/apply power sometimes the target start as if it was not in debug mode..

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 04, 2021, 10:56:58 pm
content: Well, I got a good deal on an ICD4, so I will be giving it a try. Already soldered the adapters that Microchip should have really just supplied with it.It's really beyond me how you can make a product so inaccessible. They can't throw in a five buck wall wart and a 75ct adapter board at $250 retail price? 27 dollars for a board with a couple of headers and a RJ45 jack? I can one-off five of those for less money.But that's Microchip for you. I remember paying a fortune for the PICstart+ programmer back in the 90s.Anyway, thanks for the advice, I will be writing a report once I have given it a run for it's money.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 05, 2021, 07:10:15 pm
content: Quote from: JPortici on February 04, 2021, 09:22:51 pmThat's obviously just a software issue, nothing related to the probe itself.It looks like OpenOCD only supports the PIC32MX so far, and not the PIC32MZ, although I'm not 100% sure. I just couldn't find PIC32MZ support files in OpenOCD. Interestingly, Microchip has a fork of OpenOCD which appears to support the PIC32MZ (and has for a while). I don't know why it has not made it back to the mainline OpenOCD (but it looks like many, if not most, Microchip contributions never make it to mainline projects, we can see the same trend with GCC?)https://github.com/MicrochipTech/openocd(The last commit is from 2015 though... so it doesn't seem much maintained anymore. I wonder how hard it would be to port PIC32MZ support to the mainline OpenOCD?)

author: ace1903
author_rank: Regular Contributor
timestamp: February 05, 2021, 09:07:32 pm
content: Ok, I must admit that my problems were related to the smaller PIC16LF series and PIC18F2xK20 and PIC18F2xK40.We made tens of differents products with PIC18F26K20 and wanted to upgrade to PIC18F26K40 since there were more peripherals and it was cheaper.This was like 3 years ago. We saw in the list of the supported devices K20 and K40 were marked with green and purchased ICD4.I spent a week adapting ICD4 for our workflow without success.Finally, management organized shared screen session with their FAE. Guy tried to blame our designs, but I showed that on the same board with K20 pickit3 works flawlesslyevery time and that design is like 10years on the market and flashed with IPE\ICP hundreds of units per day.Somehow every other programmer other than ICD4 worked 100% of the time but for ICD4 design was not good enough.Guy admitted that the supported device list is based on their thinking and not that someone actually trying to see if it really works.Just seeing faces of the management guys going instantly green was priceless.Probably for PIC32 and other families that are not supported by older programmers someone already tried and complained and it was fixed.But one should be careful when assuming that every micro that works with ICD3 will also work with ICD4.

author: JPortici
author_rank: Super Contributor
timestamp: February 05, 2021, 09:42:01 pm
content: Quote from: SiliconWizard on February 05, 2021, 07:10:15 pmmeh, i've used open ocd with STM32 and it was at least as painful as using the PK3. I'm unable to see the appeal. it's because it's free and open? pass

author: JOEBOBSICLE
author_rank: Regular Contributor
timestamp: February 05, 2021, 11:52:09 pm
content: Usability of microchip parts is poor at best. Debugging is unreliable, MPLAB X is slow and the compilers are old.

author: IDEngineer
author_rank: Super Contributor
timestamp: February 06, 2021, 12:09:55 am
content: Quote from: JOEBOBSICLE on February 05, 2021, 11:52:09 pmYMMV, but that has not been my experience. We have lots of active products with PIC's (especially PIC18's) and ship over 10K PIC's annually. For us, debugging with an ICD3 is very reliable. MPLAB X is fine once you configure it (true for virtually all IDE's) and while it has a few weirdnesses (ditto) there are known workarounds. We do some pretty elaborate architectures here, including multi-PIC's on a single board where some are galvanically isolated and being debugged with galvanically isolated ICD3's simultaneously with non-isolated PIC's, so we're not just running "easy" scenarios. Everything works great.BTW, we generally don't chase the latest upgrades. We only use ICD3's. We're running MPLAB X v3.40, which is back a few revisions, but I have seen lots of online complaints about later versions of MPLAB X, so we're not overly motivated to change!Same with compiler versions... the ones we have work just fine so we haven't felt any need to "update" for several years. We have work to do, we don't have time for "latest versionitis".EDIT: I'll also give Microchip props for excellent customer service. As I've shared elsewhere here, when we had a challenge using one of their parts in a certain way they set up a conference call with at least half a dozen high end Engineers from their staff. I even met one of their Analog Engineering Management guys for pizza once. Some of the best customer support I've ever had from a semiconductor company.Just wanted to balance your comments with some positive ones.

author: JPortici
author_rank: Super Contributor
timestamp: February 06, 2021, 05:40:02 am
content: "compilers are old" is probably one of the mostexcuses i've read

author: JOEBOBSICLE
author_rank: Regular Contributor
timestamp: February 06, 2021, 10:45:51 am
content: A lot of people in industry are switching to modern c++, to take advantage of static polymorphism, static asserts, proper type checking and constexpr for compile time calculations.Ditching pointers for references and c arrays for std::array are also things that can provide significant improvements in software quality of your code. Meaning less time spent in the debugger.We all know microchip microcontrollers are good but their toolchain is stuck in the 90s.I recommend trying out any risc v or arm chip and seeing how much better code you can write once you have a free modern high quality compiler. Pair it with visual studio code and you can really feel a difference over MPLAB X.You don't have to write object oriented code with c++ or use inheritance. Use the parts you like and Chuck away what you don't like.

author: JPortici
author_rank: Super Contributor
timestamp: February 06, 2021, 03:05:56 pm
content: ah, i thought you were referring to the fact that they use an older version of GCC.you should have said instead "they don't support C++ or other languages" or something. which is partly true (there is g++ for PIC32MZ though i never bothered to try)In that aspect, i agree with you. I actually would like to have C++ for dsPIC. Proper classes and dealing with objects would make my life easier, also for debugging.Regarding VS Code, i feel ambivalent. I like it as an editor, but many design or UI choices are (IMHO) mistakes carried over from visual studio. Sure, it's modern, fast, lightweight and with a mostly good UI but all in all i prefer MPLABX, at least it's not eclipse.

author: JOEBOBSICLE
author_rank: Regular Contributor
timestamp: February 06, 2021, 08:06:07 pm
content: There's also CLion and a bunch of other IDEs out there. Once you understand how it works then you can ditch vendor IDEs for good. Plus you can get remote debugging for free which is incredibly usefulI still have a concern for old versions of GCC though. There's a lot of new warnings released with every version of GCC. Which can help catch a lot of bugs.

author: JPortici
author_rank: Super Contributor
timestamp: February 07, 2021, 09:51:58 am
content: I use static code analysis for that. MPLABX 5.45 added integration with cppcheck with misra rules, i appreciated that

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 16, 2021, 12:49:49 am
content: Well, ICD4 arrived.Wont connect to my PIC and the self test fails.I now have a 9 Gigabyte IDE, a $250 tool (brick...) and even with 20+ years of MCU experience and I can't get a LED to blink.I am going to need alcohol for this.

author: gooligumelec
author_rank: Contributor
timestamp: February 16, 2021, 04:15:47 am
content: Quote from: BreakingOhmsLaw on February 04, 2021, 10:50:32 amSure, and that's exactly how I like it. Otherwise, what? Always install every compiler - PIC16, 24, 32, AVR? Ask up front which ones you want? What if you're only upgrading MPLAB, and already have a complier installed?I'm currently working with 8-bit PICs (perfect for this application; I use ARMs in other projects), don't want the clutter of a whole bunch of compilers I'm not going to use, and selecting a compiler isn't hard...

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 16, 2021, 10:37:09 am
content: Quote from: BreakingOhmsLaw on February 16, 2021, 12:49:49 amI think there's a little test plug that comes with ICD4 that needs connecting for selftest - ISTR MPLABX didn't make this obvious last time I used it

author: DavidAlfa
author_rank: Super Contributor
timestamp: February 16, 2021, 11:58:47 am
content: About 10 years ago, I worked on programming mostly pic12,16,18 and 24 series.The pickit3, although slower, was way more stable.We had all imaginable weird and strange bugs with the icd3.That was insulting comparing the price tags.I hope the icd4 is better...Given it's recent debut into the market, keep the mlabX updated, they will fix a lot of bugs.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 16, 2021, 03:41:55 pm
content: I generally use PICkit3 for smaller devices as it's less temperamental. ICD4 scores on programming speed for larger parts

author: gooligumelec
author_rank: Contributor
timestamp: February 16, 2021, 11:47:27 pm
content: I use PICkit3 for day to day development, find it convenient and trouble free - for a board that's big enough, just include a pin header on the PCB and plug the PK3 right in!I also have an ICD3 that I use when I have a batch to program. Haven't seen any need to invest in an ICD 4 yet.What's more interesting is that I also have a PICkit 4 sitting in the drawer, and I don't bother with it. Not sure why. Maybe simply that it's physically bulkier and the PK3 does what I want. I did a video comparing it with the PK3:https://youtu.be/aAAurahPSbg, but that was a couple of years ago and I'm sure they're better now. I'm just happy with the old familiar that works, I guess.It's ironic that I felt similarly when the PICkit3 was released - I kept using the old reliable PK2 for ages. Also stayed on MPLAB 8 for quite a while!At the end of the day I just want to get my work done without tools getting in the way. It if works, as they say...

author: JPortici
author_rank: Super Contributor
timestamp: February 17, 2021, 06:40:31 am
content: True, but i found the PK4 to be a massive improvement.Not right away, though, at the beginning it was a bit frustrating, because the programming algorythms for the parts i use the most were not "optimized" and it took almost twice to program compared to a PK3. Really. After a while and a couple of complaints it got sorted out and it's really fast to use, more stable too

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 18, 2021, 10:48:57 am
content: Quote from: mikeselectricstuff on February 16, 2021, 10:37:09 amYes, it is connected, but the test still fails.MC Support is trying to help, but to no avail until now.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 19, 2021, 03:27:21 pm
content: Well, Microchip support today fixed my problem in a Teams session.In the end, the fix was upgrading to the recently released MPLAB 5.45, updating all ICD4 packages, then their support engineer made a dummy project to force the programmer to be updated and now it works like a charm.I concur with IDEngineer that their tech support is really good.All in all, MPLAB seem to be very bloated though. But that may just be my preference for streamlined and lean tools that do the job without additional bells and whistles. YMMV.Too bad platform.io does not support bare metal projects yet.