Tait Serial Programmer

2010-04-14

PIC16, PIC12 and PIC18 microcontroller programmer for Linux and Windows/Cygwin.

T03- Serial USB-to-RJ11 Programming Cable Installation Instructions Current version Version 03. THIS PAGE IS A FINAL VERSION OF DAVID TAIT PIC ARCHIVE, AS FROZEN BEFORE REMOVAL AT MONDAY, 24TH MAY 1999. Most of these files are related in some way to my simple PIC16C84 programmer for IBM compatible PCs (download pic84pgm.zip and pic84v05.zip). View and Download Tait TP9100 service manual online. Feature Enabler Sub Miniature Version A Surface-Mount Device Surface-Mount Technology SMPS Switch-Mode Power Supply Serial Peripheral Interface TCXO. If it turns on for a short time (approximately 2s), go to Step 3 and C721 should exhibit similar behavior.) Ensure the programming cable. PIC-PG3B is low cost parallel port programmer for PIC microcontrollers based on David Tait’s parallel port design. To operate PIC-PG3 needs external power supply 12-15VAC or 16-18VDC. PIC- PG3 supports all 8/18/28 and 40 pin PIC microcontrollers, which allow serial programming. The old PIC16C5X microcontrollers are not supported. Tait Serial Programmer Schematic Diagram The circuit above can be used to test out the simple in-circuit programmers. I've put together a few programs to exercise the board including a novel single digit clock (written in assembly language) and simple digital die (written in HI-TECH C). Connect the radio programming cable’s 9 or 25 pin connector to the computer’s serial port. Connect the radio programming cable’ s RJ-11 telephone-style plug to the radio’s microphone socket. Tip: You can change the COM port the application uses to communicate with.

Translations of some version of this document: Dutch

  1. Installation
  2. Available languages

PICmicro microcontrollers, or MCUs, are fine chips that are especiallyeasy to program with a simple device attached to a parallel or serialport. Because of the EEPROM or Flash memory, they are also easy andfast to erase and reprogram without need for UV equipment. This makesthem very popular among electronics hobbyists.

At the moment this is the second implementation of a PIC programmerfor Linux that works with the very simple and cheap serial portprogrammers. The first one I know was made by Ralph Metzler in 1996. Myprogrammer was originally designed for PIC16C84 and PIC16F84 chipsback in 1997, and since then I have implemented other chips withoutaccess to most of them. I have tested PIC16F628, PIC16F676,PIC12F675, PIC16F88, PIC16F876A, PIC16F76, PIC18F1320 and PIC18F458.Others have used many other models. The dsPIC30 family has some codein the sources, but the support is not finished yet. Some 12 bitchips should be supported but I have not tested that support.

1. Background reading

You really should take a look at the Microchip www-pages and read thedevice datasheets and programming specifications there.

Maybe the best source for PIC information is the home page of PICLIST discussiongroup. Also historically a good collection of links and software forPIC was in David Tait'sPIC links page and in GNUPICpages. I have also documented here the software I took a look at backin 1997. I have focused into Linux support, so I have never usedany DOS software mentioned.

2. Requirements

Serial port pic programming hardware
See the hardware section. This device is connected to a usualserial port of your PC, and is the same device as used with many DOSPIC burning programs.
A serial port
Having a serial port on a computer is not really that usual anymore. Often a serial port is optional on computer motherboards andthey do not come with 9 pin or 25 pin connector installed. USB serialport adapters can be used in Linux and Windows/Cygwin. However theyoffer very slow performance, as every bit transmitted needs serialcontrol lines to be toggled on and off, and each of these operationstakes milliseconds over the USB line protocol. Prepare to waitminutes to hours instead of seconds when programming with USB serialport adapter.
C++ compiler (g++)
This program is written in C++, so you need a C++ compiler tocompile it. This you should already have installed on your Linuxsystem or Windows/Cygwin system.
Linux kernel version 2.0.32 or 2.1.45 or later.
This programmer needs some functionality in Linux serial driverthat as of kernel versions 2.0.32 and 2.1.45 is available in standardkernels. The programmer uses TIOCSBRK and TIOCCBRK ioctl to controlthe state of TxD serial port output accurately. These ioctl's arestandard on BSD flavor unixes, like SunOS 4, but they may still areunimplemented on some serial drivers in Linux kernel.
Cygwin DLL version 1.5.8 or later
(For Windows installations only) Earlier Cygwin versions do notcontain the necessary TIOCSBRK and TIOCCBRK ioctl functionality.
A compiler for PIC
Your assembler, or C compiler, or whatever, should produce eitherIntel IHX32, IHX16, or IHX8M format hex files. For assembler on Linux Irecommend GNU PICUtilities gpasm.

3. Hardware

Use a serial port programmer device with the following pinouts:
TxD
Programming voltage, pin /MCLR
RTS
Clock pulse, pin RB6
DTR (output), CTS (input)
Serial data, pin RB7
A good programmer like this is for example PIC-Programmer 2designed by Jens Madsen.Some later chips with internal oscillator modes may need a bit morecomplicated designs or the reprogramming of the chips can beunreliable. See JDM-B: JDM ProgrammerModification: Automatic Vcc Control or RCD programmer.I have heard that other programmers work also, for example TE20and Olimex PG2C have been testedwith Picprog.

