16F876 Bootloader v3-2

This is an updated form of the bootloader supplied by Hi-Tech C, incorporating a number of bugfixes
and enhancements.

Advantages:

- bugfix: doesnt overwrite program memory if config word at 0x2007 is specified
- bugfix: doesnt overwrite program memory if ID word is specified
- bugfix: works with EEPROM data in .hex file
- bugfix: resets all regs to defaults on restart
- doesnt need a special button on RB0 to work (see below)
- its all been tested, and works beautifully

1.  Plug in a serial board adaptor with a MAX232/MAX3222/SIPEX232 etc to connect 
the serial port of the computer to pins RX/TX on PIC.  See the attached .gif and 
Protel 99 .sch files. You only need one serial port - ignore the M2_xx lines as 
they are not needed for this.

The FAQ at http://www.keyghost.com/htpic has the same, schematic diagrams, plus a 
troubleshooter guide for non-working serial ports.

2.	The default bootldr.hex is for 16F876/7, 16Mhz crystals.  Select the correct 
.hex file from "bootldr hex compiled.zip", and rename it to bootldr.hex.  
Options are 4, 16 and 20Mhz for the 16F873 or 16F876.  As far as programming 
goes, the 16F873 is the same as the 16F874, and the 16F876 is the same as the 
16F877.

Program the picmicro with bootldr.hex.

3.  Run download.bat, and follow instructions.

4.  Reset PIC micro now.

5.  Program is downloaded.

6. 	Default program is mainser.hex, see download.bat.

7.	mainser.hex simply prints out a single text message @ 19200 baud on powerup, 
run '19200-com1.ht' to see it.

8.  In future, after powerup, bootloader times out in 1/2 sec and then runs 
program normally.

9.  This bootloader works for 16Mhz crystals.  For anything else, you will have 
to adjust the crystal speed in bootldr.hex, see _faq.txt

(c)2000 Shane Tolmie, shane@keyghost.com
see http://www.keyghost.com/htpic for more projects like this and a huge FAQ on Hi-Tech C.