MS-DOS EEPROM Programmer

Small serial EEPROMs are commonly used in modern electronic equipment for storing non-volatile data. They are used in equipment like: TV sets, VCRs, Satellite receivers and even cell phones. There they are mainly used for storing tuning and calibration data.
Especially storing the calibration data is very important. Adjustments are mainly done by software instead of using a screwdriver nowadays. Adjusting a set from scratch is often a tedious and error prone job. Therefore it's very important to have a programming tool with which you can quickly pre-set all main adjustments. After that the adjustments need only some fine-tuning, which is much faster than starting from scratch.

The hereby presented EEPROM programmer is a cheap tool to assist in programming these EEPROM devices. The total costs for the hardware are very low.
The programming tool is to be connected to one of the parallel ports of a PC running MS-DOS or compatible operating system. The accompanying program handles the rest. The program is also quite comfortable in a DOS box in just about any Windows version, even Windows XP.
I never got about to make it useful under Linux though. Since I've switched jobs I never really needed it anymore.

The programmer is capable of programming the following devices:

I²C bus

256 bytes, 512 bytes, 1kb, 2kb types. (E.g. 24xx02, 24xx04, 24xx08, 24xx16, SDA3526, SDA3546, SDA3586, etc.)

OSCAR5

It can program the cars and the OSCAR5 programmer it self. The OSCAR5 was a tool to make copying settings from one Nokia TV set to the other a bit easier.

NVM Bus

Only the Intersill NVM3060 is supported. Not the NVM2061 or NVM 20562.

It may also be possible to program the 2401, a 128 bytes EEPROM, but I never had one to verify that myself.

Operation Of The Programmer

The programmer operates as a DOS command line interpreter. This means that the program is started from the DOS prompt, where the program name is followed by one or more parameters. The program inspects these parameters, completes its task and returns to the DOS prompt. The biggest advantage of such a program is that it is quite easy to write. The biggest disadvantage is that it is somewhat user-unfriendly. The user should be familiar with MS-DOS. But there is nothing wrong with being familiar with MS-DOS, not even in the Windows age. It enriches your view on the (computer) world.

The interface is to be connected to one of the LPT ports of the PC. The program will automatically detect its presence, so the user does not have to point it out to the program.

The general syntax for the program is:

EEPROM command [filename]

This line is to be typed behind the DOS prompt. The parameter command must always be given, and consist normally of only one character. More characters are allowed but will be ignored until the next white space or end of line. The filename parameter is optional, depending on the command that is given.

The filename can consist of drive letter, path name, file name and extension. If the drive letter and/or path name are omitted, the current drive and/or path is used to point to the file name.
If the extension is omitted, one of the 3 default extensions is used. The default extensions are:

  • .EEP    for I²C-bus ICs
  • .OS5    for NOKIA OSCAR5 cards
  • .NVM    for IM-bus ICs

When you want to read the contents of the EEPROM the program checks to see if the output file already exists before it is created and written to. If the file does exist, the program warns the user and asks if that file may be overwritten. The old contents of that file will be lost forever if the user allows it to be overwritten!

Device Recognition

The programmer is capable of recognizing the connected device type up to devices of 2 kB. Unfortunately it can not detect, nor read or write devices with a larger capacity like the 24C64, 24C128 or 24C256. The recognition takes place in a predefined order.

I²C devices are detected first. At the same time the size of an I²C device is determined. The size of the IC is measured by the number of memory banks that produce an acknowledge. Each bank consists of 256 bytes which are all addressed by the same I²C address.
Automatic detection of the memory size has one small disadvantage. The program tends to make some minor mistakes occasionally. E.g. Siemens ICs of the type SDA3546 should have only 2 banks, giving a total of 512 Bytes. But all samples that I have seen have 4 really working banks. Also devices from Microchip may fool the program. E.g. the 24LC02B pretends to have 8 banks, but actually has 1! The 24LC04B should have 2 but also pretends to have 8 as well. These ICs respond to all $Ax addresses, therefore the program is fooled.
Fortunately this is not a problem for the programmer. The program may warn the user that the file size is shorter than the EEPROM size during a write operation. You may ignore this warning, because you know now that the EEPROM pretends to be bigger than it really is.
Reading such an IC is also no problem. Only the file which is written to disk is slightly bigger than it should be.

If no I²C bus IC is detected, the program will check if an external OSCAR5 programmer is connected. If it is, the program will verify if a card is inserted in it. The programmer will use this card if it is found, and the lights on the OSCAR5 programmer will be controlled as well.

If the OSCAR5 programmer could not be found either, the program will check if a separate OSCAR5 card is connected. If it is, this card will be used.

If none of the above devices are detected, it will leave only one possibility, the NVM3060. This is an IM-bus IC from Intermetall (Micronas) with a capacity of 512 bytes. The presence of this IC is checked. The program will terminate with an error if no EEPROM can be found at all.
Be aware of the relatively large current consumption of the NVM3060 (40mA). Programming many of these ICs may drain the battery quite fast.

Warning: The EEPROM programmer is intended for EEPROMs up to 2 k bytes. Larger EEPROMs differ too much to be detected automatically. Data in I²C EEPROMs larger than 2 k may be destroyed when an attempt is made to read them with this programmer!

To Read An EEPROM

eeprom r [drive:][path\]filename[.ext]

The letter r tells the program to read the contents of the EEPROM and copy its contents to the file with the name filename. This file name may be preceded by the drive letter and/or path. The extension is also optional.

The user is warned and prompted if a file with the same name already exists. If the user allows the program to continue, the original contents of the file will be lost and will be substituted by the contents of the current EEPROM. The file automatically gets the same size as the EEPROM.

