How to flash the firmware
(AT90S4433 version) on Win NT/2000/XP
Requires:
- programming cable: 10 pole SP12 compatible from "cable.sch"
schematic (V0.7 and later)
- PC parallelport LPT1 on the mainboard
- modularEEG hardware version: V0.7 and later
- Operating system (OS): Windows XP
Download the "sp12 v2.0.7 for XP/NT/W2000" package from
http://www.xs4all.nl/~sbolt/e-spider_prog.html#NT_version
or directly from:
http://www.xs4all.nl/~sbolt/Packages/sp12v2_0_7-Win32.tgz
Unpack the tgz archive file until you get the SP12v2_0.7 folder.
Follow these instructions:
(If you have already installed GIVEIO or some other driver that enables
direct port access under Windows XP you can skip the first part)
From "readme.win" in
"sp12v2_0_7-Win32.tgz.gz"
...
INSTALLATION
If you are running Win NT/2000/XP, you
will need to install the GIVEIO device driver.
Installing Giveio:
To install the device driver you need Dale Roberts' device
driver
giveio.sys and the program instdrv.exe. Both of
these are included
in the WinNT sub-directory of this installation. The
original files
and documentation for Giveio can be found at
(
http://www.ddj.com/ftp/1996/1996.05/directio.zip).
Instdrv is
from the device driver kit (DDK) for Windows NT.
* Copy the driver giveio.sys from the archive directio.zip
into
%SystemRoot%\system32\drivers.
* Use command line to install the driver using instdrv:
instdrv
giveio %SystemRoot%\system32\drivers\giveio.sys
* In order to start this driver at every reboot
automatically,
change the start up behaviour to automatic:
* 2000/XP: start regedit and
change the value of the key "Start" in
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\giveio" to 2.
* NT: Control
Panel->Devices->giveio->Start Up->Automatic.
Sp12.exe should be put somewhere in your PATH. It is
advisable
to set the environment variable SP12 by adding a line like
"Set SP12=C:\SP12\" to your environment. Sp12 looks for
two
files in the directory pointed to by this variable:
_sp12dev and
_sp12rc. Without it, you'll need copies of those files in
all
your project directories.
Copy _sp12dev into the chosen directory, and run
sp12 -i
To make sp12 create an _sp12rc for your system. Depending
on your
computer it may take a few seconds or somewhat longer to
calibrate the timing loop.
Note: If heavy multitasking is going on, the
autocalibration will
produce time constants which are too small. Therefore
_sp12rc
should be created on a lightly loaded system. When
you are
actually programming an uC, heavy background loads may
slow down
the job, but they won't really hurt; the AVR serial mode
programming time constraints are minimum values.
_sp12rc is in plain language and may be edited (with
care), for
instance to make SP12 use a different parallel port (read
_sp12rc and sp12rc.txt for details).
Finally, run
sp12 -t
The command presents a progress bar, which should take
about 10
seconds to complete, counting from the moment when you hit
the
return on the command line. (There may a brief pause
before the
bar appears, which nevertheless is part of the ten
seconds.)
I wouldn't worry if it's eight or 15 seconds. But the
deviation
is large, read `bugs & bother' below.
...
Connect the programming cable (2x5, 10 poles, digital pcb version 0.7
and later) with the PC-parallelport and the modularEEG 2x5 pinhead
programming connector. Make sure PIN1 of the connector is aligned with
PIN1 of the programming cable.
Activate the power supply for the modularEEG.
Flash the ROM-image (
AT90S4433_modeeg_v0_07.rom)
into the AT90S4433 uP:
sp12.exe -wpfC AT90S4433_modeeg_v0_07.rom -T1
You should see the following:
SP12 version 2.0.7 performing init...
Path to _sp12rc and _sp12dev: Local directory
Running in SP12 cable/dongle compatible mode.
Enabling AVR serial reading/programming...
The device code bytes 0,1,2: 0x1e, 0x92, 0x3 were read
from parallel port 0x278 and indicate the following:
You have connected an AT90S4433
The device was made by Atmel
Performing chip erase...
Writing content of AT90S4433_modeeg_v0_07.rom into program area.
...............................................................
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
...............................................................
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
AT90S4433_modeeg_v0_07.rom written and verified.
write retries: 0, byteWrite: 25 percent of default
...............................................................
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Checksum program area: 4893
Reset was left high.
If you see the above you have successfully flashed the firmware into
the uC.
One final but important step:
DANGER!
|
Always disconnect the SP12cable before connecting
the EEG to a test subject !!!!
That is important
because the programming cable (SP12cable) crosses the opto-isolator and
connects PC-ground to EEG-Ground. So with the programming cable
attached the modularEEG does not have any safety isolation. |