PDA

View Full Version : How to run MPLAB IPE from MCSP



HenrikOlsson
- 19th June 2016, 22:32
With MPLABX comes a new programming tool called MPLAB IPE (Integrated Programming Environment) which, as of this writing, is at version 3.30. This software is able to use all of Microchips debuggers/programmers to program Microchips micrcontrollers and memory products. This is different compared to earlier when each tool had their own software.

MPLAB IPE can also work with multiple devices at the same (of same type or different type) time but this isn't something I've played with.

MPLAB IPE is distributed with MPLABX and gets installed when you install MPLABX (if you don't opt not to install it of course) and thankfully it has a command line interface quite similar to the PK3Cmd tool so it can be executed from within MicroCodeStudio without using the GUI.

To add it as a programmer in MCSP:
1) Go to View -> Compile and program options.
2) At the bottom of the dialog click Add New Programmer.
3) Select the Create a custom programmer entry option.
4) Give it a suitable name, like PK3(IPE)
5) The programmer executable name is ipecmd.exe
6) Click the buttom Find Automatically to let MCSP look up the path to executable

Ok, that's the basic stuff, now the parameters.
Parameters gets passed to the exectuable in order to tell it exactly what do. Here's what I'm using:

-tPPK3 -p$target-device$ -f$hex-filename$ -e -m
-tPPK3 tells I'm using PICkit3
-p tells it what the target device is and $target-device$ is a MCSP variable for the device (what you've selected in the drop down list)
-f specifies which file to program $hex-filnename$ is MCSP variable for the currently compiled and assembled file.
-e tells it to erase the part
-m tells it to program "everything" (CONFIG, EEPROM, FLASH, ID) but you can exclude stuff if you want by editing this.

There are several more options (and you can look them up in the documenation) but the more usefull ones are
-y which will verify after programming.
-w5.0 which will supply the target with 5.0 volts (provided it can).

If the target is powered externally you can have it check that Vdd is within suitable range before programming:
-n3.3 Min Vdd is 3.3V
-x5.0 Max Vdd is 5.0V

So, here's another example which will tell the PICKit3 to provide the target with 3.3V and verify after programming:

-tPPK3 -p$target-device$ -f$hex-filename$ -e -m -y -w3.3

/Henrik.

(This ended up in the PBP3 section of the forum because I couldn't find a more suitable place of it. If any moderator feels like moving it please feel free to.)

Ioannis
- 18th August 2016, 15:07
Nice post Henrik.

I only want to warn anyone using this method in case they have a board working at 3.3 and the parameters are left at 5 volts.

Some stuff on the board might be damaged at 5volts like LCDs or SD cards.

Ioannis