The description below is based on old version of JDM hardware. As youcan see above, there are better designs by Jens Madsen and othersavailable, please use them instead. Note however that for example thelatest Jens Madsen PCB does not support PIC16F628A that needs to havepin 10, RB4/PGM grounded. Please modify the PCB to ground this pin ifyour chip has PGM on pin 10.

I made a minor modification to the jdm84v23 schema and pcb mask,because I thought D4 was stressed on positive clock pulses - it shortcircuits the rs-232 RTS pin to GND. I added a 10k resistor between D4and D3. But it also is not absolutely required, as the clock pulsesare short and rs-232 is protected for short circuits anyway. Now Ihave noticed that this resistor makes the programmer less reliable,especially with later PIC chips, like PIC16F76 and PIC18 family. Ifyou have built the hardware I previously suggested, and it does notwork, please short circuit that resistor or build the new PCB fromJens Madsen site. Also you can try this patch by Matthijs Kooijman totest the levels of signals: picprog-slow-test.diff. This is for an older version of picprog, so it does not applyto current code, but you get the idea.

To support for example PIC16F628 and PIC16F88, which have a lowvoltage programming mode, the circuit was again modified to ground theRB3 pin 9 and the RB4 pin 10. This prevents the chip from enteringthe low voltage programming mode. To support for example PIC12F675,PIC16F630, and PIC16F676, pin 1 was connected to Vdd. Other jumpersneed to be installed as described below.

The schemantics diagram:

The 300 dpi pcb mask:

To support for example PIC16F876A and 16F76, which have differentpinouts for programming signals, you need an adapter that connects tothe external connector of the above programmer. Alternatively youcould redesign the pcb layout, but maybe it is easier to just solderthe adaptor. Solder the pins like this:

To support for example PIC12F675, PIC16F630 and PIC16F676, which havedifferent pinouts for programming signals but do not conflict withPIC16C84 pins, you can solder jumper wires on the above pcb. You needto connect pin 16 on the socket to clock (same as pin 12), pin 17 todata (same as pins 11 and 13), and pin 18 on the socket to Vss (sameas pins 5-10). Note that pin 1 is already connected to Vdd in theabove PCB mask. If this connection is missing on your older PCB,connect pin 1 to pin 14 with a wire.

Always check the correct pinouts for your chip from the datasheetsalso!

For support for 3.3 volt in-circuit programming, see themodified circuit by Krüpl Zsolt,Hungary. The base of the transistor is moved from +5V to +3.45Vwith the added 22k resistor to PIC ground.

4. Installation

Linux

There are binary packages available that have been prepared by helpfulusers and operating system vendors. I know of the following, butcannot offer any support for them. They might be for older versions,but even if they are, check for the 10. Changessection below if you really need a later version. Some new versionsof Picprog only fix small specific bug, which may not affect you atall.

  • FreeBSD includes Picprog port.
  • Gentoo has Picprog as a package.
  • Jan Wagemakers made a Debian package.

To install from source, download the picprog-1.9.1.tar.gzpackage, if you do not already have it.

Check your system against the requirements mentioned above.

Untar the archive and change to the source file directory. You shouldonly have to type:and the program should compile without errors or warnings. If it doesnot, please check that your compiler, c and c++ libraries andutilities like make are of a reasonably recent, bugfree and compatibleversion.

After compilation you can, as a root user, just type:to install the program and manual page to /usr/local. Or just copythe files picprog and picprog.1 manually.

Make sure that you have access to the serial port device like /dev/ttyS0or /dev/ttyS1 with the user that you are running the program as.

Tait serial programmer interview

Windows/Cygwin

The Linux emulator for Windows, Cygwin, allows Picprog to becompiled on Windows plattforms.

To install Cygwin, go to www.cygwin.com and follow theinstructions there. In short, download setup.exe and run it. Youneed to install at least the Developer packages Gcc C compiler, GccC++ compiler, Make, and Binutils in addition to the default install.

To install Picprog on Cygwin, follow the above instructions for Linuxcompilation from source.

Windows 2000 and XP installations that I have tried work fine. Windows 98installations worked sometimes, and I suppose the timing routines ofPicprog do not work well on Windows 98, they even lock the computersometimes. I suggest using Windows 2000 or later.

If you are using USB serial adapters, they show up as /dev/ttyS13 orhigher numbers. Try different numbers if that does not work.

5. Usage

To get information about the usage of the program, just type theprogram name. These options give information about the program:
--warranty, --copyright, --help
Display warranty or copyright information or the help textwith list of supported chip types.
--quiet, -q
Do not display the copyright notice.
The actual operation of the program is controlled by the options--input-hexfile and --output-hexfile. Ifthe former is present, the program acts as a burner. If thelatter is specified, the program will read the contents of the PICdevice eeprom memories. Both may be specified on the same commandline, in which case the chip is first programmed and then read.

6. Burning PICs

