Programming a Production Image for Testing Purposes

The MDB can be used to program a production image for testing purposes.

Note: The MDB should be used only for debugging purposes. For programming devices, use the IPECMD tool or the IPECMDBoost (for improved speed). Refer to the Release Notes for IPE Command Line Interface (Readme for IPECMD) located in the MPLABX install folder, for example, \Microchip\MPLABX\vx.xx\docs, where vx.xx represents the version of MPLAB X IDE.
Note: When programming a device, you must select a device first.

The file or hardware tool you need to use for MDB cannot be active or open simultaneously in the MPLAB X IDE, IPE, or a third party program. Make sure you close (or make inactive) the file or hardware tool before you attempt to use it with the MDB.

  1. 1.Select the device by entering the command:

    Device [device name]

    For example: Device PIC18F66K22

  2. 2.Use the set command to select any options you want to use (see Table 1 or Table 1).
  3. 3.Select the hardware tool. To verify the supported tools, type:

    Help Hwtool

    The MPLAB ICD 3/4, MPLAB REAL ICE, PICkit 3/4 and Simulator are for programming and debugging, while the MPLAB PM3 is for programming only. To select the hardware tool, type the command:

    Hwtool [tool name]

    For example: Hwtool SIM

  4. 4.If the project was already built, a cof or elf file was generated. To program the device with the cof, elf or hex file, enter the command:

    Program “[location of the cof or elf or hex file]”

    For example:

    Program "C:\MDBTestExample\Build\test\preprocess\files\dist\test_IO_Button.cof"

    If you are using SIM (Simulator) as the hardware tool and the project needs an scl file, it can be set up by using the command:

    Stim “[location of the scl file]”

    For more information, use the command Help Stim. You can use Stimulus to set pin injection and/or register injection.

A “Program succeeded” message displays after programming is complete. A verify is automatically performed during a programming sequence.