ZIF sockets. Not wanting to take any chances of damaging
a working EEPROM, the Master socket had both the Write
Control and Write signals tied high. My final design is
shown in Figure 4 with the address and data signal bus in
green and the control signals in red.
What is an EEPROM?
Troubleshooting
Troubleshooting my final design mirrored the
problems I had on my prototype — reads worked right
away but I couldn’t get the writes to work. Of course, one
of the first things I examined was the Write Control that
had been the cause of my prototype problems. In my final
design, I had decided to control the signal from the Mega
and make it active at the start of my raw_write function,
then turn it off at the end as shown in Figure 6.
After going down many deadends, I reverted back to
reading the EEPROM spec cover to cover again which
finally revealed my error. The X88C64 specification states
that “If the Write Control input is driven HIGH (before tBLC
Max), after Write goes HIGH, the write cycle will be
aborted. The tBLC max is 100 µs and if you look, my write
timing Write Control was going HIGH less than 1 µs after
Write went HIGH, causing every write to be aborted. In
retrospect, I would have saved a lot of debugging time by
just grounding Write Control. To correct the problem, I
moved the Write Control to the main program and left it
active for the entire time the chip was being written.
Did you ever wonder how a computer knows what to do when
you first turn on the power? Whether the computer is in your PC,
your car, the microwave oven, or a mainframe they all need
some type of permanent program that is present even when the
power is off. To put EEPROMs in perspective, it helps to know a
bit of history about non-volatile memory (in roughly
chronological order).
ROM - Read Only Memory
The information in ROM is permanently generated during the
manufacturing process and can't be changed.
PROM - Programmable Read Only Memory
Also known as Field Programmable ROM (FPROM) or One Time
Programmable Non-Volatile Memory (OTP NVM). These circuits
can be programmed (burned) in the field by special-purpose
programming machines. They can only be programmed once.
EPROM - Erasable Programmable Read Only Memory
Similar to a PROM except that it can be erased by a strong
ultraviolet light. It's easy to recognize because the chip has a
transparent quartz window on top of the package.
EEPROM - Electrically Erasable Programmable Read Only
Memory
Permanent memory that can be changed under program control
on a byte-by-byte basis. In the case of the EEPROM used in my
project, the manufacturer does not publish information about the
function of the chip. However, judging by its location in the
circuit it is used to translate the manufacturing program in the PC
into servo commands for a computer controlled milling machine.
Success
My brother-in-law brought me a working EEPROM
and I was able to duplicate it and get all his CNC
machines working again. I also got an excuse to buy some
new gear, and learn a lot about Arduino programming and
troubleshooting along the way. Since this was a one-time
project, there were several areas of possible
improvement that I didn’t pursue. For example, I
made no attempt to optimize timing. (Read time was
under one second, and write and compare was
about one minute.) The chip specifies a worst case
time between write cycles (t WC) of 5 ms which is
what I used in my program. However, by monitoring
data bit 6 after the write the EEPROM indicates
when the internal write has actually completed,
which would typically be less than 5 ms.
While I’m probably the only person interested in
programming an X88C64, this project illustrates how
capable and cost-effective the Arduino platform is in
providing an interface to control digital devices. The
main consideration is to determine if the ATmega
processor it uses is fast enough to generate the
controls and process the data. There are many other
special-purpose digital capabilities built in, such as
I2C and USARTs — not to mention considerable
power to process analog signals. All perhaps good
topics for another article! NV
Flash
Flash can also be changed under program control, and can be
manufactured in higher densities and speed than EEPROM.
However, the write operation can only occur on large blocks of
data at a time.
If you examine the specification for the ATmega 1280 used in
the Arduino Mega, you will see that is has both 128 KB Flash
and 4 kB of EEPROM. The Flash is typically used for programs
such as the power-up boot loader while the EEPROM can be
used for storing program parameters and data that need to be
permanently saved.
Xicor X88C64 Datasheet
www.datasheetcatalog.org/data
sheet/Xicor/mXyyzxsu.pdf
Atmega 1280 Datasheet
www.atmel.com/dyn/resources/
prod_documents/doc2549.pdf
pub?key=rtHw_R6eVL140KS9_G
8GpkA&gid=0
http://farm4.static.flicker.com/
3321/3495394293_0d2c81798
c_b.jpg
http://spreadsheets.google.com/
ccc?key=roX9D5pGrS4muSBJysz
1QQ
Arduino Bitwise Operations
www.arduino.cc/en/Reference/
BitwiseAnd
Arduino Mega Schematic
http://arduino.cc/en/uploads/
Main/arduino-mega-schematic.pdf
Open source logic analyzer
http://dangerousprototypes.com
/2010/02/25/prototype-open-
logic-sniffer-logic-analyzer-2/
www.seeedstudio.com/depot/
preorder-open-workbench-logic-
sniffer-p-612.html?cPath= 75
Atmega 1280 Port Register
to Arduino Mega Connector
References
http://t3.via.t42.org/u/Arduino
Mega_QuietschReferenz_
v0_ 23.pdf
http://spreadsheets.google.com/
Hex notation
http://en.wikipedia.org/wiki/
Hexadecimal
Links
46
May 2010