Programming hardware and software for 14-bit flash PICs

This is the device I use for downloading code into 14-bit PIC microcontrollers with flash memory. Like all my designs it is GPLed and may be freely copied. It connects to the standard PC parallel port and requires a 12V DC supply. The software runs under either Linux or DOS.

This is the circuit diagram of the programmer; click on the image for a larger version:

PIC programmer schematic

The colour designations on the printer port connections refer to the colours of a cheap printer cable from CPC; I cut the printer plug off and wired the cable to the programmer, which is both easier and cheaper than buying a 25-way D plug and a length of cable separately.

The signals from the printer port are buffered using a 40106 since I found that on some (though not all) computers the printer port does not have enough welly to drive the device reliably. A 7555 is used as a level-shifter to control the programming voltage Vpp.

The device draws a 12V supply from the target board to provide Vpp, since the majority of my designs have a 12V supply on board. The 12V supply may be drawn from an external source if the target board does not have a 12V rail.

The Microchip documentation on programming PICs bangs on about ensuring that the rise time of Vpp is fast enough that the PIC's clock oscillator cannot complete 1024 cycles and then begin executing code during the rise time. The 7555 should have no difficulty with this, but as a belt-and-braces feature the programmer also grounds the CLKIN pin of the PIC when it is connected, thus stopping the oscillator dead.

The connections to the target PIC are arranged as follows:

Programmer to target connections

Connections are shown for a 16F873A; other flash PICs may also be programmed; the signals go to different pins but have the same names/functions.

The connector CONN1 is an 8-way DIL socket which accepts an 8-way DIL plug on the programmer. The 8-way DIL plug is actually a turned-pin 8-way DIL socket with the connections soldered to the sockety side. This is an easy and cheap way of making the connections.

The source code for the programming software is here and some notes on using it are here. The code may be compiled using gcc in Linux (only tested with gcc-2.95) or with Borland Turbo C 3.0 in DOS.

Note that this code is not neat and tidy "production" code. It was written and then much modified on an ad-hoc basis; it works, but it is not pretty. It contains a lot of commented-out stuff, which is the legacy of me hacking around with it :-) However, pretty or not, its design does make it very easy to hack around with. Its mode of operation is set not by passing parameters but by setting environment variables, because I find that more convenient when repeatedly running it with the same parameters - it saves typing...

Back to designs page

Back to Pigeon's Nest

Be kind to pigeons

Valid HTML 4.01!