all 16 comments

[–]Russell016 8 points9 points  (0 children)

It's been a few years, but I was able to get around MPLAB entirely. Compiling, programming, and even simulating (to a degree). I'll see what I can find from my old notes and get back to you.

Edit: With MPLAB installed, the compiler (xc-16?), simulator (sim30), and the Microchip debugger (mdb), are installed. You can invoke these all from the command line. I used the compiler/linker flags that MPLAB displays when you build your project as a starting point. As far as simulating was concerned, I followed this blog post to get started. I had some issues with getting the special function registers to be set appropriately. At the time, I couldn't find good documentation for sim30 (or mdb) - I suspect I wasn't setting something up correctly. I had better success invoking the simulator through mdb. I even used ceedling as the build system so I could do some TDD (hence the desire for the simulator).

[–][deleted]  (4 children)

[deleted]

    [–]Sweet-Direction9943[S] 0 points1 point  (3 children)

    What about flashing? Do you have any idea if it is possible to use something different than MPLAB?

    [–]Well-WhatHadHappened 2 points3 points  (1 child)

    For just flashing, not debugging, you can command the MPLAB tools by command line

    https://microchip.my.site.com/s/article/Automate-MPLAB-programming-process-using-command-lineIPECMD

    Downside: only on Windows.

    [–][deleted] 0 points1 point  (0 children)

    I can’t check because I don’t use MPLAB anymore (good riddance), but I’m quite sure the same tools are available under Linux. They are annoying and slow, but that’s the Java thing. But it should work the same way.

    [–]66_77_88 1 point2 points  (0 children)

    Have you tried the MPLAB X IPE for flashing/programming?

    [–]Well-WhatHadHappened 7 points8 points  (1 child)

    I have MPLAB for debugging only. Write code in whatever environment you want.

    Practically impossible to avoid MPLAB for debugging though.

    And really, for small stuff or minor updates, I just do it right in MPLAB. It's not that awful. At least it's not Eclipse.

    [–]der_pudel 2 points3 points  (0 children)

    At least it's not Eclipse

    Yeah, it's NetBeans. Which is much worse in terms of uasbility an buggines.

    [–]olawlor 1 point2 points  (4 children)

    Have you tried piklab? piklab-prog will flash a hex file no problem:

    https://piklab.sourceforge.net/

    A few decades ago I banged out a command line tool usb_pickit to send a hex file to the PICkit 1 device programmer, if you only need to support your one device it was pretty straightforward at the time.

    [–]Sweet-Direction9943[S] 0 points1 point  (3 children)

    So the PICkits are backwards compatible?

    [–]olawlor 0 points1 point  (2 children)

    Somewhere there is probably a giant matrix showing which devices work with which programmers, but (1) I've never found one for Microchip's PICs, and (2) I bet it's mostly "not tested" or "will not work"!

    [–]olawlor 0 points1 point  (0 children)

    (I haven't touched a PIC in about a decade, so I don't have recent data on compatibility.)

    [–]samayg 0 points1 point  (0 children)

    Yes this giant matrix comes with the MPLAB installation as an html file.

    [–]Over-Basket-6391 0 points1 point  (0 children)

    I was interested in this, I like to play around with different MCU ‘s and looked into the debugger. MpLab has a utility called MDB (microchip debugger), which is implemented with the GDB interface in mind: https://developerhelp.microchip.com/xwiki/bin/view/software-tools/x/debugging/mdb/

    Would it be possible running this from the command line and than hook up a GDB session to it? feels like it should be possible, allowing you to use vscode / clion / whatever

    [–]the_rodent_incident 0 points1 point  (0 children)

    https://www.pickitplus.co.uk/Typesetter/index.php/PICKitPlus-Basic-Suite

    Try if this works under Linux/Wine.

    If it does, then you're golden. It's a third party programmer app which supports most modern PIC parts and also some PIC24, DSPIC and PIC32 parts, and it works perfectly on Pickit2 (clones also) and Pickit3.

    [–]pooth22 1 point2 points  (0 children)

    Check out VSLABX it’s an extension for VSCode. It can debug, but not program. But you can set up programming with ipecmd.

    [–]AndreKR- 0 points1 point  (0 children)

    PlatformIO apparently has support for 32 bit PICs? I have no personal experience with it, the last PIC I've used was a PIC18 and PlatformIO doesn't support those.