PICPROGA - PIC programmer with support for "A" suffix PICs. 07/01/06 Copyright (C) Pigeon 2006. License: GPL. PICPROGA will program both the old 16F873 and the new 16F873A PICs, plus other PICs with compatible programming specifications such as the 12F683. It makes use of four environment variables which should be set or unset as required before running the program: PICCONFW This defines the Configuration Word (sometimes called "the fuses" by the ignorant) to be written to the PIC configuration register. This must be set according to the requirements of the code being programmed. For all TFH projects to date, it is 3F72. PICAMODE This selects whether the newer "A"-suffix PICs or the older PICs without the "A" suffix are being programmed. It should be set (to any value) to program "A"-suffix PICs, and unset to program the older versions. If it is not set appropriately for the PIC being programmed, huge numbers of programming errors will occur. PICLPTADDR This defines the address of the LPT port to which the PIC programmer is connected. In general this will be 378 for LPT1 or 278 for LPT2. The value of 3BC is also recognised. Any other value will cause the program to abort. PICDUMPMODE This selects whether PICPROGA is programming the PIC or dumping the contents of the PIC to a file. It should be set (to any value) to dump, and unset to program. PICPROGA is called using the syntax: PICPROGA where is the name of the file containing the source code, or the name of the file to which the contents of the PIC are to be dumped in dump mode. PICPROGA may be compiled for either Linux or DOS by defining the appropriate preprocessor directive in the source code, as below: To compile for Linux: #define LINUX #undef DOS To compile for DOS: #undef LINUX #define DOS When compiling for Linux, the executable must be made setuid root in order to gain i/o permissions for the printer port. It has been tested under gcc-2.95 for Linux, and Turbo C 3.0 for DOS. PICPROGA is free software and may be freely distributed under the terms of the GNU GPL. PICPROGA requires a PIC programming adaptor connected to the parallel port according to the following scheme: Signal Pin Bit Function ====== === === ======== Vpp control 17 C3 Turn on Vpp (negative logic) Vpp feedback 15 S3 Report state of Vpp (positive logic) Data out 3 D1 Data out to PIC (positive logic) Data in 11 S7 Data return from PIC (negative logic) Clock 2 D0 Clock signal to PIC (positive logic) Clock feedback 12 S5 Verifies clock signal at PIC (positive logic) "Positive logic" and "negative logic" refer to the states of the signals at the actual pins of the printer port, ie, the programming adaptor must invert the "Vpp control" and "Data in" signals but not the others.