ProProg(tm) User's Guide 6 November 2004 This document describes how to set up and operate a ProProg PIC Programmer. The purpose of the ProProg 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. Setup the Hardware To set up the programmer hardware, do the following: 1) Connect power. There are three options for connecting power to the unit: 1) Supplied wall wart power supply. This power supply is for use with standard 110 - 125V 60Hz power outlets as found in the United States. Push the small round plug on the end of the power supply cord into the socket in the back left corner of the unit. 2) External AC power, 50-60Hz, sine wave, 18-22 volts RMS while supplying 0-5.5 watts. If the power is available via wires, strip about 1/4 inch or 5mm of insulation from the ends of the wires. Loosen the two screws labeled "AC in" by the far left corner of the unit, insert one wire into each terminal block, then tighten the screws. If the power is available via a 1.3mm "wall wart" power supply plug, insert the plug into the jack labeled "P8" by the far left corner of the unit. Do not connect to both the 1.3mm power jack and the "AC in" terminals at the same time. 3) External DC power, 17-30 volts while supplying 0-5.5 watts, via wires. Strip about 1/4 inch or 5mm of insulation from the ends of the wires. Loosen the two screws labeled "GND" and "DC in" of the terminal block by the far left corner of the unit. Insert the positive lead into the "DC in" terminal and the negative lead into the GND terminal. Tighten the screws. It is permissible to have one of the AC power inputs connected simultaneously with the DC power input. The two power inputs are not connected internally such that one will attempt to drive the other. 2) Connect the ProProg to your computer with the serial cable. The cable can only be connected one way. The female end of the cable connects to a 9 pin serial port (COM port on PC systems) on the computer, and the other end connects to the 9 pin female port on the ProProg. 3) Connect to the target circuit. The programming signals are available three different ways. All programming connections are near the back of the right side of the ProProg: 1) The RJ-12 connector labeled "ICD2 Out" 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 ProProg. 2) Six bare pads. These are directly behind the ICD2 Out connector. Each pad is individually labeled Vpp, Vdd, GND, PGD, or PGC, indicating the specific programming line connected to that pad. There are two GND pads, both connected to ground. One of the GND pads is between the PGD and PGC pads. If this line is connected in a flat cable, it will prevent crosstalk between the data (PGD) and clock (PGC) lines. These pads are intended for permanently connecting a programming cable to the ProProg. This is the most reliable connection, but is only recommended when the ProProg and cable are held in place within a larger fixture. 3) Six pin locking header. This header is immediately to the left of the bare pads. The labels for the bare pads also apply to the individual contacts of the header. This is a standard header with square pins .025 inches on a side with a pin pitch of .1 inches. 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 ProProg must be powered on before proceeding. This means the wall wart (if used) must be plugged into a live outlet, or the external AC or DC power supplies turned on. The "Status" LED will be dimly lit to indicate the ProProg is powered up. 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 ProProg, its version number, and the name of the organization that created it. If the ProProg 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 the ProProg is connected to a COM port other than COM 1, then the command "pic_prog" will fail with an error message after a few seconds. In that case enter the command pic_prog -sio N where "N" is replaced with the number of the COM port the ProProg is connected to. Normal Operation Three programs are included in the standard software for using the ProProg. 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 three programs are: PIC_PROG The main purpose is to 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. 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 labeled "Status" at the near edge 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 ProProg. 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 selected so that obvious flashing indicates the target system should not be connected to or disconnected from the ProProg. 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. App light and OK button The light labeled "App" and the button labeled "OK" are at the near edge of the unit by the right corner. These have no dedicated function within the ProProg and are under control of the host application. Consult the documentation for each application as to the meaning, if any, of these features. For applications that do not use these features, the App light will remain off and the OK button is ignored. The PIC_PROG program uses the App light and OK button with the -WAIT command line option. See the PIC_PROG documentation for details. 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 ProProg. ProProg firmware is stored in files named PPRGxx.HEX in the SRC/PICPRG directory within the software installation directory, where XX is the firmware version number. To change to a new firmware version, perform the following steps: 1) Disconnect power from the ProProg. The Status LED must be completely off. 2) Create a cable that connects to the 5 pin locking header labeled "PCTRL" by the near left corner of the ProProg. Do not connect to the header labeled PPWR. The PPWR header is used during manufacture of the ProProg. Connecting to it can cause permanent damage to the unit. The pins of the PCTRL connector are numbered 1-5 starting with 1 at the near pin. Pin 1 is also identified with a square pad on the bottom of the board. The pinout of the PCTRL connector is: 1 - Vpp 2 - Vdd 3 - GND 4 - PGD 5 - PGC Connect the other end of the cable to a PIC programmer, such as another ProProg, an EasyProg, or a Microchip ICD-2. 3) Program and verify the new PPRGxx.HEX file into the ProProg using the second programmer. 4) Disconnect the ProProg from the second programmer. 5) Power up the ProProg. 6) Run the PIC_PROG program and verify that the firmware is the expected version. Advanced Features This section describes advanced features of the ProProg. These are not necessary for basic operation, but may aid general understanding for advanced users and can be useful for embedding the ProProg within a larger system. The descriptions below are intended for electrical engineers. Test points There are nine test points near the center of the right edge of the unit. These are primarily for use during manufacture of the unit, but some of these signals may be of limited external use in an embedded environment. Each test point is a standard square post .025 inch on a side. The pin pitch of the test points is .1 inch. The various test points are: 25V This is the unregulated internal DC power supply voltage directly out of the full wave bridge from the AC inputs or after a single diode from the DC input. The voltage is usually close to 25 volts when powered from the supplied wall wart. The voltage must at all times be from 17.0 to 29.5 volts for correct operation. It is permissible to draw up to 500mA from this pin provided the power supply is capable of delivering sufficient power to keep the voltage within specifications when doing so. The supplied wall wart power supply has no excess power capacity, and no power should be drawn from this pin when the wall wart is used to power the unit. 7V Nominal 7V internal DC supply voltage created from the 25V supply by a switching regulator. This supply has a current capacity of 500mA beyond that needed to power the ProProg internal circuits when the AC or DC input power is within specifications. This supply only has 250mA external current capacity when the unit is powered by the supplied wall wart. Current may be drawn from this pin to the extent of the available excess current capacity. Note however that the target system Vdd current is also taken from this same excess current capacity. The total drawn from this pin plus the maximum target system Vdd current must not exceed the current capacity described above. For example, assume the unit is being powered by the supplied wall wart. This means the total available external 7V current is 250mA. If the target system can draw up to 100mA when Vdd is driven at the maximum verification voltage of 5.5V, then it is permissible to draw 150mA directly from this pin. If the target system can draw up to 250mA maximum for any of the Vdd voltages for the particular target chip, then this pin can not be used to power additional external circuitry. Many target systems do not require the maximum possible Vdd current the ProProg can deliver, and the 7V line can be useful for powering limited additional circuitry in a dedicated installation. The 7V supply is produced by a switching regulator and is therefore rather noisy. 5V Internal 5V supply powering the control processor of the ProProg. This is really just a test point, and we don't recommend using this pin to power any external circuitry. If you must, don't draw more than 10mA, including any inrush. Glitching this line below 4.5 volts even briefly may cause all manner of strange behaviour. We really rather you didn't mess with this pin. If you need a 5V supply to power a small amount of external circuitry, we strongly recommend using a linear regulator from the 7V pin (see above). 5VP This is a different nominal 5V internal supply with even less current capacity. This is a test point used during the manufacturing process and not intended as a power source. Leave this pin alone. 2.5Vref Raw internal 2.5 volt reference. This is a direct line to the internal 2.5 volt reference voltage. This is really another test point, but you can use it as a 2.5 volt reference voltage only. This pin must not source or sink more than 50uA. We strongly recommend to use the 2.5VBuf pin (below) for a 2.5 volt reference. 2.5VBuf Buffered 2.5 volt reference voltage. This pin can source or sink up to 1mA and remain at the reference voltage. It can be driven externally from 0 volts to 10 volts without damaging the ProProg or causing abnormal operation. -1.4V Internal nominal -1.4 volt supply. This is not intended to supply external power. You can draw up to 1mA from this pin if you must. GND Both these pins are connected to the ProProg ground, and are the 0 reference voltage for all the other pins. These pins are also connected directly to the ground plane bottom layer of the circuit board, and may be useful for EMI purposes. PPWR connector This connector is a 5 pin locking header at the near end of the left edge of the unit. This header is stricly for use during manufacturing. Any connection to this header can cause erratic behaviour and permanent damage to the unit. Debug jumper This is two posts labeled "J1" and "Debug" near the center of the unit. These pins should be left unconnected for normal operation. A jumper may be installed over these pins to short them together. This disables the 5 second host command stream timeout. The host timeout is described in detail in the protocol specification, which is in the PICPRG_PROT documentation file in the DOC directory within the software installation directory. The host timeout is an important feature which allows the unit to recover if the host program is aborted or the host connection broken during a command. With the host timeout disabled, the unit must be powered down and back up to resume normal operation in such a case. We therefore recommend that the debug jumper not be connected during normal operation. The debug pins are provided to aid in debugging host software. More than 5 second gaps can easily occur in the host command stream while single stepping the host application with a debugger. In such cases it would be indesirable for the unit to abort the current command and reset, and installing the debug jumper can prevent this. Remember to remove the jumper when done debugging because normal operation is less robust with the jumper installed.