PROGRAMMING OF 27[N][C]XX[X] EPROMS
-----------------------------------

An EPROM in the erased state contains logic ones (1) in all
bit locations.  To program an EPROM the bits are selectivly
written to logic zeros (0).  This writting is effected by
applying a higher than normal voltage to a floating gate
on a MOS Xitstor that forms the memory cell.

There are two very distinct ways of programming EPROMs -
fast and slow.  Allthough slow programming is standardised
and there is one generally accepted method, fast progrmming
algorithims vary from manufacturer to manufacturer.

All NMOS EPROMs expect slow programming which takes about
50ms+ per address location (27512 = 65535 locations or 54
minutes for a 27512).  However some NMOS devices will still
program reliably (NOTE1) with the generic fast program
algorithm.

Most manufactures now say that CMOS EPROMs must
be programmed with their new (and ussually propritetry)
fast programming algorithms.  These algorithims are still
available from many manufactures data books and most are
fairly simmilar.  However for most purposes a generic fast
programming algorithm can be used.

The generic fast programming algorithm that is outlined
in this text is in disagreement with many manufactures and
other individuals.  This does not mean that it does not
work. Nor does in mean that the EPROM police will turn up
at your door with loud hailers telling you to come out
with you device programmer in clear view.  It does however
mean that any manufactures claims pertaining to data
retention (NOTE1) and device life (NOTE2) will probably
not be reached (ie. if your building the next voyager
probe buy a profesional device programmer).

It should be noted at this time that CMOS EPROMs can be
programmed with the standard slow method (don't know why
you'd want to) but this does have the effect of drastically
reducing their cycle life (number of times they can be
programmed).

GENERAL PROGRAMMING GUIDE LINES
-------------------------------

All programming, be it fast or slow follows the same basic
principle outlined below

Step 1 - Check to see all locations are blank (0xFF)
Step 2 - Program required locations (fast or slow)
Step 3 - Verfiy the Program data after writing all locations.

The first step, Blank Checking, is independent of the
programming method used.  It involves cycling through all
address locations and seeing that each byte of the EPROMs
data contains 0xFF.  If any bytes do not contain 0xFF then
the EPROM is not blank and needs to be exposed to UV light
(NOTE3) to erase all locations.

The Next Step, Programming is detailed under two seperate
headings below.

The Final step, Verifying, is simply to read back the data
that you have just programmed into the EPROMs current
location to make sure the data made it there OK.  In the
fast programming method the verfiy and program procedure
are very much interlinked but a final verify should still
be performed (in real device programmers verify may be
done at a range of different VCC's to ensure data integrity
under all possible operating conditions).

SLOW PROGRAMMING
----------------

Basic Slow programming is achived by

Step 1 - Setting up the Address lines to select a location
Step 2 - Make sure the EPROM is not driving the Data Lines
Step 3 - Write the Desired Data to the Data Lines
Step 4 - Send !CE low (not !CE/!PGM if exists)
Step 5 - Apply VPP
Step 6 - Pulse !PGM (or !CE/!PGM) low for 50ms

A few thing to be noted here are 

1 On 27256 and 512 EPROMs !CE, !PGM, !OE and VPP start 
  to share pins.
2 55ms is ussualy stated as an ablsoute maximum pulse
  duration.  Any longer than this and life cycle of the
  EPROM will be reduced as explained in note 2.  

FAST PROGRAMMING
----------------

As stated above many variations to fast programming exist.
This is only the "Kick Em Hard" generic method.  If you
are not comfortable disobeying manufactures recomendations
I advise you to go and spend several hundred dollars on a
profesional device programmer.  This generic method does
work and should be suitable for most hobbiests.

The Generic "Kick Em Hard" method is achived by

Step 1 - Setting up the Address lines to select a location
Step 2 - Disable EPROMs output
Step 3 - Write the Desired Data to the Data Lines
Step 4 - Enable !CE as above
Step 5 - Apply VPP
Step 6 - Apply a 1ms Programming Pulse (instead of 50ms)
Step 7 - Read Back The Data (256/512 this requires VPP off)
Step 8 - If not Verfiy OK goto step 6 (Step 5 for 256/512)
Step 9 - Apply Over Programming pulse of 4 * time so far
         (ie if you had to do Step 6 three times before the
          data vefiried OK then 3 * 4 ms = 12ms over pulse)

Again the 27256 and 512 have slight variations due to pin
double ups.

One other thing to note is why this is called the "kick Em
Hard" method.  Most Fast Programming algorithms actually
call for sequential pulses of any where between 10us to
1ms.  Because we are using 1ms the minimum total program
pulse will be 5ms (1ms + 4 * 1ms).  Many brand new CMOS 
EPROMs will verify OK after only 200-500us.  This means
that the total program pulse time would only need to be 
1.2-2.5ms or under half the minumum time the generic method
provides.  This in turn leads to smaller cycle lifes than
manufactures claims as explained in Note 2.  This can be
overcome by shortening the pulse time in the software
(something I will leave to the individual to experiment
with).

EPROM TYPE DIFFERENCES
----------------------

2764  -  64kbit organised as  8k x 8

13 Address Lines
 8 Data Lines

        To Program      To Read     Standby

VPP        12.5V           X           X

CE           L             L           H

!OE          H             L           X

!PGM      L pulse          H           X


27128 - 128kbit organised as 16k x 8

14 Address Lines
 8 Data Lines

        To Program      To Read     Standby

VPP        12.5V           X           X

CE           L             L           H

!OE          H             L           X

!PGM      L pulse          H           X


27256 - 256kbit organised as 32k x 8

15 Address Lines
 8 Data Lines

        To Program      To Read     Standby

VPP        12.4V           0v          X

!OE          H             L           X

!CE/!PGM  L pulse          L           H


27512 - 512kbit organised as 64k x 8

16 Address Lines
 8 Data Lines

        To Program      To Read     Standby

!OE/VPP    12.4V           0v          X

!CE/!PGM  L pulse          L           H

When setting up the data on the 512 the !OE/VPP line
should be 5v (disable output)


NOTE 1:
During testing of the programmer it was found many
NMOS EPROM's would program fine with the fast program
method and then five minutes later the code would
disapear.  TI, National, and Intel parts all seamed
to hold the code OK.  Most other NMOS types really
did want a slow program (A brand with an F with a line
above and below would sometimes forget 30 seconds
after verifying OK).
Generaly if you are using surplus parts/pulled parts
that are NMOS and you want to be sure use the slow
program method.

NOTE 2:
During programming the floating gate in the EPROM cell
is subjected to a strong electrical feild.  The process
is too complex (or I am just to lazy and have a bad
memory) to detail here.  However during use charges will
get trapped in the floating gate or the insulating oxide.
It is these trapped charges that ussually cause EPROM
failure and are the reason for finite life cycles for
them.
Programming the EPROM for longer than is necesary or
programming at a voltage that is too high will accelerate
an EPROMs demise.  This is just what the generic fast
programming method does.  If you are concerned about this
the source code is available for you to play with. (I
myself am not concerned.  I have never had an EPROM wear
out before I pluged it in back to front, Gave it 15V VCC,
or accidently thought it was mains powered). 

NOTE 3:
To erase an EPROM you have to expose it to UV light at
a particular wave length (2735uM maybey, Theres that
memory again).  A germacidel UV lamp will do this just
fine.  There is lots of comercial erasers available.
If you cant get either 40 hours of midday sun (10 good
days) will do.  A normal flouresent light will also
erase and EPROM after about 400 hours (welcom to the
Hellfire Club What would you like done to you tonight).
Some time in the future I will have plans for an eraser
here.
