MULTI
CHIP PROGRAMMER
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:
- 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).
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 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
Go to page 4 to Disassemble
a .hex file
|