Simple instructions:
  1. Compile your program into a hex file.
  2. Insert the pic16c84 or other pic chip into the socket in theprogrammer, or connect the in-circuit programming cable to yourdevice.
  3. Connect the programmer device to a serial port.
  4. If the device contains calibration information, like OSCCAL wordin program memory or BG bits in configuration word in PIC12F675, it isa good idea to save these for later if this is the first time youprogram the chip. See next chapter for more onreading chip, but this should be enough for saving the calibration:
  5. Burn the program with command:
  6. If the above command produces error output that suggests that thechip was in the code protection state, or that the chip must becompletely erased before programming, retry with the followingcommand:
  7. Wait for the program to complete. Burning 8192 program locationson 14 bit devices may take 3 minutes. I know better programmingalgorithms would speed this up significantly, but I have not had timeto fix that. PIC18 family programming algorithm is significantlyfaster.
The burning options are:
--erase
To be able to reprogram a PIC device that has previously beenprogrammed into Code Protection state (for example in pic16c84 ControlWord fuse bit 0x10 cleared), it is necessary to bulk erase the chip.Also some PIC devices do not automatically erase each location as theyare programmed, and these devices must always be bulk erased first.It is done by adding this option to the command line. The default isnot to bulk erase the chip.
--burn
Actually program the device. Without this option only the syntaxof input files and command line options is checked.
--input-hexfilepath, -ipath
Specifies the input hex file. The file can be either in IHX32,IHX16, or IHX8M formats, the format is automatically recognized.
--cc-hexfilepath, -cpath
Only necessary for debugging. Outputs the same data as was readfrom the input hex file.
--force-calibration
Force reprogramming the OSCCAL word and BG bits in control word.Default is to read the calibration values off the chip before erasingand preserving their values. Use this option if you have accidentallyerased the values on chip, and you reprogram them from your saved copywhich was read off the chip before the values were lost there. Ingeneral it is a really good idea to first read the empty chip and savethe file somewhere if the calibration data gets lost later, either byaccident or because of some bug in Picprog.
--pic-serial-portdevice, -pdevice
The device name of the serial port the programmer is connectedto. Default is /dev/ttyS0.Environment variable PIC_PORT can be also used to specifythe serial port. Use /dev/ttyUSB0 in Linux or/dev/ttyS13 in Windows/Cygwin for USB serial adapters.
--devicechipname, -dchipname
The chip type. Environment variable PIC_DEVICEcan also be used to specify device. Currently supported by code are:
auto, pic16c84, pic16cr83, pic16cr84, pic16f83, pic16f84, pic16f84a*,pic16f87*, pic16f88*, pic16c61, pic16c62, pic16c62a, pic16c62b,pic16c63, pic16c63a, pic16c64, pic16c64a, pic16c65, pic16c65a,pic16c65b, pic16c66, pic16c66a, pic16c67, pic16cr62, pic16cr63,pic16cr64, pic16cr65, pic16c620, pic16c620a, pic16cr620a, pic16c621,pic16c621a, pic16c622, pic16c622a, pic16f627*, pic16f627a*,pic16f628*, pic16f628a*, pic16f648a*, pic16f883*, pic16f884*,pic16f886*, pic16f887*, pic16ce623, pic16ce624, pic16ce625, pic16c641,pic16c642, pic16c661, pic16c662, pic16c71, pic16c710, pic16c711,pic16c712, pic16c715, pic16c716, pic16c717, pic16c72, pic16c72a,pic16cr72, pic16c73, pic16c73a, pic16c73b, pic16c74, pic16c74a,pic16c74b, pic16c76, pic16c77, pic16f72*, pic16f73*, pic16f74*,pic16f76*, pic16f77*, pic16c432, pic16c433, pic16c781, pic16c782,pic16c745, pic16c765, pic16c770, pic16c771, pic16c773, pic16c774,pic16f870*, pic16f871*, pic16f872*, pic16f873*, pic16f873a*,pic16f874*, pic16f874a*, pic16f876*, pic16f876a*, pic16f877*,pic16f877a*, pic16f818*, pic16f819*, pic16c923, pic16c924, pic16f630*,pic16f676*, pic12f629*, pic12f675*, pic12f635*, pic12f683*,pic16f631*, pic16f636*, pic16f639*, pic16f677*, pic16f684*,pic16f685*, pic16f687*, pic16f688*, pic16f689*, pic16f690*,pic18f242*, pic18f248*, pic18f252*, pic18f258*, pic18f442*,pic18f448*, pic18f452*, pic18f458*, pic18f1220*, pic18f2220*,pic18f4220*, pic18f1320*, pic18f2320*, pic18f4320*, pic18f6520*,pic18f6620*, pic18f6720*, pic18f8520*, pic18f8620*, pic18f8720*,pic18f6585*, pic18f8585*, pic18f6680*, pic18f8680*, pic18f6525*,pic18f6621*, pic18f8525*, pic18f8621*, pic18f2439*, pic18f2539*,pic18f4439*, pic18f4539*, pic18f2331*, pic18f2431*, pic18f4331*,pic18f4431*, pic18f2221*, pic18f2321*, pic18f2410*, pic18f2423*,pic18f2420*, pic18f2450*, pic18f2455*, pic18f2458*, pic18f2480*,pic18f2510*, pic18f2515*, pic18f2523*, pic18f2520*, pic18f2525*,pic18f2550*, pic18f2553*, pic18f2580*, pic18f2585*, pic18f2610*,pic18f2620*, pic18f2680*, pic18f2682*, pic18f2685*, pic18f4221*,pic18f4321*, pic18f4410*, pic18f4423*, pic18f4420*, pic18f4450*,pic18f4455*, pic18f4458*, pic18f4480*, pic18f4510*, pic18f4515*,pic18f4523*, pic18f4520*, pic18f4525*, pic18f4550*, pic18f4553*,pic18f4580*, pic18f4585*, pic18f4610*, pic18f4620*, pic18f4680*,pic18f4682*, and pic18f4685*.
The devices marked with a star (*) can be autodetected, so they neednot to be specified. If code protection is active on the chip,autodetection may not work.

