By Ron Hildreth
Reading and Writing
an EEPROM
Using the Arduino
My brother-in-law has five out-of-production
CNC machines he uses in his business, three
of which had stopped working. By process of
elimination, he found the culprit to be a
Xicor X88C64 EEPROM that translated user
commands to servo controls. Unable to buy
programmed replacement chips and finding
commercial programmers to duplicate one
of his remaining working EEPROM chips
prohibitively expensive, he asked me if I
could help find a solution. I had gotten an
Arduino Duemilanove for Christmas and had
experimented with it enough to think it
might provide a solution to his problem.
Signal
Address 12
Address 11
Address 10
Address 9
Address 8
Address/Data 7
Address/Data 6
Address/Data 5
Address/Data 4
Address/Data 3
Address/Data 2
Address/Data 1
Address/Data 0
ALE
RD
WR
CE Master
CE Slave
WC
Register
C
C
C
C
C
A
A
A
A
A
A
A
A
L
L
L
L
L
L
Register Bit
4
3
2
1
0
7
6
5
4
3
2
1
0
0
1
2
3
4
5
My first task was to Google the X88C64
EEPROM to locate the datasheet for the part (see
Links). I looked for any operation that required
completion faster than would be possible for the
Arduino. The only instance I found was that every
write during a Page Write operation must be
completed in less than 100 µs. Since the Arduino
( ) which would allow plenty of instructions
to meet the timing requirements.
In looking at the chip specification, I noted that I
would need 13 digital pins for the address/data bus
plus several control leads. This would be a problem
for my existing Arduino, however, since it only
supports 13 digital pins (and two of those are
needed for serial I/O). Not wanting to add external
circuitry, I decided on an Arduino
Mega which has 54 digital pins.
(I’ll use any excuse to get some
new gear!)
Another interesting aspect of
the X88C64 was that the eight data
bits and the lower eight address bits
shared the same pins using the
Address Latch Enable (ALE) control
to designate when the pins are
addresses. Since the Mega pins can
be easily changed from output to
input, I didn’t think this would be
much of a problem.
Another issue I would need to
address was that the X88C64 had
8K bytes of EEPROM. My original
thought was to load the contents of
a working EEPROM into an array,
and then replace the chip with a
blank EEPROM and write the array
contents into the new chip.
However, since the Mega only has
8K bytes of RAM that wouldn’t
Figure 1.
1
16 x 106
Arduino Mega Pin
33
34
35
36
37
29
28
27
26
25
24
23
22
49
48
47
46
45
44
Register bits
and Mega pins
used for
X88C64
address, data,
and control
signals.
42
May 2010