 
 --------------------------------------------------
 R.Lacoste's PIC17C756 simple in-circuit programmer
 --------------------------------------------------

 What is it ?

   This software allow an in-circuit programming of the PIC17C756 processors
   through a specific hardware interface connected to the LPT port of any
   PC compatible computer (or so).
 
 Usage :

 	 17c756pg b			Blank check
 	 17c756pg v hop.hex	Verify (compare chip to hex file)
	 17c756pg p hop.hex	Program chip with data from hex file
	 17c756pg a hop.hex	Auto mode (blank/program/verify)
 	 17c756pg t			Test connection to the chip         
	 17c756pg z          Debug test (should not be usefull...)
 
   The "t" mode check if the interface and the PIC link are ok. It's a good
   starting point, and in fact this test in done first for all other options.
 
   The "z" mode is a repetitive access to the PIC, even if there is errors,
   allowing to use a scope and to debug the interface or the software. Press
   any key to skip to the next test. See source code for mode details.

 Warnings : 
 
   This is really a SIMPLE software ! Known limitations are :
 
    - No read mode (as i didn't need it... but should be easy to add !)
    - Only one hex file format supported : HEX32
    - Configurations bits must be embedded in the hex file (address FE00)
    - Prototype grade programmer (as opposed to production quality programmer,
      ie not 100% compliant to Microchip's programming specifications... but
      seems working !).    
    - No support for 17C752 (but I think with only one line changed it should 
      work... See NBWORD definition. Not tested)
    - This programmer is an "in-circuit" programmer, and not a stand-alone one.
      No major differences however, except that the PIC is not supposed to
      be powered by the programmer. Just add a socket and Vcc should
      give a stand-alone programmer.
 
 The interface :
 
   A specific hardware interface is required. See Postscript schematic
   for details (file 17c756pg.pst. Copy this file to a postscript printer
   or use the best and free postscript viewer : GNU's Ghostscript).

   The crystal value (indicated as 5.0688MHz) is not critic. Any value from
   4 to 8MHz should work (but not tested)
 
   This hardware interface should be connected to LPT1 (if you prefer LPT2,
   change it in the source). 
 
   Given the small number of components, it should be possible to make this
   interface without a PCB. I'm used to wire-wrapping but use your favorite
   method ! Of course, double check your design before connecting it to a
   PIC, even if PIC's are quite cheap... The "t" option is very useful for
   this purpose.
                                                  
 Connection to the PIC :
 
   The interface is terminated by a 8 pin header. This header have to be
   connected to the PIC with the following assignments :

   Pin 1 (VCC)       : to be connected to the PIC's power supply.
                       Warning : this is not a power supply pin but a power 
                       supply sense pin, as the PIC is supposed to be powered 
                       by its own power supply
   Pin 2 (RA1/TOCKI) : Programming clock. To be connected to the corresponding
                       pin of the PIC (pin 44 if PLCC)
   Pin 3 (RA4/RX)    : Data I/O. To be connected to the corresponding pin
                       of the PIC (pin 43 if PLCC)
   Pin 4 (RA5/TX)    : Data clock. To be connected to the corresponding pin
                       of the PIC (pin 42 if PLCC)
   Pin 5 (Mode/RST)  : Mode and reset control. To be connected to the 
                       corresponding pin of the PIC (pin 16 if PLCC). Be
                       careful : this pin should be pulled-UP when the
                       programmer is disconnected (6K8 between this pin and
                       Vcc on the application board)
   Pin 6 (TEST)      : test pin, allowing serial programming mode 
                       initialisation. To be connected to the 
                       corresponding pin of the PIC (pin 17 if PLCC). Be
                       careful : this pin should be pulled-DOWN when the
                       programmer is disconnected (6K8 between this pin and
                       GND on the application board)
   Pin 7             : not connected (useful as an index...)
   Pin 8 (GND)       : Ground. To be connected to PIC's Vss.
 
 How to use it ?
 
    0/ Before any connection, the PIC application board should be SWITCHED OFF.
    1/ Connect the programming interface to the PC parallel port and to a 13V
       power supply (but not yet to the PIC), switch-on the 13V power supply
    2/ Launch the programming software with the required options :
         17C756PG A FOO.HEX
    3/ When required by the program, connect the header to the PIC and switch
       on the PIC power supply. Press any key.
    4/ Wait for the operation to complete
    5/ When required by the program, switch off the PIC power supply and
       disconnect the header. Press any key to leave the program
    6/ return to (2) if you have another operation to do or switch off the 13V
       power supply
 
    (remarq : the header can be left in place between 2 operations)
 
 How it works ?
 
    In order to start the PIC in in-circuit serial programming mode, it should
    be get up from reset with TEST and MODE pins at Vpp level (13V). When 
    launched, the programming software make sure that the MODE/RST pin is
    low (reset mode) before connecting the header and switch off the PIC. So
    the PIC is hold in Reset mode. Then the software put TEST to Vpp, and then
    MODE to Vpp. The PIC jump to serial programming mode and wait for its
    commands from the serial RA4/RA5 interface. Give a look to Microchip's
    programming specs for mode details (available at http://www.microchip.com)
 
    Nota : in this serial programming mode, the PIC gets its clock from the 
    RA1 pin. So don't bother, it will works whatever your clock system is...
 
 More informations :
 
    Compiler used : Visual C++ 1.52 (MS-DOS EXE mode)
                    Should be easy to use DJGPP or Borland but not tested.
 
    Copyright (C) 1997 Robert Lacoste - France.
    Email : RLACOSTE@EuropeM01.nt.com
 
    Nota : This is my work Email, but the writing of this software is not 
    related at all with my job.
 
    Largely inspired (and copied !) from Paul Vollebregt'PGM74 software, of
    course with his aggreement. Thanks Paul !
 
    Before any modification to this program, please first read carefully 
    Microchip's programming specifications (DS30274A)...
 
    This program is free software.  Permission is granted to use,
    copy, or redistribute it as long as :
    - it is always distributed for free (except distribution costs)
    - full source code and documentation is distributed along with the 
      executable file, 
    - my copyright notice is included without any modification.
 
    THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND.
 
    If you use this programmer, I will always be happy to receive
    your comments. Feels free to send me a small Email !

 Robert.