I do not know if all the chips work or if any other than pic16c84,pic12f675, pic16f676, pic16f76, pic16f88, pic16f876a, pic16f628,pic18f1320, and pic18f458 work, these I have tested myself. Defaultis to autodetect the device by reading configuration memory location0x2006. If no device id is present, the default ispic16c84. If reading location 0x2006 with 14 bitprogramming algorithm fails, the PIC18 programming algorithm is usedto read configuration memory locations 0x3ffffe and 0x3fffff. To adda new supported chip type, just edit the table in filehexfile.cc.

The hex file addresses (in IHX16 format) used are the ones specifiedby Microchip. This example is for pic16f628:
0x0000-0x07FF
Program memory, 2048 words * 14 bits.
0x2000-0x2003
ID locations.
0x2006
Device id (not present on older chips), not present in hex file
0x2007
Control word fuses
0x2100-0x217F
Data memory, 128 bytes * 8 bits.
The addresses in IHX32 and IHX8M files are not word addresses but byteaddresses. Divide those addresses by 2 and you get the same addressesas in the example above.

This example is for pic18f1320. These addresses are byte addresses.IHX32 is the only option for saving PIC18 family programs in hexfiles.

0x000000-0x001fff
Program memory, 8192 bytes of 8 bits, or 4096 words of 16 bits.
0x200000-0x200007
ID locations.
0x3ffffe-0x3fffff
Device id, not present in hex file
0x300000-0x30000d
Control word fuses
0xf00000-0xf000ff
Data memory, 256 bytes * 8 bits.

Before interfacing with the PIC chip, Picprog calibrates its delayloops by checking the clock speed of the CPU and whether the CPUsupports the TSC feature. On Linux, /proc/cpuinfo is read. OnWindows/Cygwin, /proc/cpuinfo is read and CPU clock frequency isestimated. Therefore the clock frequency displayed on Windows is notnecessarily exactly the true clock frequency.

Long cables, different values on capacitors and resistors, anddifferences on sertial ports can cause very long signal rise and falltimes. The JDM device is sensitive to that, and mostly is designed tobe connected directly to computer or with very short cable. Thesensitivity also depends on the PIC chip type. It may help to stretchthe delays in Picprog to allow for longer signal settling times.Larger delays are needed also for the uJDMprogrammer device. A couple of options are available. They canbe tried individually and together:

--rdtsc
Uses the CPU's TSC capability, cycle counter, to measure time delays.This is the most accurate way of measuring time, and gives you thefastest programming. If you are running as root, interrupts aredisabled during the time the clock pulse is down, and this may help ifthe chip looses power during too long delays. However, this optionmay not work with all CPU's, laptops, and other variable clock ratecomputers.
--nordtsc
Ignores the CPU's TSC capability. Try this if the programmer does notwork. This is the default setting now. It is a bit slower than--rdtsc, but works more reliably on some computers.
--slow
Slow down the bit transmit delay loops to 10 microseconds. Try thisif the programmer does not work without it.
--reboot
Before programming, try to switch of the microcontroller power. Thisworks mainly on JDM type programmers, and may help on some chips withinternal clock generator that otherwise would continue running theprogram.
--k8048
Invert the signals on the serial port to and from the programmerhardware. This is necessary for Velleman K8048 device.
--jdm
JDM style signaling on serial port. This is the default.

Old patches to solve the timing problem were made available by Werner Almesberger:picprog-1.7-werner-almesberger.diff,and by Matthijs Kooijman:picprog-slow-test.diff.

7. Reading PICs

Simple instructions:
  1. Insert the PIC chip into the socket in theprogrammer, or connect the in-circuit programming cable to yourdevice.
  2. Connect the programmer device to a serial port.
  3. Read the device with command:
The reading options are:
--output-hexfilepath, -opath
Specifies the output hex file. The file will be written in IHX16format, unless otherwise specified by the --ihx8m or--ihx32 options. For PIC18 family devices, file willbe written in IHX32 format.
--skip-ones
When reading the PIC device, do not consider the all-ones memorylocations to be programmed, and skip them in the hex file output. For14 bit devices, this skips the program memory locations that have hexvalue 0x3FFF, and for PIC18 family devices, this skips byte values0xFF. In data memory locations that have hex value 0xFF are skipped.
--ihx32, --ihx16, --ihx8m
Select the output hex file format to be either ihx16 or ihx8m,respectively. The default is ihx32 for PIC18 family devices and ihx16for others.
--pic-serial-portdevice, -pdevice
The device name of the serial port the programmer is connectedto. Default is /dev/ttyS0.

