serp84 - Serial port programmer driver for PIC16C84 V0.5 Copyright (C) 1996 Ralph J. K. Metzler (rjkm@thp.uni-koeln.de) according to the GNU General Public License (see in file "COPYING") Disclaimer: The serial port programmer described in com84.gif programs the PIC16C84 "slightly" out of official specifications. It is not my design but taken from the com84 package at: ftp://rasi.lr.ttu.ee/pub/SIS or http://rasi.lr.ttu.ee/~sis I take absolutely no responsibility for any hardware or software damage the hardware and/or this program may cause. Use it at your own risk! compile with: make usage: serp [-8] [-88] [-e] [-ee] [-v] [-r] [-1] [-2] [-p port] [-f?] hexfile -8: use 8 bit hex file format for reading/writing -88: use 8 bit per word and 8 bit per address (for EEPROMs) -ee: a serial EEPROM and not a PIC is inserted -e: erase PIC/EEPROM before writing -v: be more verbose (-v -v is even more verbose in some cases) -r: read the PIC/EEPROM -1: use COM1 -2: use COM2 -a port: use serial device at address port -p: programmer is on parallel port (not working yet) -s: programmer is on serial port -fl, -fx, -fh, -fr, -fw, -fp, -fc: set fuses, overrides value at 0x2007 in hexfile l,x,h,r: oscillator type (use only one) w: watchdog, p: power up timer, c: code protection IDs and config bytes are expected at 0x2000-0x2007 Data memory data is expected at 0x2100-0x213f While programming the current memory address will be shown every 64 bytes. For each address '.', '+', 'X' or '-' will be displayed. '.' : programmed and verified OK '+' : not programmed because the right value was already found 'X' : programmed but verify was no good '-' : skipped because no value was specified in hexfile. In EEPROM mode with only one "-v" specified only a "." is output for every 128 bytes. With "-v -v" a detailed list (as above) is output after programming finished. In most cases serp can figure out the correct filetype by itself. To use the programmer hardware to program 24C65 or 24C16B EEPROMs in the same socket as the PIC16C84: Connect pins 5,6,7 and 8 (GND) and connect pins 11 and 13 (SDA) on the PIC programmer socket. Then insert an EEPROM in 5-6-7-8 and 11-12-13-14 with pin 1 (of the EEPROM) at pin 5 of the socket. This connects A0, A1, A2 and Vss of the EEPROM to ground, NC (not connected) and SDA to the data line, Vcc to Vcc and SCL to the clock line of the programmer. Connecting these pins will not interfere with programming the PIC! If the little mark (pin 1) on the EEPROM is in the upper left, one row of the socket below the EEPROM and 4 rows above the EEPROM should now be free. Otherwise, the EEPROM might just be getting the +/- 9 or 10V from the serial interface on its pin 1. I don't know how it will react to that and I am not about to try it! The 24C16B is supported starting with version 0.5. Although in the case of the 24C16B the WP (write protect) pin is now connected to the data line, programming seems to work fine. If you have any problems with this type of EEPROM, maybe try connecting the WP pin (pin 7) to GND. The type of EEPROM should be recognized automagically. Changes: 06/15/96 first version 06/28/96 added fuse support, PIC reading, hexfile writing 06/29/96 experimental support for 24C65 (reading works) 07/18/96 fixed 24C65 writing (start and stop conditions were a little off) use sequential read for reading the 24C65 07/27/96 new hexfile mode for EEPROMS (switch -88) with 16 8 bit words per line 09/09/96 V0.4 fixed bug with port address '-p' now specifies parallel port programmer (not finished yet) '-s' specifies serial programmer 10/27/96 V0.5 added support for 24C16B and binary files in EEPROM mode a 16 byte per line hex file is now assumed to have 8 bit words (-88 mode) So, you should need no file type parameters to program e.g. the multi_ee.hex file TODO: - support parallel port programmers (should not be much more to do, just did not have the time testing it yet) - modulize into hexfile-, PIC-, I2C-, programmer-, ... classes - better user interface? NCURSES? - support for other EEPROMS besides 24C65 and 24C16B? - Anybody know how the PICSTART protocol is? Please, please, please! write me a short email if you are using this program or if you have problems to get it to work. I only got 2 mails so far. Ralph J. K. Metzler