File: /~heha/ewa/PIC16F145x-Urlader/bootCDC1.zip/readme.txt

FILE LIST:
bootCDC-hvp.a15		boot loader suitable for high-voltage programmers †
bootCDC-lvp.a15		boot loader for cheap low-voltage programmers, see below
bootCDC-lvp-w.a15	... with software workaround for silicon bug
check-reset-by-mclr.a15	shows up silicon bug in a very short program + explanation
Makefile		Invoke "make" to build all .hex files using gpasm
mymacros.i15		include file
cdcacm.inf		The last COM port „driver“ file for Windows you need


How do _I_ put this bootloader into the PIC16F145x chip?

PREREQUISITES:
I use the Windows version of PicPgm, an old-school parallel port,
a self-made programming adapter consisting of a D-Sub25 male connector,
some wires and one diode, and a small breadboard.
For function testing, a USB cable from a mouse, and a capacitor for the 3P3 pin.

That requires that the configuration bits must be changed to allow
low-voltage programming, and RA3 is then reserved and not usable by firmware.
Not so bad.
Don't connect a capacitor or RC combination to RA3 as done for earlier PICs!
That would defeat detection of a power-on reset condition, and the bootloader
would never jump to the application.

WIRING:
The wiring is so made that:
* WinPICPgm can be easily configurated with ascending pin numbers
* The parallel port powers the PIC sufficiently, no power supply is necessary

PROGRAMMING:
WinPICPgm is easy to use:
* Configure as shown before (TODO)
  This would lead to autodetecting your PIC16F145x, see Status Bar
* Load the bootCDC-lvp.hex file 
* Change the configuration bits to allow low-voltage programming
* Press the program button

TESTING:
Your PIC16F145x needs a USB cable and two capacitors,
one between 5P and 00 (aka GND), and one between 3P3 and 00.
A good choice is 10 µF for 5P and 470 nF for 3P3.
The USB cable has to be connected as shown before (TODO).
You should see that Windows enumerates a COM port.
If Windows requests a driver, give it the accompanying "cdcacm.inf" file.
It will add a generic driver for all COM ports that will appear later.

TROUBLESHOOTING:
In case of WinPICPgm doesn's autodetect PIC16F145x:
* Check voltage at 5P, should be 3 V at least
* Check wiring
* Check configuration of WinPICPgm
  You can use its built-in hardware test function to toggle some I/O
  and check with a multimeter
If you don't have luck, your PIC may be already "used" by a high-voltage programmer,
and the RESET function is not available.

In case of WinPICPgm shows a verify error:
* Check voltage at 5P, should be 3 V at least
* Try adding a capacitor there
* Check that your configuration bits are set to allow low-voltage programming

In case of Windows doesn't show a new COM port:
* Check your USB cable
* Check voltages at D+ (must be 3 V) and D- (must be 0 V)
* Check voltages at 5P (must be 5 V) and 3P3 (must be 3.3 V)
* Check voltage at RA3/RESET, must be 5 V by internal pullup resistor

WHY FILENAME EXTENSION .A15?
I used extension .a14 for PIC16F84, meaning "assembly for PIC with 14 bit instruction width",
to ease syntax coloring, in opposite to .asm: Nobody knows what machine and syntax!
Similarly I used .a51 for 8051, .a80 for Z80, .a86 for 8086, .a64 for amd64,
and .a90 for AT90 and therefore for ATtiny and ATmega.
.a15 means ".a14 with enhanced instruction set", which includes table reads and branches.
That's all: Extensions matching /\.a[0-9]{2}$/ are assembly source files,
/\.i[0-9]{2}$/ are assembly include files.

henni, 200303

† Note that, in opposite to AVR microcontrollers, the “HVP-required” fuse
a.k.a. configuration bit can only be set to 0 by a high-voltage programmer.
This way, you cannot inadvertedly make your chip+programmer combination
unuseable, in opposite to AVR controllers. As a disadvantage,
you always need a high-voltage programmer to make RA3 useable (as input),
even when you flash a bullet-proof firmware you got from somewhere else.

henni, 230412
Detected encoding: UTF-80