8. Exit values

Exit values are as defined in <sysexits.h>:
EX_OK, 0
no error
EX_USAGE, 64
command line option syntax error
EX_IOERR, 74
file or serial port io error, or after-programming verification failed
EX_DATAERR, 65
input file syntax error, not in IHX8M, IHX16, or IHX32 format
EX_NOINPUT, 66
unable to find input file or file open failed
EX_UNAVAILABLE, 69
user or signal interrupted programming
EX_PROTOCOL, 76
the device is unknown to the programmer

9. Internals

Source files and their contents:
picport.cc, .h
class picport: manipulates the serial port hardware. With thisclass you can execute programming commands like read a word, program aword, increment address etc. Look at picport.h for details.
hexfile.cc, .h
class hexfile: contains a PIC memory image. You can load andsave the contents of this class to a file, and you can program andread it from the PIC chip. Programming uses class picport.
program.cc, h
class program: just some generic option handling.
main.cc
Just the main () to parse command line and call class hexfile todo its job.

10. Changes

This document has not changed much since it was first released withthe 1.0 programmer. The changes include some information about newsoftware and more accurate links to PIC information. New optionsto select type of device other than pic18c84 are also present.

2003-08-10 version 1.2
With help from Taneli Kalvas changed the schemantics diagram and pcbmask to ground the RB4 pin, selecting high voltage programming on forexample pic16f628.
Implemented preservation of OSCCAL and other calibration data.
Added automatic detection of devices based on location 0x2006.
Merged Bart Goossens's changes to implement PIC16F73. I hope it works.

2003-08-21 version 1.3
Autodetect more chips. Fix programming of chips with OSCCAL. Fixerasing some chips - erasing and resetting code protection is nowperformed the hard way: all methods are tried regardless of chip type.--erase now works also without--input-hexfile flag.

2004-01-02 version 1.4
Add option --force-calibration to program OSCCAL and BGbits. Implement programming algorithms for 16f87/16f88 and 16f87Xa.Revise some timings on programmer reset to avoid operating voltage todip. More verbose output on how many locations actually were burned.

2004-03-02 version 1.5
Fix PIC16F87xA configuration word burning. Remove the 10k resistoradded by me from the PCB and schema. Add support for PIC18 family.Make the DTR be held low as long as possible. This may improve thereliability and limit stress on RS-232 port.

2004-03-19 version 1.6
Now compiles on Windows with Cygwin DLL version 1.5.8 and later. Moreaccurate timings result in shorter programming times compared toprevious versions. These timings use the CPU RDTSC instruction on x86and AMD64 plattforms. PIC16F87/88 second configuration wordprogramming implemented.

2004-04-28 version 1.7
Fixed 16c OTP and UV erased parts EPROM programming to use 100µsprogramming/overprogramming pulses. Use real time priorities andnanosleep() for delays if run under root priviledges. Relax timingsso that they work out of the box with longer cables. Fixed PIC12F629/ PIC12F675 / PIC16F627a / PIC16F628a / PIC16F648a / PIC16F630 /PIC16F676 programming with >1.3GHz i386 CPU.

2006-03-05 version 1.8
Mafia 1 patch download. Experimental dsPIC support, never tested, just compiled. Disabled thereal time priorities, the nanosleep function does not work any more inLinux 2.6 kernels as it used to. Exit value 76 added to indicateunsupported chip id. Added more PIC18F models, thanks to Jan Wagemakers from Belgium.

2006-03-26 version 1.8.1
Fix a mistake with 18f[24]5[128]5 and 18f[24]6[128]0. Thanks toJan Wagemakers for the fix.

2006-09-28 version 1.8.3
Added --rdtsc, --nordtsc and --slow options. They may help withlaptops and new faster models of CPUs. Made --nordtsc the default.This was originally release 1.8.2 that did not have that default.

