Release Notes for MPLAB X PICkit 3 Command Line Interface

 

MPLAB® X IDE v__version__

_date__

 

Table of Contents

1       Tool Definition

2       Device Support List

3       Operating System Support List

4       What's New or Updated

5       Known Problems

6       Important Notes

7       Upgrading the Firmware

8       Command Line Options

9       Exit Codes

10     Troubleshooting

11     Command Line Examples

1      Tool Definition

PK3CMD is a 32 bit command-line interface to MPLAB PK3CMD device programming support.

The PK3CMD executable may be found, by default, in:

C:\Program Files\Microchip\MPLABX\mplab_ipe\

2      Device Support List

Device support is dependent on the firmware version installed in the PICkit 3 programmer and in-circuit debugger. Refer to the file "Readme for PICkit.htm" for the list of supported devices and what firmware files support which devices.

When selecting a part using the "P" option (section 10), use the following:

- PICmicro devices: drop "PIC", e.g., PIC16F877 becomes 16F877

- dsPIC devices: drop "dsPIC", e.g., dsPIC30F6014 becomes 30F6014

3      Operating System Support List

Microsoft Windows XP Professional SP3/ Windows 7 Professional/ Windows 8 Professional:

- Processor: 2.6 GHz Intel Pentium IV or equivalent

- Memory: 768 MB

- Disk space: 400 MB of free disk space

4      What's New or Updated

None.

5      Known Problems

Specific memory regions cannot be exported into a hex file.

6      Important Notes

1.     PK3CMD will auto update the Firmware; this will cause a delay to the operation.

2.     Part name should be entered without the family information such as PIC/dsPIC.
Example. PIC18F67J50 should be entered as -P18F67J50

3.     Program and Verify Operation makes use of the selected Hex file using -F<file>.

4.     Only a single session of PICkit 3 communication is allowed.

5.     Command line arguments are parsed alphabetically.

6.     Batch Mode Operation will initialize the PICkit 3 once and perform the same operations repeatedly. On each repeat operation user intervention is required. Batch Mode will exit on a failure of operation or user request to stop.
Warning: Batch Mode is recommended for use only for the .bat or direct invocation of PK3CMD because it will enter into a wait state for the user input.

7.     To generate an SQTP file use MPLAB X IDE, select the 'MPLAB PM3', then select 'Settings' and open 'SQTP' tab.

8.     Reprogram will enable the user to update the selected part of memory. The reprogram hex file should contain only data for the selected memory range that needs to be updated. This option first reads the device and updates the selected memory then writes it back to the device.

9.     Program Memory Range Address must be aligned to the device's program memory boundary size.

7      Upgrading the Firmware

PK3CMD will automatically download the latest firmware if required.

8      Command Line Options

The following commands are available in the command line interface.

Note: Commands are not case sensitive. Escape character can be a ‘-‘ or  ‘/’. 

Option

Description

B

Batch Mode Operation

C

Blank Check Device

E

Erase Flash Device

F<file>

Hex File Selection

H

Hold In Reset

L

Release from Reset

I

Use High Voltage MCLR

M<region>

Program Device region:

P = Program memory

E = EEPROM

I = ID memory

C = Configuration memory

B = Boot Flash Memory

If no region is entered, the entire device will be programmed.

N####,####

Program Memory Range

#### is a hexadecimal number representing Start and End Address in sequence

P<part>

Part Selection. Example: 18F67J50

R<file>

Reprogram

S<file>

SQTP File Selection

V<Voltage>

Power Target from PICkit3

Y

Verify Device against selected HEX File

?

Help Screen

 

Example:          PK3CMD  /P18F67J50 /GFc:\HexCode.hex

or

PK3CMD  -P18F67J50 -GFc:\HexCode.hex

9      Exit Codes

0 - All of the selected operations complete successfully

1 - Invalid Command Line Argument

2 - PICkit3 Communication Failed

3 - Selected Operation Failed

4 - Unknown Runtime Failure

5 - Invalid Device Detected

6 - SQTP Failed

10   Troubleshooting

Failed to communicate to PK3CMD:

·         Make sure only one session is communicating with the PICkit 3. If a PICkit3 is already loaded in MPLAB X IDE, a second PICkit 3 will fail to communicate.

·         Make sure compatible firmware is loaded on PICkit 3 for the selected device. To do that, open MPLAB X IDE, select the specific device and select PICkit 3. MPLAB X IDE will detect the firmware and if needed, it will update the PICkit 3 (by default the PICkit 3 will automatically update the firmware).

Programming Failed:

·         Make sure the Selected Hex file is compatible with the current device.

·         Check the selected Memory Region it available in the Device.

·         Check the selected device requires Erase before programming.

11   Command Line Examples

Command

Operation

Command Line

Program:

Program Entire Device:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -M

 

Program Entire device with SQTP file loaded:

PK3CMD -P18F67J50 -Sc:\IdSQTP.NUM -FC:\DemoCode.Hex -M

 

Program PROGRAM Memory:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -MP

 

Program CONFIG Memory:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -MC

 

Program EEPROM Memory:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -ME

 

Program USER ID Memory:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -MI

 

Program BOOT Memory:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -MB

Hold in Reset:

 

PK3CMD -P18F67J50 -H

Release from Reset:

 

PK3CMD -P18F67J50 -L

Verify:

Verify Data from File:

PK3CMD -P18F67J50 -FC:\DemoCode.Hex -Y

Erase:

Erase Entire Device:

PK3CMD -P18F67J50 -E

Blank Check:

Blank Check Entire Device:

PK3CMD -P18F67J50 -C

Batch Mode Operation:

Batch Mode can be combined with any operation:

PK3CMD -P18F67J50 -B -C

Power Target:

Power Target from PICkit3:

PK3CMD -P18F67J50 -V3.000 -B -C

Reprogram :

Reprogram with new Hex File:

PK3CMD -P18F67J50 -RF:\NewCode.hex -GFC:\OLDCode.Hex

High Voltage MCLR :

Use High Voltage MCLR:

PK3CMD -P18F67J50  -I

Help:

Help for All commands:

PK3CMD -?