Multichip programming and Disassembling a .hex File
For the sake of providing the best information for viewers to fulfill their projects, Chip Works technology may list here services information which are provided by other firms, Chip Works neither recommend nor endorse these services, hence we would take no responsibilities from these services.
NOW WITH ISP FEATURE
IC-Prog 106B & Help file - mentioned in this article is an old "burning" program.
Latest burning program: "WinPIC.exe" or "WinPIC.zip"
This programmer uses the 9-pin serial port (also called
the COM port or RS 232 port), found on desk-top computers.
For lap top computers, use a USB programmer: PICkit-2 from: Modtronix
(no kits for PICkit-2 programmer - only fully-built version)
You will also need MPASM and ".inc files"
Set-up a folder called PICkit-2 in which you will place the
programs for all your projects.
Within the folder you can place MPASM and ".inc files" and PICkit-2
burning routine (from the CD that comes with PICkit-2).
If you are not using PICkit-2, call the folder All Files
and place "WinPIC.exe" or "WinPIC.zip" in the folder,
as well as MPASM and ".inc files."
You will need NotePad2.exe or NotePad2.zip so you can take a .asm file from one of
the projects we have produced and use it to write your own program.
Note 1: MPASM and WinPIC have been used to program PIC16F628A
using 8-pin to 5-pin adapter described below. The chip was programmed
successfully but WinPIC displayed "Programming failed and only the
first line of code was displayed in green. WinPIC does not read the
chip properly after burning.
Note 2: I have not successfully programmed a PIC10F220 via WinPIC
or PICkit-2. I do not suggest you buy a PIC10Fxxx until I have successfully
The Multi-Chip Programmer can now program Surface Mount chips and
PIC10F220 chips via "WinPIC.exe" or "WinPIC.zip" and the following
You will have to connect the 5 tinned-copper wires to the 8-pin socket
and 5-pin header, (called a "Machine Pin" strip or "header" similar to 5 pins
from a 24 "machine pin" IC socket).
The adapter connects between the Multi Chip Programmer and
any of our projects that have the 5 "In-Circuit Programming" pins:
Connecting the Multi Chip Programmer to ICP
(In-Circuit Programming pins)
Note: IC PROG has now been
updated to WinPIC:
|In a nutshell, here is what you do:
1. Read the 3 pages of the Multi-Chip Programmer project. It
needs a program called IC-Prog to carry out the burning operation.
2. Buy and build the Multi-Chip Programmer project.
3. Get IC-Prog.exe file and move it to your Desktop.
(download IC-Prog.zip) Latest IC-Prog 106B Help file
4. Program a PIC chip, using the IC-Prog software. Connect the Multi-Chip Programmer to com1 and everything is ready to program a chip. You will need a .hex file.
6. For a list of .hex files click: 5x7 .hex files.
|5. Read the notes on Step 3 by Jason Williams, on configuring your computer to run the software.
These files are for the 5x7 Display project - but you can use any file.
If you want to convert a .hex file into readable lines of code, step 4 has a disassembly program Disasm.
This project is designed to program the 8-pin PIC12c508A and 18pin PIC16F84 microcontroller chips to support the projects we have designed, however it will also program a number of other 8-pin & 18-pin microcontrollers and the full list can be seen when using IC-Prog.
We could have called this project a "free programmer" to attract your attention, but let's be fair, at the cost of a few dollars for the PC board plus a few on-board components and a lead, you can call it a very low-cost programmer. With free software the project will not only be the cheapest on the market, but it comes with full documentation to get the absolute beginner into programming.
Why put it on the web?
The web is expanding at a phenomenal rate. By putting our projects on the web, we are delivering them to the whole world. We have priced each kit to be less than buying the components separately. Once you work-out the cost of producing the board yourself and buying the parts from different suppliers, you will agree; it's cheaper to send for a kit. We send everything out the same day and no matter where you live in the world, air-mail delivery is only a long-distance flight away. Buying is so simple. Simply send us an email to say you want to buy a particular kit (we have over 200 kits) and we will email you with the total cost including postage.
THE MULTI CHIP PROGRAMMER
This is a very simple project. It is a Multi-Chip Programmer that will burn a wide range of PIC chips.
The PIC Programming Course has concentrated on the PIC12c508A and PIC16F84 chips as these cover the "beginners" end of the market.
The advantages of these chips has been fully documented in our articles and now we come to the need to burn them.
Programming or Burning these chips is very simple and any project you design can include a 4-pin socket so that the chip can be programmed "on-the-board." The 5x7 Display project is a typical example. It has a "burning socket" on-board for a PIC16F84 chip. The only thing you have to remember when designing a project, is to keep pins 12 and 13 lightly-loaded so they can be used for the programming operation. If these lines are used as outputs, the programming operation must be able to take them HIGH and LOW. Refer to the 5x7 Display project to see how we have designed the programmer section.
The '508A has not been catered for in the 5x7 Display project and so you need the Multi-Chip Programmer to burn this chip and any others you want to program.
HOW THE CIRCUIT WORKS
The first thing you have to remember . . . . this is not a normal circuit. A normal circuit has a positive voltage connected to it and thus it has a supply rail and a ground rail - the ground rail is called the zero volt rail.
In the Multi-Chip Programmer circuit, the supply voltage for the chip comes from the RS-232 feature of the serial port. Some of the lines making up the RS-232 are capable of rising to a positive voltage (about 8 to 12v) and falling to a negative voltage (about -8v to -12v). There are also lines that fluctuate from 0v to +5v . If all computers had a line that fluctuated between +12v and -12v, the programmer circuit would be very simple. But unfortunately some computers fluctuate between +8v and -8v. To make a circuit that works on all ports was a challenge. The circuit we have used was designed by JDM (http://www.jdm.homepage.dk/) and full credit is given to him.
The chip requires a voltage of 13v on the MCLR pin (between12v and 14v) to tell the chip to go into program mode. The chip does not require any current on this line, just a voltage so the program mode can be invoked (begin).
If one of the lines from the computer goes to +8v, and another goes to -8v, they can be combined together to get a total of about 16v. This is more than enough to create the necessary 13v.
This is the basis of how the circuit works and the reason for the diodes and zeners.
But it's more complicated than that. The voltage-delivering lines are also the lines that provide the signals to and from the chip during programming and reading modes. So, the circuit becomes quite complex. The lines delivering the signals are also the lines that charge the electro's.
To understand how it works, we need to cover some basic theory.
If a line starts at 0v and moves negative to say -5v, it will charge an electrolytic and the electrolytic will have 5v across it.
The circuit in Fig: 1 shows this:
The next new point is how to use a transistor in a completely different mode to that covered in our Basic Electronics Course.
Normally, a transistor in emitter-follower mode is connected with the collector to the supply rail and the base is raised and lowered from 0v to supply voltage. The voltage on the emitter is 0.7v lower than the base, but it has a higher current capability than that delivered by the base. It's quite simple, the current comes from the collector!
The normal emitter-follower circuit is shown in Fig: 2. (Also called common collector)
But, suppose the transistor is connected with a LED on the emitter AND collector as shown in Fig: 3. This time, the current for the LED cannot come from the supply rail (via the collector) and thus the base must supply the current. It is easy to see that the lower LED is turned on via the current from the base. But the interesting feature is the LED in the collector circuit will also come on with the same brightness as the LED in the emitter circuit.
The base-collector junction is reverse biased and will perform exactly like the base-emitter junction. The base must supply the current for both LEDs
This is how the first transistor in the circuit is operating. The base is supplying current to charge the 10u electrolytic and the 8v2 zener is allowing the 10u electrolytic to charge to 8.2v higher than the 22u electrolytic and supplying a voltage-reference for the MCLR pin. The 10u electrolytic does not deliver its energy to the MCLR pin, no current flows between the emitter and collector leads of the transistor in this arrangement.
With this basic theory understood, you will be able to see how the Multi Chip Programmer works, but before we get to the full circuit, Fig: 4 shows how the voltages on the chip are developed with reference to the GND line.
Fig: 5 shows how the chip actually "sees" these voltages. You simply add 5v to each of the voltages to make Vss = 0v. This makes Vdd = 5v and the programming voltage = 13v.
Fig: 6 shows the complete circuit diagram: The 2k2 resistor is fitted inside the 9 pin plug. This gives the project 4 communication lines and thus 4-core telephone cable can be used.
The transistor on the Data line also operates in an unusual way. It functions in a bi-directional mode, since the data must be transmitted into the chip when burning and from the chip when reading.
Fig: 7 shows how the transistor is actually in an emitter-follower arrangement with the data line of the chip on the emitter.
When delivering data to the chip, the DTR line goes HIGH and the transistor is in emitter-follower mode. The input of the chip will be high-impedance and the emitter voltage will be HIGH, being pulled up by the 10k resistor and fed by the voltage from the DTR line.
When the DTR line goes LOW, the collector of the transistor will go LOW, because the only voltage supplying the circuit comes from the base. Since the resistance on the base is 10k, and the resistance between collector and ground is 2k2, the voltage division will produce about 1v on the collector. Since the collector voltage goes LOW, the emitter voltage will also go LOW as the transistor is in exactly the same arrangement as shown in fig: 3, above.
Thus, by taking the DTR line HIGH-LOW, the data line of the chip will be taken HIGH-LOW.
When the transistor is being read, the data appears on the Data line. This time the DTR line is kept HIGH and when the data line of the chip goes LOW, current is drawn through the collector lead. This current flows through the 2k2 resistor and produces a voltage drop across it. This voltage drop is enough to bring the collector voltage down to about 1v or less and the CTS line reads this as a LOW.
When the data line of the chip goes HIGH, current does not flow through the 2k2 resistor and CTS reads the line as a HIGH.
There are three more signal diodes in the circuit (the 4th diode has been explained as it charges the 22u when RTS is LOW).
The diode on the MCLR line takes MCLR LOW when TxD goes LOW, while the other diode on this line prevents the voltage on TxD from going below 0v.
The two diodes on the RTS line prevent the line going above 5v or below 0v.
Click on the diagram below to see an animation of the chip being set up for programming and data being clocked in. This is only a simple representation as the chip looks for 6 initial clock cycles and depending on the data it receives during these 6 cycles, the chip will go into one of 9 different modes. For instance, it can go into a mode called Load Configuration where the next 16 clock cycles will load the Configuration Memory with the necessary data bits.
The MCLR line must then be taken LOW and HIGH again and the chip is ready to receive a different loading mode. One of these modes is Load Data for Program Memory and after 6 clock cycles the next set of 16 cycles will consist of a zero start-bit, 14 bits of data and a zero stop bit.
As you can see, it takes a lot of cycles to get each byte of data into the chip, but this is always the case when information is being serial-fed.
Once you know how the circuit works, you will feel much more comfortable about working on it and/or modifying its operation.
At the moment we don't have any access to the software so you will not be in a position to modify the operation of the program. But since it works perfectly, I don't see any need for modification.
All the components fit on the single-sided board and the project is connected via a 4-pin US telephone plug to the serial port of a computer. It gets all its voltages from this port as well as the programming signals.
The diagram below shows the layout of the board. The three jumper links should be fitted first and then the diodes. Make sure you can identify the 4 signal diodes and the 5v1 and 8v2 zeners. The band or "line" on the diodes is the cathode end and this is shown by a line on the overlay. The only other components requiring careful fitting are the LEDs and transistors. Don't fit them too close or leave them too high off the board. A gap of about 3mm to 5mm looks the most professional. Solder them quickly to prevent heat running up the leads and damaging the semiconductor junction. The electrolytics are identified on the body of the component with a black stripe while the positive lead is identified on the board.
No ZIF (zero insertion force) socket is provided in the kit because they are very expensive and not necessary if you put the chip you are programming in an additional socket. This will make the PIC chip easy to fit and remove from any socket and keep costs down.
The cut-out on the end of the socket identifies pin 1 and the diagram below shows how to fit different types of 8-pin chips to the programmer.
The last components are the resistors and socket and the board is ready.
The next thing is the assembly of the serial cable.
THE SERIAL CABLE
The Multi-Chip Programmer is connected to a computer via a serial cable. The components to make this cable are included in the kit.
You have to be careful when soldering the 4 wires to the pins of the 9-pin D-plug to make sure they are soldered to the correct places. It's very easy to make a mistake. A 4-pin US plug (telephone plug) is supplied clamped to the cable and it clicks into the socket on the PC board. Attach it to the board and bare the free end to see how the 4-core cable has been connected. From this information, you should determine how the leads will be connected to the 9-pin plug. Select the appropriate diagram from the layout below and wire the conductors to the plug, including the 2k2 resistor. This should be done neatly as it has to fit inside the backshell. Screw the 9-pin D-plug together and you are ready to program a chip.
9 PIN D-SUB MALE at the Computer.
Data Terminal Ready
Data Set Ready
Request to Send
Clear to Send
Modification: Use 470R in the back-shell of the serial cable.
The circuit contains three indicator LEDs:
The 5v Power LED shows when 5v is present on the circuit.
The 13v Programming LED. At the commencement of the "burning" process, the chip will be put in "Programming Mode" by applying 13v to pin 4.
The Clock LED. During the "burning process" the "Clock LED" will illuminate to show data entering the chip.
(incl: all parts, PCB, cable, and postage)
|2 - 470R 1/4 watt resistors
1 - 4k7 1/4 watt resistor
1 - 10k " "
1 - 10u 16v electrolytic
1 - 22u 16v electrolytic
1 - 3mm Red LED
1 - 3mm Green LED
1 - 3mm Yellow LED
4 - 1N 4148 signal diodes
1 - 5v1 zener 400mW
1 - 8v2 zener 400mW
2 - BC 547 transistors or similar
1 - 18pin IC socket
1 - 30cm fine tinned copper wire
1 - 30cm very fine solder
1 - 4-pin US telephone socket (low profile)
(RJ12 6P4C PCB socket)
1 - Multi-Chip Programmer PC board
1 - 2k2 resistor or 470R
1 - 4-pin US plug on 6ft 4-core cable
( RJ12 6P4C crimp plug)
1 - 9 pin D-type socket
1 - 9 pin backshell
USING THE PROGRAMMER
This is the section you have been waiting for. It's the "burning" section.
Burning is also called "Programming" or "Downloading a Program" It's the action of putting a .hex file into a microcontroller.
The things you need are:
- Multi-Chip Programmer project. See construction HERE.
- an interface cable (the components come with the Multi-Chip Programmer).
- IC-Prog.exe Click HERE. (See below first) (download IC-Prog.zip)
- a computer.
1. Build the Multi-Chip Programmer Project and insert a PIC chip.
2.To program the chip you need a file called:
- IC-Prog.exe Click the link above and put the program in your desktop.
3. You will need a .hex file for the programming operation. It can be a .hex file for the LoPIC Project or the 5x7 Display Project or any other project.
You can find .hex files for the 5x7 Display Project in 5x7hexFiles. Choose any file.
4. Open IC-Prog on your desktop.
6. Click on File (top-left). A window will appear. Click on Load. All the .hex files in PIP-02 folder will appear in the window. Click on a .hex file to highlight it and it will appear in the address bar above. Click on Open and the window will disappear. The .hex file will appear in the programming window.
7. Double-click on Fuse edit. Make sure a dot appears beside RC. Remove the X from Watchdog Timer On. (Make sure a "dot" only appears beside RC and "X" beside Power-up Timer On). Click ok.
The Device window will read: Part: 16F84, Osc: RC, WDT: OFF, PWRT: ON, CP: OFF,
ID: FFFF (not important) CSum: (not important).
8. Make sure the interface cable is connected and the 5v LED is illuminated.
9. Click "F5 Program". A programming bar will appear on the screen and you will be able to see the program firstly turn on the 13v indicator LED then activate the clk LED.
10. At the end of programming the programming window will disappear. If a fault develops during programming a new window will appear, detailing the fault. Otherwise the chip has been programmed and verified and can be removed from the programmer and inserted into the project you are developing.
11. To select another .hex file: File, Load, highlight the file, click on Open, double-click on Fuse edit, remove X from Watchdog Timer On, click ok, click on "F5 Program", and the chip will be programmed.
The Multi-Chip Programmer is capable of burning a number of different types of chips. These come in 8-pin and 18-pin. The 18-pin chips fit into the socket as shown in diagram 1 above, while the 8-pin chips fit into the socket according to the type of chip. For PIC12c5XX chips, pin 1 aligns with pin 1 of the socket. For PIC24cXX chips, pin 1 of the chip aligns with pin 5 of the socket as shown in the third diagram. You will notice the chip is NOT at the end of the socket and you have to be careful when inserting it.
|The following has been provided by a constructor: Jason Williams.
He has built the Multi Chip Programmer and 5x7 Display and has sent the following:
You will need the following files: directio.zip (35KB) loaddrv.zip (28KB)
I have solved the burning bugs (with the Multi-Chip Programmer AND the 5x7 Display) and it appears the problems were to do with running Windows XP and using the "Windows API" option in IC-Prog instead of "Direct IO".
By running a cool utility called "totalio.sys," (in directio.zip) all applications get full control of the I/O ports and thus IC-Prog works perfectly under Windows XP and Windows 2000, since the IC-Prog driver that is available doesn't work for XP (at least it doesn't work for me).
How To Use IC-Prog with Widows XP/NT/2000:
You can download a driver for IC-Prog from their website - it is called "icprog.sys" but it is really just a renamed driver originally called "giveio.sys". This utility was written by Dale Roberts as one of a set of utilities to give applications under NT more control over the I/O ports. Clicking on the "Enable NT/2000/XP Driver" check box in the settings will try to install this "icprog.sys". Under XP (on my box anyway), it installs but can't be started. There is probably some black magic regarding security permissions when creating symbolic links.
The purpose of this driver is to give an application access to the I/O port but only through the driver. This is because XP, like 2000 and NT, doesn't let you have full access to I/O ports like in 95/98/MS-DOS.
However, there is another way. By using another utility written by Dale Roberts, called "totalio.sys", ALL applications can have full control over the I/O ports, and not through a driver's interface. This means you can let IC-Prog use "Direct I/O" instead of "Windows API (in the "Interface" group of hardware settings) and ignore the "Enable NT/2000/XP Driver" option completely. "totalio.sys" (in theory) should also let any programs which control ports directly to work under XP.
Extract "totalio.sys" from the "directio.zip" file to "C:\Windows\system32\drivers" directory (or equivalent).
Extract "loaddrv.exe" from the "loaddrv.zip" file and run it.
In the edit box, type in the full path to "totalio.sys" eg. "C:\windows\system32\drivers\totalio.sys"
The driver should now be running. You can check this by running "Start->Programs->
Accessories->System Tools->System Information", then clicking on the tree item "System Information->Software Environment->Drivers" and looking for "totalio" in the view on the right.
To start or stop the driver after it has been installed, you could use the "loaddrv.exe" program, or use the following commands in a command prompt:
"net start totalio" to start the driver.
"net stop totalio" to stop the driver.
You could put this in a batch file in the IC-Prog directory, eg.
net start totalio
net stop totalio
You can configure the driver to run automatically on startup, but I wouldn't recommend it. You can do this via Device Manager, select "View->Show hidden devices" and look under "Non-Plug and Play Drivers" to find "totalio", look at its properties, and change the startup type from "Demand" to "Automatic" (NOT "Boot" or "System") in the "Driver" tab.
The batch file concept is safest, as you only run the driver when you need to and unload it when you don't need it.
How to configure IC-Prog:
Goto: Settings->Options->Misc. Tab
Uncheck "Enable NT/2000/XP Driver"
Uncheck "Enable Vcc control for JDM" (the help file says it is experimental and not to use it).
Select "Realtime" in the "Process Priority" group. (in theory, this will prevent other CPU-intensive applications from interrupting your burn process).
Select "JDM Programmer" from "Programmer" dropdown list.
Select "Direct I/O" from "Interface" group.
Uncheck all the check boxes under "Communication".
Select correct COM port.
Move the "I/O Delay" slider to 10. (other values gave errors for me, but this value could be specific to the PC's CPU speed - tweak until you get no read/write errors).
Why "Windows API" doesn't work:
My hypothesis is that using the Windows API introduces slight delays in setting the serial control lines, such that occasionally the data pulses aren't co-ordinated with the clock pulses during a burn. Whole 14-bit words don't get written, depending on the circuit the word will be all 0 bits or all 1 bits depending on the state of the chip's data line. In my experience using the Multi-chip programmer, it meant 5% of the words were burned 3FFF, but not consistently, ie. the errors moved around each burn. Read errors were rare (multiple reads returning different data) but they also experienced the occasional incorrect word of 3FFF or just a few bits gone to 1.
These problems all magically disappear once you use "Direct I/O".
UPDATE!!! : Settings for how to use IC-Prog with Windows XP.
Thanks to [Murph] for the explanation:
Open a browser and select the file ic-prog.exe
Press right button on your mouse
Go to Properties
Go to Compatibility menu
Set compatibility mode as Windows 2000 or Windows 98 / Win ME
Press Apply icon
Press Accept icon
You need to copy icprog.sys into the SAME directory as icprog.exe.
Then you can enter in the ic-prog software, go to Settings, Options
and choose the Misc. page. There you can enable the "NT/2000 Driver"
it will then be installed.
Settings to use IC-Prog with Windows XP:
- Open a browser and select the file ic-prog.exe
- Press right button on your mouse
- Go to Propertties
- Go to Compatibility menu
- Set compatibilty mode as Windows 2000 or Windows 98 / Win ME
- Press Apply icon
- Press Accept icon
You need to copy icprog.sys into the SAME directory as icprog.exe. Then you can enter in the ic-prog software, go to Settings, Options and choose the Misc. page. There you can enable the "NT/2000 Driver" it will then be installed.
Latest PC board v628
The latest version of the Multi Chip Programmer (v628) will now program a PIC16F628 via "normal" mode (12-14v on pin 4).
To convert previous versions of Multi-Chip Programmer PCB's:
Cut the track connecting pin 10 to 5v rail.
Fit a 10k resistor between pin 10 and 0v rail. (see the layout below)
When a chip is to be programmed for the first time, either the low voltage or high voltage method can be used.
When a PIC16F628 is programmed in the "high voltage" mode, the chip can be re-programmed in the high-voltage mode or you can set the LVP bit to "0" so that the chip can be re-programmed "in-circuit" via the LVP mode. The Low Voltage Programming-mode allows the chip to be re-programmed by applying 5v on pin 10 (instead of 12-14v on pin 4).
The Multi Chip Programmer "burns" a PIC16F628 in the "high voltage" ONLY. You can re-burn the chip "in-circuit" or in the Multi Chip Programmer, depending on the setting of LVP. The chip comes with LVP set to "1." See below for details on this. When burning a chip for the first time, an instruction in your program sets LVP to "0" or "1." If it is set to "1" you can use either re-programming method, but you lose RB4 as an in-out pin.
PROGRAMMING THE PIC16F628
This chip has two programming modes:
Normal Mode: 12-14v on Pin 4
Low Voltage Mode: (LVP) 5v on pin 10.
The PIC16F628 has a Low Voltage Programming-mode (LVP) for in-circuit programming. In this mode, the chip can be programmed with 5v on the programming pin (pin 10) instead of 12-14v on Pin 4.
Before deciding on the way you will program the chip, you need to know some of the differences and limitations.
The PIC16F628 chip is supplied with the LVP bit as "1."
When the LVP bit is "1," RB4/PGM (pin 10) is dedicated to the programming function and is not available as in-out pin RB4.
The chip will enter programming mode when a HIGH (5v) is placed on RB4/PGM (pin 10).
This makes the chip "in-circuit" programmable and re-programmable "in-circuit."
If you don't want the "in-circuit programmable" feature, LVP bit must be "0." To make LVP bit "0," the chip must be programmed via "Normal Mode," using 12-14v on Pin 4. The LVP bit cannot be changed when programming "in-circuit."
When programming via "Normal Mode," an instruction is available to change the value of LVP. This instruction is covered in our PIC Programming course, Page 33.
If you program via the "Normal Mode" (12 - 14v to "activate" the chip - to put it into "program mode"), you can use all the features of the chip. (Remember RA5 is input-only, so "Port A" is not a "complete port.")
If you program via "Low Voltage Mode," output line RB4 (pin 10) is not available as you are reserving the pin for re-programming via LVP.
This is very inconvenient as "Port B" is normally used as a complete 8-line output to drive displays etc. To have one line missing from the port is like buying a book with 15 pages missing! Port A is already an incomplete Port, with RA5 as input-only. It would have been much more convenient to put LVP pin on port A and leave Port B complete! Such are the limitations of life!
If you program a chip for the first time: "normally," you can re-program it "in-circuit" (via the 5v feature) or re-program it via the "normal" method.
If you program a chip for the first time: "in circuit," you can regain the RB4 as an in-out line by re-programming it "normally." You cannot regain RB4 as an in-out line by re-programming it "in-circuit."
I hope this covers all the possibilities.
This completes the Multi-Chip Programmer project, but it's just the beginning of PIC Programming.
PROGRAMMING THE PIC16F628A
The PIC16F628A has some different features to the PIC16F628 and cannot be programmed on the old version of IC PROG (version v105c). The new version is called (v105c-a) IC PROG.
A .pdf file outlining the differences can be found HERE.
I am trying to get my JDM programmer to work using icprog 1.03b under windows 2000 but it won't start comes up with errors missing driver etc. icfprog driver is not installed .
Get the latest version of ICPROG.
I now get a message "Privileged instruction " when I try to use. It happens on all versions
Change ic-prog's compatibility to Win98. Right click on the icprog.exe and click on Compatibility Tab.
Make sure you tick the *enable NT/2000/XP driver*
under the options>Misc tab. Make sure you have the 6kb driver file in the same folder as the icprog.exe
DISASSEMBLING A PROGRAM READING THE .HEX FILE
This section does not use the Multi-Chip Programmer but it is in this section as it is a part of the process of programming. If you take a .hex program from a book or magazine, or read a program from a chip, the block of digits is almost impossible to read. Sometimes it is important to know if the numbers refer to a particular program and you may wish to know if it is the latest version. You may also need to make a modification.
The program in this article (the program is called Disasm) will take a .hex file from a PIC16F84 and convert it back into a layout very similar to the set of instructions in an .asm file. The only difference is the absence of annotations and labels.
The program is called Disasm (for Dis-assembly program) and the files you need to get this program up-and-running, are HERE.
The files are:
Disasm.exe 15k Application File This is the file you use (see below).
About.frm 3k FRM File
Cmdialog.vbx 19k VBX File
Disasm.frm 10k FRM File
Disasm.mak 1k MAK File
Vbrun300.dll 389k DLL file
These are on your computer, in Disassembler folder: _CD/_Pic Lab_cd/Disassembler
Disasm requires two files: Cmdialog.vbx and Vbrun300.dll to be put into: C:\Windows\System
Installation is now complete.
Disasm will disassemble your .hex files. Firstly you will need a .hex file.
For all the .hex files for the 5x7 Display Project, click HERE.
To make it easy, you can put them onto a disk and access them in drive A as 84 Disasm only sees the first 8 letters of each name and it is very difficult to follow if the names have more than 8 letters.
Click on File. Click on Open. Double-click on the open folder: c:\ The folders on drive C will appear. Move down the list until 5x7dis~1 appears. Double-click on 5x7dis~1. The .hex files in this folder will appear in the window. Double-click on the file you want to disassemble. It will disassemble immediately. You can open two or more .hex windows (Disasm windows) at the same time to compare listings.
|You are now ready to use Disasm.
To access Disasm, click HERE.
To run Disasm, double-click on the icon:
and a window will appear.
To save a disassembled file you MUST rename the extension to .asm, otherwise you will LOSE the original .hex listing.
To save a file, click on File. Click on Save as: Click on the highlighted file in the address window to de-highlight it. Change the extension to .asm Click ok.
If you are working on a project, you must keep a back-up copy of your program on a floppy, just in case something goes wrong. It is very difficult to re-build something that is lost, especially if it is a written piece of work.
Proton BASIC Compiler
Note: Proton BASIC Compiler is another decompiler tools, more information can be found on www.protonbasic.co.uk
Proton Development Suite supports all of the most popular Microchip Devices. With new - and ever more complex - devices, becoming available each month, we try to keep up! Inevitably support for some very new devices will be delayed as we await samples and errata free data sheets.
Our policy for adding devices is generally managed within the following hierarchy:
- add support if a new device is a variation of an existing supported device
- add support of a new device based upon popular demand, as requested by forum users.
- Subject to the device being available for general purchase
- the data sheet being available to us
- there being no major errata notes related to the device
- the device being a standard 12, 14 or 16 bit core device
- 24 and 32 bit core devices are NOT supported by Proton Development Suite. These devices will be supported by a NEW product.
12-bit core devices
14-bit core devices
10F200, 10F202, 10F204, 10F206, 10F220, 10F222
12C508, 12C508A, 12C509, 12C509A, 12CE518, 12CE519
12F508, 12F509, 12F510, 12F519, 16C505, 16C54
16C54A, 16C54B, 16C54C, 16C55, 16C55A, 16C56
16C56A, 16C57, 16C57C, 16C58A, 16C58B, 16CR54
16CR54A, 16CR57A, 16CR57B, 16CR57C, 16CR58A, 16CR58B
16F505, 16F506, 16F526, 16F54, 16F57, 16HV540
14-bit enhanced core devices
10F320, 10F322, 10LF320, 10LF322, 12C671, 12C672
12CE673, 12CE674, 12F609, 12F615, 12F617, 12F629
12F635, 12F675, 12F683, 12HV609, 12HV615, 16C432
16C433, 16C554, 16C558, 16C61, 16C62, 16C620
16C620A, 16C621, 16C621A, 16C622, 16C622A, 16C62A
16C62B, 16C63, 16C63A, 16C64, 16C642, 16C64A
16C65, 16C65A, 16C65B, 16C66, 16C662, 16C67
16C71, 16C710, 16C711, 16C712, 16C715, 16C716
16C717, 16C72, 16C72A, 16C73, 16C73A, 16C73B
16C74, 16C745, 16C74A, 16C74B, 16C76, 16C765
16C77, 16C770, 16C771, 16C773, 16C774, 16C781
16C782, 16C84, 16C923, 16C924, 16CE623, 16CE624
16CE625, 16CR62, 16CR63, 16CR64, 16CR65, 16CR72
16CR83, 16CR84, 16F610, 16F616, 16F627, 16F627A
16F628, 16F628A, 16F630, 16F631, 16F636, 16F639
16F648A, 16F676, 16F677, 16F684, 16F685, 16F687
16F688, 16F689, 16F690, 16F716, 16F72, 16F722
16F723, 16F724, 16F726, 16F727, 16F73, 16F737
16F74, 16F747, 16F76, 16F767, 16F77, 16F777
16F785, 16F818, 16F819, 16F83, 16F84, 16F84A
16F87, 16F870, 16F871, 16F872, 16F873, 16F873A
16F874, 16F874A, 16F876, 16F876A, 16F877, 16F877A
16F88, 16F882, 16F883, 16F884, 16F886, 16F887
16F913, 16F914, 16F916, 16F917, 16F946, 16HV610
16HV616, 16HV785, 16LF722, 16LF723, 16LF724, 16LF726
16LF727, RF675F, RF675H, RF675K
12F1501, 12F1822, 12F1840, 12LF1501, 12LF1822, 12LF1840
12LF1840T48A, 16F1454, 16F1455, 16F1459, 16F1503, 16F1507
16F1508, 16F1509, 16F1512, 16F1513, 16F1516, 16F1517
16F1518, 16F1519, 16F1526, 16F1527, 16F1782, 16F1783
16F1784, 16F1786, 16F1787, 16F1823, 16F1824, 16F1825
16F1826, 16F1827, 16F1828, 16F1829, 16F1847, 16F1933
16F1934, 16F1936, 16F1937, 16F1938, 16F1939, 16F1946
16F1947, 16LF1454, 16LF1455, 16LF1459, 16LF1503, 16LF1507
16LF1508, 16LF1509, 16LF1512, 16LF1513, 16LF1516, 16LF1517
16LF1518, 16LF1519, 16LF1526, 16LF1527, 16LF1782, 16LF1783
16LF1784, 16LF1786, 16LF1787, 16LF1823, 16LF1824, 16LF1825
16LF1826, 16LF1827, 16LF1828, 16LF1829, 16LF1847, 16LF1933
16LF1934, 16LF1936, 16LF1937, 16LF1938, 16LF1939, 16LF1946
16-bit core devices
18F1220, 18F1230, 18F1320, 18F1330, 18F13K22, 18F13K50
18F14K22, 18F14K50, 18F2220, 18F2221, 18F2320, 18F2321
18F2331, 18F23K20, 18F23K22, 18F2410, 18F242, 18F2420
18F2423, 18F2431, 18F2439, 18F2450, 18F2455, 18F2458
18F248, 18F2480, 18F24J10, 18F24J11, 18F24K20, 18F24K22
18F24K50, 18F2510, 18F2515, 18F252, 18F2520, 18F2523
18F2525, 18F2539, 18F2550, 18F2553, 18F258, 18F2580
18F2585, 18F25J10, 18F25J11, 18F25K20, 18F25K22, 18F25K50
18F25K80, 18F2610, 18F2620, 18F2680, 18F2682, 18F2685
18F26J11, 18F26J13, 18F26J50, 18F26K20, 18F26K22, 18F26K80
18F27J13, 18F4220, 18F4221, 18F4320, 18F4321, 18F4331
18F43K20, 18F43K22, 18F4410, 18F442, 18F4420, 18F4423
18F4431, 18F4439, 18F4450, 18F4455, 18F4458, 18F448
18F4480, 18F44J10, 18F44J11, 18F44K20, 18F44K22, 18F4510
18F4515, 18F452, 18F4520, 18F4523, 18F4525, 18F4539
18F4550, 18F4553, 18F458, 18F4580, 18F4585, 18F45J10
18F45J11, 18F45K20, 18F45K22, 18F45K50, 18F45K80, 18F4610
18F4620, 18F4680, 18F4682, 18F4685, 18F46J11, 18F46J13
18F46J50, 18F46K20, 18F46K22, 18F46K80, 18F47J13, 18F6310
18F6390, 18F6393, 18F63J11, 18F63J90, 18F6410, 18F6490
18F6493, 18F64J11, 18F64J90, 18F6520, 18F6525, 18F6527
18F6585, 18F65J10, 18F65J11, 18F65J15, 18F65J50, 18F65J90
18F65K22, 18F65K80, 18F6620, 18F6621, 18F6622, 18F6627
18F6628, 18F6680, 18F66J10, 18F66J11, 18F66J15, 18F66J16
18F66J50, 18F66J55, 18F66J60, 18F66J65, 18F66K22, 18F66K80
18F6720, 18F6722, 18F6723, 18F67J10, 18F67J11, 18F67J50
18F67J60, 18F67K22, 18F8310, 18F8390, 18F8393, 18F83J11
18F83J90, 18F8410, 18F8490, 18F8493, 18F84J11, 18F84J90
18F8520, 18F8525, 18F8527, 18F8585, 18F85J10, 18F85J11
18F85J15, 18F85J50, 18F85J90, 18F85K22, 18F8620, 18F8621
18F8622, 18F8627, 18F8628, 18F8680, 18F86J10, 18F86J11
18F86J15, 18F86J16, 18F86J50, 18F86J55, 18F86J60, 18F86J65
18F86K22, 18F8720, 18F8722, 18F8723, 18F87J10, 18F87J11
18F87J50, 18F87J60, 18F87K22, 18F96J60, 18F96J65, 18F97J60
18LF13K22, 18LF13K50, 18LF14K22, 18LF14K50, 18LF24J11, 18LF24K50
18LF25J11, 18LF25K50, 18LF25K80, 18LF26J11, 18LF26J13, 18LF26K80
18LF27J13, 18LF44J11, 18LF45J11, 18LF45K50, 18LF45K80, 18LF46J11
18LF46J13, 18LF46K80, 18LF47J13, 18LF65K22, 18LF65K80, 18LF66K22
18LF66K80, 18LF67K22, 18LF85K22, 18LF86K22, 18LF87K22