2008-06-05 version 1.9.0
New chips defined, including 12 bit parts, thanks to Renato Caldas,Kevin Buettner, Alexander Zangerl and Jan Wagemakers. Chip presenceis no more detected with start/stop bit checking, as some chips do notclear them (see Debian bug #412778). Microcontroller is now poweredoff before any operations with --reboot option, thank youfor the idea to Mauro Giachero. Some code changes remove duplicateport initialization. Timings have been changed completely, hopefullythis fixes the erratic behaviour with some chips. Thank you fortesting and ideas to Mauro Giachero and Jan Wagemakers. Addedenvironment variables PIC_PORT andPIC_DEVICE, thanks to monttyle. Added --k8048 option forVelleman K8048 with reversed signals, thanks to Bob Dunlop and NeilTurton.

2010-04-14 version 1.9.1
Fixed a bug that prevented erasing chip with OSCCAL words. Thank youfor Eckhard Neber for finding this. Read also short hexfile datalines, thanks to Jacques Klei, Salie Adams, Redzinalds Knipsis andJani Turkia for pointing this out. Charge capacitors a little longer,suggested by Bernard Hatt. Added some NOP commands to PIC18Fprogramming sequence, suggested by Marco Mattila. Fixed warnings withcurrent compilers. Changed license to GPL3. Thanks to Mario CastelánCastro for reminding about that.

11. Other available programmers

PiKdev
PiKdev is a simple graphic IDE for the development of PIC-basedapplications. PiKdev is developed in C++ under Linux and is based onthe KDE environment. It includes a programming engine which allowsprogramming various flavors of PIC microcontrollers via classic (ie:D. Tait or JDM compatible) programming hardware connected to theparallel port or to the serial port.
PP06
Linux and Windows programming software that knows about 83 pic'sand 6 programmers.
XWisp
Programmer software written in Python by Wouter van Ooijen.
serp-0.5(serp-0.5.tgz)
Tait serial programmers
A serial port programmer software for Linux, written in c++,author Ralph Metzler. Itdirectly handles the serial hardware, standard 16450/16550 compatibleuarts, and needs root priviledges for that. Unmaintained since 1996.
jdm84v23 (jdm84v23.zip, pgm84v23.zip)
A serial port programmer, schema(gif) and DOS software. The hardware manages with rs-232interfaces with low voltage output, even as low as ±7V is fine.This is the programmer I use with linux with my own software.

I modified the circuit to include connections to pins that areneeded for programming some PIC microcontrollers.

There is a new version of the PCB available on Jens Madsen site. Itsupports more chips without jumper wires: PIC-Programmer 2.

uJDM
A serial port programmer, stripped down version of the JDM device.Works with Picprog but needs option --slow and possibly needs evenmore patching for other added delays. See picprog-1.7-werner-almesberger.difffor some advice.
pip-02/com84 (pip-02.zip)
A serial port programmer, schema (gif)and DOS software. Needs +12V rs-232 positive voltage level.
prog84-3
A parallel and serial port programmer, and software for Linux anddos, written by WimLewis and FrankDamgaard. There is some experimental code for an USB parallelport device.
dvtait84, pic84faq(dvtait84.zip, pic84faq.zip)
A parallel port programmer, schema(ascii) and DOS software with basic and turbo-C sources included.Author DavidTait. He has a lot more stuff, and some new designs to programother PICs in his links page.
mjcox84 (mjcox84.zip)
A parallel port programmer, no schema, written in assembler forDOS with 486/33 timings. Very limited. Author: Mark J Cox, m.j.cox@bradford.ac.uk.
ngoodw84(ngoodw84.zip)
A parallel port programmer and disassembler, no schema, seems touse pins DATA1 = data and DATA2 = clock and needs external programmingvoltage. From Everyday Practical Electronics, February 1996, authorDerren Crome. Disassembler by Nigel Goodwin nigelg@lpilsley.demon.co.uk.
MinimizedPIC16C84 Programmer
Parallel port programmer, DOS software, needs external 13V powersource. Author Stephen M. Nolan.

12. Available languages

Free compilers

GNU PIC Utilities
gputils have assembler, linker, disassembler and library utilitiesmuch like MPASM. They support all PICs.
SDCC - Small Device C Compiler
SDCC is a retargettable, optimizing ANSI - C compiler.
Yappa
A graphical development environment for PIC16F84 by MarkColclough at the University of Birmingham. Yappa combines into asingle application the editor, assembler and programmer interface thatare needed to program a PIC. Picprog is used as the programmerbackend.
picasm112b(picasm112b.tar.gz)
Assembler in ANSI-C by TimoRossi. Outputs both IHX16 and IHX8M. You canalso find disassemblers for 12 bit and 14 bit PIC's on Timo's site.
asm_c84(asm_c84.zip)
Assembler in ANSI-C by James Cleverdon, jamesc@sequent.com. No INCLUDE,no IF, outputs IHX8M. Themanual.
SIL
I have heard of free SIL language (something like Pascal/M2)compiler for PIC.
JAL
Just Another Language, aPascal like high level language. '.. I wanted a HLL which is bettermached to the PIC architecture, to my programming habits, and which Icould explain to the kids of the local electronics club without givinga full course on computer architecture.'

Commercial demos

HI-TECH Software C compiler
A demo is available of their compiler.
elabtronicsCoreChart
CoreChart (formerly named bitset) is an icon-based developmenttool. 30-day trial available.

13. Other software

GPSIM
PIC simulator.

14. History

Picprog was first written and released in May 1997. Around thattime I briefly experimented with microcontrollers. I found no Linuxsoftware for the cheap serial programmer hardware by Jens Madsen, andI wanted to use that one as it was so simple to build. Only later didI learn about serp-0.5. Anyway, that one directly programmed PC styleserial port hardware while I wanted to use standard UNIX methods ofaccessing serial ports. Linux was missing an IOCTL to force BREAKcondition (steady +12V) on the serial data transmit line. This kindof functionality existed for example in Solaris. No problem, Icreated a patch for Linux kernel versions 2.0.30 and 2.1.42, submittedit, and it was included in mainline kernel versions 2.0.32 and2.1.45.

Since the time I first wrote the software I did not work withmicrocontrollers at all for years, though I maintained Picprog byfixing obvious compilation problems and updating documentation.Version 1.0.1 was put together in May 2001 and included mainlydocumentation fixes. In June 1997 I had worked on adding support fordifferent memory sizes of different PIC chips, and these changes andagain documentation updates were released as version 1.1 in February2002. I also found the programmer hardware I thought I lost a fewyears back, and was able test that it still works.

Picprog-1.0 was ported to FreeBSD and included in the distributionaround September 1999. MITMASLab 6.186, a student-run robotics course, seems to have used itsince January 2001. Recently this documentation page has attractedsteadily over 1000 visits per month, so I guess someone is findingit useful.

Nowadays I mostly test Picprog with new chips, and sometimes I start anew project like KanSatsatellite or 8-PINPONG, and never finish them.

15. Copyright notice

This program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.

Tait Serial Programmer Download

You should have received a copy of the GNU General Public Licensealong with this program. If not, seehttp://www.gnu.org/licenses/ .

The author may be contacted at:

Email: Jaakko.Hyvatti@iki.fi
URL: http://www.iki.fi/hyvatti/

Please send any suggestions, bug reports, success stories etc. to theEmail address above. To avoid my spam filters, please put the word'picprog' somewhere on the subject line.

Jaakko Hyvätti/Jaakko.Hyvatti@iki.fi/+358 40 5011222

PIC Programmer Hardware

Overview

PICPgm supports all kind of serial port programmers as well as parallel portprogrammers. Also an USB Programmer using FTDI USB chip is supported.The most popular PIC programmers (e.g. JDM, Tait, Microchip AN589 programmer, ..)are pre-configured and will be automatically detected by the software.In the table below, you will find a list of all natively supported programmers.

Programmer NameConnectionLow-/High-Voltage
PICPgm LVISP (Low-Voltgage, In-System Programmer)LPT (parallel port)Low-Voltage
PICPgm USB ProgrammerUSBLow-Voltage
Microchip AN589 ProgrammerLPT (parallel port)High-Voltage
Tait Classic PIC Programmer - (c) David TaitLPT (parallel port)High-Voltage
JDM ProgrammerCOM (serial port)High-Voltage
Olimex PIC-PG2 ProgrammerCOM (serial port)High-Voltage
Olimex PIC-PG3 ProgrammerLPT (parallel port)High-Voltage
El Cheapo PICmicro ProgrammerLPT (parallel port)High-Voltage
TLVP - Trivial LVP programmerLPT (parallel port)Low-Voltage
EPIC Parallel Port ProgrammerLPT (parallel port)High-Voltage
P16PRO40 PIC-programmerLPT (parallel port)High-Voltage

But this are not all programmers which can be used with PICPgm. As mentionedearlier, it supports nearly all serial and parallel port programmers. This ispossible because PICPgm offers a feature to configure the programmer pins viathe graphical user interface directly by the user.You can find this configuration in the menu bar of PICPgm:Hardware => Hardware Selection/Configuration.

PICPgm LVISP (Low-Voltgage, In-System Programmer)

Description

PICPgm LVISP is a Low-Voltgage, In-System Programmer. It is conneteced to thePC via the parallel port (LPT port).

Note: The +5V supply for the programmer istake from the target board (via +5V pin on the programmer cable), i.e. thetarget board has to be powered to allow programming.

Schematics / Layouts

Download Schematic as PDF: picpgm_lvisp_v1.01.pdf
PIC programmer layout: picpgm_lvisp_v1.01_layout.pdf
PIC programmer assembly plan: picpgm_lvisp_v1.01_asm.pdf

Supported PICs

This programmer supports all PIC microcontrollers which are marked with a 'yes'in the column 'Low-Voltage programmable' in thesupportedPICs table.

PIC circuit for usage with LVISP programmer

To be able to use the LVISP progammer, the following minimum PIC circuit isnecessary on your target board. Please not that the PGM pin of the PIC cannot beused in case Low-Voltage programming is used.This pin must always be tied to GND for proper operation!

Pictures

The Low-Voltage Programmer is very small. It fits into a Sub-D connector box:Here is a picture of the complete Low-Voltage Programmer cable:

PICPgm USB Programmer

Description

The PICPgm USB Programmer is a Low-Voltgage, In-System Programmer.It uses a FT245BL chip from FTDI. This chip provides a Parallel IO port via USB.The PICPgm Software uses the Bit Bang Mode feature of the FT245BL to contol thePIC programming pins.

To use this programmer, you have to install the D2XX driver which is providedby FTDI. It can be downloaded at http://www.ftdichip.com/FTDrivers.htm.

This programmer allows programming of PICs with PCs which have no parallel portor serial port. Unfortunately, due to the limitations of the USB bus, readoperations from the PIC are very slow with this programmer. So I wouldsuggest to use this programmer only to program a bootloader into the PIC.Further programming can be done after that via the bootloader which might bemuch faster.

Schematics / Layouts

Download as PDF: picpgm_usb_v1.0.pdf

Supported PICs

Tait Serial Programmer Interview

This programmer supports all PIC microcontrollers which are marked with a 'yes'in the column 'Low-Voltage programmable' in thesupportedPICs table.

Pictures

Microchip AN589 Programmer

Description

The Microchip AN589 Programmer is a High-Voltage Programmer. It is connectedto the PC via the parallel port (LPT port).This programmer has been designed by Microchip as a low cost programmer for thePIC16C84. Nevertheless, it also supports all PICs which can be programmed inHigh-Voltage mode. All details regarding this programmer can be found inApplication Note AN589 from Microchip.

Schematics / Layouts

Schematic and furhter information:http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011060

Note: If link is not working, just google for 'AN589'.

Supported PICs

This programmer supports all PICs which can be programmed in High-Voltage mode.For a list of all PICs supported by PICPgm Software can be foundhere.

Tait Classic PIC Programmer - (c) David Tait

Description

The Tait Classic PIC Programmer was designed by David Tait. It is a High-VoltageProgrammer which is connected to the PC via the parallel port (LPT port).

Schematics / Layouts

Supported PICs

This programmer supports all PICs which can be programmed in High-Voltage mode.For a list of all PICs supported by PICPgm Software can be foundhere.

JDM Programmer

Description

The JDM Programmer is a High-Voltage Programmer which is connected to the serialport (COM port) of the PC. It takes the programming voltage directly from thePC's COM port, so no separate power supply is needed.Due to the reason that the power supply is taken from the COM-port, for 'weak'COM ports (especially in Notebooks) this could be a problem. So in this case theCOM port could not provide a sufficent programming voltage and programming willfail.

Please note that this programmer will not work with a USB-to-Serial adapter.

Schematics / Layouts

Supported PICs

This programmer supports all PICs which can be programmed in High-Voltage mode.For a list of all PICs supported by PICPgm Software can be foundhere.

Note: To allow programming of PIC 12F629 / 12F675 / .. it is necessary tomodify the original JDM programmer as shown in the schematic above. Thismodification allows VCC control which is necessary for this PICs.

Olimex PIC-PG2 Programmer

Description

PIC-PG2 is programmer based on JDM design which takes all necessary signalsand power supply from RS232 serial port. It supports 8, 18, 28 and 40 pinPIC microcontrollers.

You can get a fully assembled and tested PIC-PG3 programmer athttp://www.olimex.com.

Schematics / Layouts

Schmatics and further details can be found athttp://www.olimex.com/dev/pic-pg2.html.

Supported PICs

This programmer supports all PICs which can be programmed in High-Voltage mode.For a list of all PICs supported by PICPgm Software can be foundhere.

Note: PICs which need VCC contol (like 12F629 / 12F675 / ..) might not workwith this programmer. Read more regarding this problem at theJDM Programmer.

Tait Serial Programmers

Pictures

Olimex PIC-PG3 Programmer

Description

PIC-PG3 is programmer based on D.Tait's parallel port design. To operateit needs external power supply 12-15VAC or 16-18VDC. It supports all8/18/28 and 40 pin PIC microcontrollers which allow serial programming.PIC-PG3 have connector and cable for ICSP programming and can be used toprogram all PIC-PxxB prototype boards.

You can get a fully assembled and tested PIC-PG3 programmer athttp://www.olimex.com.

Important note:
For this programmer the programmer autodetection feature has to bedeactivated (Menu: Hardware - Hardware Selection/Configuration..) by directlyselecting the Olimex PIC-PG3 programmer.Reason for this is that this programmer has overlapping MCLR pins depending on theIC sockets which could cause Vpp on a PIC port pin different than MCLR pin.Due to that also the corresponding Olimex PIC-PG3 programmer type has to be selected.I.e. if you want to program a 8, 14 or 18 pin PIC, you have to select the'Olimex PIC-PG3 (8pin, 14pin, 18pin)' programmer. To program a 28 or 40 pin PICyou have to select 'Olimex PIC-PG3 (28pin, 40pin)'.

Schematics / Layouts

Pictures, Further Notes

To program a 8, 14 or 18 pin PIC, you have to select the'Olimex PIC-PG3 (8pin, 14pin, 18pin)' programmer in the Hardware settings.

Tait Serial Programmer Salary

To program a 28 or 40 pin PIC, you have to select the'Olimex PIC-PG3 (28pin, 40pin)' programmer in the Hardware settings.

El Cheapo PICmicro Programmer

Description

Get info regarding this programmer athttp://www.rentron.com/Myke4.htm.

Schematics / Layouts

TLVP - Trivial LVP programmer

Description

Get info regarding this programmer athttp://www.finitesite.com/d3jsys/.

Schematics / Layouts

EPIC Parallel Port Programmer

Description

No descrition yet.

Schematics / Layouts

No schematic yet.

P16PRO40 PIC-programmer

Description

Get info regarding this programmer athttp://www.oz1bxm.dk/PIC/P16PRO40.htm

Schematics / Layouts

Other PIC-programmers

  • 5PIP programmer, a simple serial port programmer with only 5 components (3 resistors and 2 diods):http://www.franksteinberg.de/5PiP.htm.