USBProg2 User's Guide 31 August 2008 This document describes how to set up and operate a Embed Inc USBProg2 PIC Programmer. The purpose of the USBProg2 programmer is to "program" data into Microchip PIC microcontrollers (PIC is a registered trademark of Microchip Technology Inc). Setup the Software Go to the web page http://www.embedinc.com/picprg/sw.htm and follow the directions for downloading and installing the software. Install the software before connecting the programmer to the computer. Setup the Hardware To set up the programmer hardware, do the following: 1) Connect the USB. Use the cable that was supplied with the programmer or a compatible cable. Plug one end into the USB connector at the left side of the programmer. Plug the other end into a USB socket on your computer. There is only one way to connect the cable, so if it fits, it's right. The STATUS LED should light dimly. 2) Connect to the target circuit. The programming signals are available two different ways. Both programming connections are at the right side of the USBProg2: 1) The RJ-12 connector has the same pinout as the RJ-12 connector of a Microchip ICD-2. Any means of connecting an ICD-2 via its RJ-12 connector can also be used with the USBProg2. 2) Six pin locking header. When looking into the right end of the unit with the RJ-12 connector on the left and the 6 pin header on the right, the pinout of the 6 pin header from left to right is: 1 - Vpp 2 - Vdd 3 - Ground 4 - PGD 5 - Ground 6 - PGC A cable made to connect to this header is electrically and mechanically compatible with the 6 pin programming header of a USBProg. This interface has two ground pins instead of the single ground pin used by the ICD2 interface. The extra ground pin facilitates making cables that eliminate the PGD to PGC crosstalk problem by separating these two signals with a ground wire. This 6 pin header is intended to mate with a Molex 22-01-3067 housing with pins 08-50-0114. For more information about PGD to PGC crosstalk and other circuit design considerations for in-circuit PIC programming, see http://www.embedinc.com/picprg/icsp.htm. Verify the Setup The directions in this section assume that the software and hardware have been set up as described in the previous sections. The STATUS LED should be dimly lit. To verify the hardware and software setup, make sure you are running a command shell and enter: pic_prog at the command prompt. This should report the firmware type as USBProg, its version number, the name of the organization that created it, and the unique name of the particular USBProg2. If the USBProg2 is connected to a target system with one of the supported PIC types that contains an internal ID word, then the target PIC model and its silicon revision will be shown. Otherwise a message is shown indicating that the device ID of the target chip could not be read. If more than one USBProg2 or compatible programmer is connected to the USB, then one of them will be arbitrarily chosen unless its name is given explicitly. For the PIC_PROG program, this is done with the -N command line option. The factory default name for each USBProg2 is "USBProgXXXX", where XXXX is the unit serial number expressed with 4 digits. For example, to explicitly check USBProg2 with serial number 123, use the command: pic_prog -n USBProg0123 Note that the name is case-sensitive. The name can be changed with the PIC_CTRL command using its -SETNAME option. See the PIC_CTRL documentation file for details. The serial number of a USBProg2 can be determined by ensuring it is the only PIC programmer connected to the computer and running the program "picprg_list". Normal Operation Several programs are included in the standard software for using the USBProg2. Each program has a separate documentation file in the DOC directory within the software installation directory. See the DOC files for details on how to use these programs. Briefly, the programs are: PIC_PROG Program or verify the target PIC from the data in a HEX file, such as produced by MPLAB. This program also has other capabilities and various options. See the documentation file for details. PIC_READ Read the data from the target PIC into a HEX file. PIC_CTRL Low level control of the programming lines. Can also rename a programmer. PICPRG_LIST List all compatible PIC programmers that can be enumerated by the host computer, such as the USBProg and USBProg2 PIC programmers. TEST_PICPRG This is a low level test program not intended for end users. It is not fully documented. This program can be useful when developing your own software, or you may be asked to run it in an attempt to diagnose a problem. Type HELP at the ": " prompt to get a brief list of commands. Status Light The status light is the green LED at the top of the unit. It indicates 5 different states: Unlit No power is applied to the unit. The target system may be connected or disconnected in this state. Dimly but solidly lit Idle state. The unit is powered on, but otherwise inactive. The target system may be connected or disconnected in this state. Flashing at 4 Herz, brightness is low. The host is communicating with the unit, but the target system is not powered from the USBProg2. Do not connect or disconnect the target system in this state. Flashing at 2 Herz, brightness is medium. The target system is powered up. Communication with the target may be in progress, but the target is not being written to (no permanent target state changes are being made). This is the normal display during verification or data readback. Do not connect or disconnect the target system in this state. Flashing at 1 Herz, brightness is high. The target chip is being actively written to. This is the normal display during a "programming" operation. Do not connect or disconnect the target system in this state. The status diplays have been deliberately chosen so that obvious flashing indicates the target system should not be connected to or disconnected from the USBProg2. Doing so while the status light is flashing may permanently damage the target system. The target system may be connected or disconnected when the status light is solid, including completely off. Software Updates New software is made available from time to time. Go to the web page http://www.embedinc.com/picprg/sw.htm to check on the latest released version. Firmware Updates New firmware is made available from time to time. Go to the web page http://www.embedinc.com/picprg/sw.htm to check on the latest released version. The PIC_PROG program can be used to determine the current firmware version loaded into the USBProg2. USBProg2 uses the same firmware as the USBProg, which is stored in files named EUSBxx.HEX in the SRC/PICPRG directory within the software installation directory, where XX is the firmware version number. The procedure for updating the USBProg2 firmware is described on the USBProg2 product page, http://www.embedinc.com/products/usbprog2.