Universal OS PIC Programmer
This programmer requires only a basic terminal program capable of uploading an ascii PIC HEX file. It does not matter what operating system or computer (MAC, Win98, XP, Vista, DOS, Linux, etc.) is used to talk to it.
All of the software necessary for programming is in the unit's own PIC (16F628) which incorporates a set of programming algorithms for several PIC versions along with some I2C eeproms.
Note: Microchip seems to be 'recycling' its programming algorythms at this time, so this unit is likely to program any new PICs as they are released.
Just connect to it with a
terminal program and away you go...
Here are the commands that are presently available. They will be discussed below. Some commands used in developing it have been left in for experimental purposes.
Here is a list of the PIC's that have been verified to work with each algorithm. Other PIC's may also work if they share the same programming specs.
This unit is designed to do In Circuit Serial Programming (ISP). It can either source power or borrow power from the target device. In either case, it generates its own 12 volt programming voltage from the 5 volt source.
to the computer serial port is made via RJ11 (phone) connector and a DB-9
to RJ11 adapter. Unlike a lot of 'serial' programmers, this design actually
uses serial data to communicate to the PC. This makes it usable even at
very long distances. Connection to the target device is via a 5-pin connector
(lower left corner) and an assortment of adapters.
The adapter that connects the computers standard DB9 serial cable to the RJ11 phone jack is wired as follows...
DB9-5 ---> RJ11-1 DB9-3 ---> RJ11-2 DB9-2 ---> RB11-3
LED's indicate: programmer power, target power, target run,
and 12 volt VPP.
Here are the files needed to construct
one of these including the board layout for a single sided board. You
could also wirewrap or make your own board design using the same circuit
Schematic - for programming hardware
Set up your terminal program to full duplex,19200 baud, no parity, one stop bit with no hardware or software handshaking.
If you need a good terminal program for Windows, try Term232 (its free).
Once you are connected and power up the unit, you should see something like this:
Vers=3.3 Alg=6/20-5 UPP>
This is the command prompt where you enter instructions.
It shows that we are running version 3.3 with programming algorithm 6,
end of line delay of 20 milliseconds, and inter-character delay of 5 milliseconds.
Before doing any programming, the algorithm for the specific PIC must be selected with the 'A' command. For example...
UPP>A3 Vers=3.3 Alg=3/20-5 UPP>
If your terminal program needs more time to scroll between lines (loses characters at the start of each line), use the '/'' parameter to increase the delay sent after each line. Values are from 1 (lowest) to 255 highest.
UPP>/25 Vers=3.3 Alg=3/25-5 UPP>
If your computer misses characters, try increasing
the intercharacter delay.
UPP>-10 Vers=3.3 Alg=3/25-10 UPP>
To begin programmimg, use the 'L' command...
UPP>L PROG LOAD!
Next tell your terminal program to send the HEX file that you have already assembled. This is the file that virtually every PIC assembler produces. You will see the word LOAD replaced with the current programming address. It then reads back the PIC and shows either OK or ERROR.
This unit processes one line at a time from the Hex file. After receiving a complete line, it programs those locations. This needs some time depending on the specific programming sequence for that PIC. You need to give it time to do the programming, therefore...
In order to have this all work, you need to set up your terminal program to do one of two things:
1. Either wait for the '!' before sending each line.
2. Wait 10 to 100 milliseconds before sending each line.
Many other PIC's should work with this system. Just try the algorithm that looks most like the one for one of the versions above. You need to check the Microchip programming specification sheet for this. Or, just try them one at a time to see which one works.
If you want to read the data from an already programmed PIC, you need the 'U' command. This command needs to know how many bytes to send. It then automatically appends the CONFIG information and the end of file line. Your terminal program needs to have a capture feature to save this information. Then, just load it in any text editor to remove any stray typed characters that wound up in the file.
You can also use the 'D' command for a normal hex/ascii dump. This is also a good way to see if you have the PIC connected properly to the programmer hardware. An erased PIC has all locations as 3FFF; a programmed one will show other data. The Dump function always starts at location zero in the PIC, it runs until you hit any key.
The 'R' command puts the target PIC in the run mode. You use the 'S' command to stop it.
Certain commands used in developing this device have been left in. You may find them useful in working with new version of PICs. With them, you can create the basic commands used to read and write data directly to the chip. Here is an example.
This will write the data 1234 to the third program location in a PIC16F84 then read out data at the fourth location.
P turns on program power to the MCLR line and powers up the VCC line. .6 sends an increment command .6 sends an increment command .2 sends load data command ,1234 sends hex data 1234 .8 sends the program command ;A waits 10 milliseconds .6 send an increment command = read and print program word S turn prog and power off
You will need access to an existing programmer to make one of these units. After that, you can make more for yourself on any operating system that you are set up on.