Modifications of F. Deck's Mac PIC programmer

Please read everything, including the disclaimer at the end!

If you are a Mac type who is into PICs, and you didn't want to spend money on a commercial programmer, then chances are you are using Kevin Coble's MacPIC software with Francis Deck's programmer.

The combination works fine, but the programmer uses the expensive LM10 voltage reference chip (F. Deck has since modified his circuit and uses a plain LM 318, so this isn't much of a factor anymore); to avoid buying it I rigged something out of ordinary op amps that worked, but was a chewing gum-and-string affair and ate 9V batteries like crazy. On the other hand Lauri Pirrtiaho's super-simple switch (imagine that!) solution to the problem somehow seemed too low-tech ;-) So I experimented a bit and here is an alternative that I'm using now:

(those who don't like my hand drawing :-( can look at a PDF version)

First, about 15V AC comes from an old modem "brick" wall transformer (use anything that after rectification will happily feed standard 12V and 5V regulators without burning them). The rectifier bridge can be anything rated at 1A and 50V or more. The 5V regulator supplies power to the programmer.

The 12V regulator is used to produce the programming voltage of about 13V by raising the "pedestal voltage" to 1V with a resistor and a trimmer. You could use a variable regulator such as LM 317 in a similar configuration, but I already said that I'm cheap! (and had a 7812 lying around anyway). This trick is described in datasheets (e.g. National Semiconductor). You may want to play with a 7805 instead of 7812 and raise the reference by 8V instead - I think this would make it easier to come up with reasonable values for the resistances involved, but I haven't tried.

Now to let the programmer PIC enable/disable Vpp at the PIC being programmed, I used an NPN switching transistor (e.g. 2N3904). When it turns on it biases the base of a PNP transistor (e.g. 2N3906) so that the second one effectively shorts to the 13V supply. Make sure you have the current limiting resistors at the collector and the emmitter respectively, as shown! If anyone knows how to do this with a single transistor, I'd be curious to know - I couldn't figure it out.

You may want to hook up a "power on" LED to the 13V rail, and a "programming on" LED to the collector of the second transistor (again, each with a 2.2k - 10k resistor in series).

Since there is some voltage drop along the way, you will need to measure the programming voltage you get. To turn it on, either use ZTerm or some such to send "a" to Deck's firmware, as described in his HyperCard stack, or simply short the base of the first transistor to 5V with a 1k - 10k resistor temporarily. First measure Vpp at the programming socket without anything in it, and adjust the trimmer pot at the 12V regulator so you get 13V. Then insert a PIC to be programmed and adjust one more time. Everything should be ready to go.

Finally, Deck mentions that some people had trouble with one of the Mac serial lines (RxD-) until it was tied to about 2.5V, and suggests a damaged serial port. In my case the programmer wouldn't work with either a PowerBook 520 or an LC III until I raised the voltage on that pin, so I suppose it may be required with some Macs. Just use a voltage divider out of two 10k - 47k resistors.

Disclaimer: all this works for me, and only with 16C84 (I haven't tried any others that the programmer is supposed to handle). Francis Deck's documentation repeatedly warns about potential damage to EPROM chips caused by improper V_PP. Moreover, the resistor values are pretty much off the top of my head, and may not give enough stability or safety margins. By now I've gone through at least 500 program cycles with no problem, but please don't blame me if you blow some chips!

The gadget does seem to be quite resilient: at first I badly mis-wired the programming socket, put a PIC in it, and everything started to heat up like an oven; in the 20 seconds or so before I noticed, no damage was done to any of the components, including my PowerBook... When you are testing all this, keep your finger on the regulator ICs; with normal currents being drawn by everything they should be lukewarm at most. By the way, if the circuit goes haywire it doesn't necessarily mean that it's wired wrong: I have one 16C84 that must have a short in it and cannot be programmed; it also draws an excessive current. All the others I have work just fine.

Back to my PIC page


Last modified: 6/29/98