Sie sind auf Seite 1von 21

http://talkingelectronics.com/FrameworkPages/cont05-PIC-Projects.

html

MULTI CHIP
PROGRAMMER
INTRODUCTION

NOW WITH ISP FEATURE


(In-Circuit Programming)

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.
sample.asm sample.asm

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
programmed one.
See lots more PIC projects and In-Circuit Programming HERE.

This project consists of 3 Pages plus a separate feature on Page 4, using Disasm Program:
Page 1 - Introduction (this page)
Page 2 - Construction
Page 3 - Using the Multi-Chip Programmer - Burning PIC16F628 chips
Page 4 - Disassembling a .hex File This is a separate feature
using: Disasm Program to convert a .hex file into a .asm file.

The complete Multi-Chip Programmer.

The Multi-Chip Programmer can now program Surface Mount chips and
PIC10F220 chips via "WinPIC.exe" or "WinPIC.zip" and the following
adapter:
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.
5. Read the notes on Page 3 by Jason Williams, on configuring your
computer to run the software.
6. For a list of .hex files click: 5x7 .hex files.
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, Page 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.

CONSTRUCTION

PIC Pinouts

CONSTRUCTION
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.

Pin Name I/O Description


1 CD I Carrier Detect
2 RxD I Receive Data
3 TxD O Transmit Data
4 DTR O Data Terminal Ready
5 GND - System Ground
6 DSR I Data Set Ready
7 RTS O Request to Send
8 CTS I Clear to Send
9 RI I Ring Indicator
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.

Multi-Chip
Programmer
PARTS LIST
(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

Serial Cable:
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.

PROGRAMMING/BURNING
STARTS HERE
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.

Installing "totalio.sys":
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"
Click "Install".
Click "Start".
Click "OK".
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.
@echo off
net start totalio
icprog
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).

Goto: Settings->Hardware
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:

1. Open a browser and select the file ic-prog.exe


2. Press right button on your mouse
3. Go to Propertties
4. Go to Compatibility menu
5. Set compatibilty mode as Windows 2000 or Windows 98 / Win ME
6. Press Apply icon
7. 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).

Mod:
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.

A Recap:
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.

More help:
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 icprog driver...
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)
Page 4

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.

USING DISASM
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.

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.
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.
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.

Das könnte Ihnen auch gefallen