The EEPROM data is saved as a binary file.

To Write To An EEPROM

eeprom w [drive:][path\]filename[.ext]

The letter w tells the program to write the contents of a binary file to the EEPROM. The filename may be preceded by the drive letter and/or path. The extension is also optional.

The user is warned if the size of the EEPROM does not match the size of the file, but programming continues anyway. The first part of the EEPROM is filled if the file size is shorter than the EEPROM size. The first part of the file is programmed to the EEPROM if the file size is longer.
This warning may be caused by the fact that you use the wrong EEPROM type. But it can also mean that the EEPROM pretends to be bigger than it really is. In the first case you should start all over again using the proper IC type. In the second case you may ignore the warning and proceed as usual.

A device does not have to be empty before programming.

To Verify An EEPROM

eeprom v [drive:][path\]filename[.ext]

The letter v tells the program to verify the contents of the EEPROM. The contents of the EEPROM are compared to the contents of the binary file. At the end the number of differences is displayed.
Again the drive letter, path and extension are optional.

A warning is displayed when the file size and EEPROM size are different. Again this can be caused by the wrong IC type or by an IC that pretends to have more memory than it actually has.

To Erase An EEPROM

eeprom e

The letter e tells the program to erase the contents of the EEPROM. An erased EEPROM will contain all $FF. This command needs no file name to know what to write to the EEPROM.

Warning: The EEPROM will be erased without any warnings!

To Show The I²C-bus Inventory

eeprom i

The letter i tells the program to show an inventory of the I²C-bus. This command does not need a file name. The inventory shows all acknowledged even addresses on the I²C-bus in hexadecimal notation.

Error Level Codes

Every time the program stops it passes an ERRORLEVEL code to MS-DOS. This code is mainly meant for batch files that call the programmer software.

Here are the possible ERRORLEVEL codes:

0 = Everything is OK
1 = Programming tool not found
2 = Command error
3 = No device found to be programmed
4 = Data line remains low
5 = Target file already exists
6 = DOS file error
7 = Device suddenly did not respond anymore
8 = File size warning
9 = Programming error
10 = Not enough memory
11 = Power fails

The Interface

The interface is to be connected to one of the LPT ports of the PC. These ports contain enough output and input lines to control the EEPROM programmer.

All supported devices need a data and a clock line. The data line must be bi-directional, this means that the line must be able to send and receive data. Furthermore the line must be of the open-collector type, so the EEPROM can pull this line low if the PC leaves it high. Unfortunately the LPT port of the PC does not meet these requirements out of the box. But there is a simple solution to this problem. With the aid of a simple silicon signal diode in series with one of the outputs it is possible to imitate an open collector output. Connecting the other end of the diode to the data line of the devices and an input pin of the LPT port it enables the PC to read back the actual contents of the data line.
The clock line is a lot easier to make, it consists of only one output line directly from the LPT port.

diagram

Two extra outputs are needed for the IM-bus EEPROMs. Besides the Data and Clock lines, an Ident and Reset line are needed there. These two extra lines are also directly connected to 2 output pins of the LPT port.

All the above lines are individually equipped with their own pull-up resistors and protection resistors.

The interface is powered by a 9V block battery and must be switched on and off. A somewhat complex circuit is responsible for that. This circuit became so complex to avoid unintended switching of the power when the computer is switched on or off. Unnecessary powered on periods would only drain the batteries.
The power supply itself is based on the LM2936-5 voltage regulator. This is a very special regulator circuit. It has a very low internal current consumption, and the voltage drop is also very low. This makes it ideally suitable for battery powered devices. Because of these specifications this regulator has a small disadvantage, it tends to oscillate quite easily. A decent de-coupling by relatively large capacitors is mandatory.

One transistor gets its base-current through a resistor that is tied to the +5V of the interface. This transistor can tell the state of the power supply of the interface to the PC.

A small jumper wire, connecting one output of the LPT port to one input, completes the circuit. It enables the program to recognize the interface.

The complete circuit easily fits into a compact housing, in which the 9V battery also should fit. Use a ZIF socket or good quality normal IC sockets for the programmable devices.
The card reader is optional and is intended for I2C Smart Card memories and OSCAR5 Cards.
An externally connected OSCAR5 programmer is also optional and can be used to program OSCAR5 Cards.

A small piece of pad board is sufficient to fit the whole circuit. Many of the 10k pull-up resistors can be integrated in one single resistor network.
The diode in the data line can be connected directly between the pins 2 and 12 of the LPT connector. This way you spare an extra wire to the interface. Also the detection wire between pins 7 and 10 can be connected directly inside the LPT connector.

OSCAR5

Who ever is this Oscar5 you keep talking about? Is he related to Johnny 5, the living robot?

No, it is a tool, designed by Nokia CE, to copy settings between TV sets and analog satellite receivers. It is a small blue box with 3 buttons and 4 LEDs on it. This box can be connected to a TV set or satellite receiver and all settings data can be copied to an OSCAR5 Smart Card which is inserted in the blue box. Later you can clone such a TV or satellite receiver with the complete settings which are stored on the Card.
The Smart Card itself is just a 2k I²C EEPROM, identical to the 24C16 but with different I²C addresses. A normal 24C16 responds to addresses $Ax, while the OSCAR5 cards respond to addresses $Ex.

Unfortunately the incompatibility between the many different software versions of the TV sets made Oscar 5 die silently.

Download

Download eeprom.zip You can download the software here. Simply unzip the software in a convenient place where you can execute it.