
             Printer  Port  Serial  EEPROM  Programmer  And  Dongle


                                 G. Y. Xu

                            XuMicro, Houston, TX


    Using the PC's printer port for serial EEPROM programming can be made
extremely easy.  Shown in Figure 1 is a device programmer circuit utilized
to program the MicroWire serial EEPROM 93CXX. The circuit is so simple that
any further simplification seems not possible. This programmer circuit has
the following features.

  1. It does not contain a microcontroller as most device programmers do.
  2. It doesn't need a separate power supply or the so-called "wall-wart."
  3. It doesn't need a cable. When in use it is directly plugged into the
     PC's printer port; although you still can use a cable if you feel it's
     convenient for you (for instance, your PC's printer port is located
     in back).
  4. It doesn't have a single resistor, or even a de-coupling capacitor.

For a circuit as simple as this, what else can you ask?

    These advantages come from the PC's printer port resources and the
architectural simplicity of the MicroWire serial EEPROM.  As we know, the
printer port is composed of three 8-bit registers: the Data register, the
Status register, and the Control register.  Each register has its unique
address. On the classic IBM PC the Data port is used solely for output,
but the Control port can be used as either input or output.

    On the other hand, the 8-pin tiny serial EEPROM consumes very little
current (well below 1 milliamps in active state), and the printer port's
data pin can supply a few milliamps, so D7 (pin 9) is arbitrarily chosen
and configured as power supply pin. No de-coupling capacitor is needed
in practice.

    The MicroWire chip uses four pins to control its read/write operations:
chip select CS, clock signal SK, data input DI, and data output DO.  This
design chose chip select signal from the reverse level of the control bit
C3 (pin 17).

    We also decided to tie pin DI and DO together, and connect them to the
Control bit C0 (pin 1) which can do input or output, therefore saving one
pin. No problem from that in practice.  Because the control pin 1 logic is
the reverse of the logic level on bit C0, the software must take care of
that.

    The MicroWire interface normally requires a pull-up resistor be placed
on DO pin, such resistor is already present but located inside the PC, so
we don't need to add any pull-up here.

    Once the hardware design has been settled, the main job is to write
software. This is not difficult. For many embedded systems software
engineeers it's a routine task and an interesting exercise.  The author
has created a freebee executable program called PSEEP2.EXE for this purpose.
It handles only one MicroWire device, the most popular 93C46's read/write
operations as an example. You can download this program from the following
website:

                   www.geocities.com/xumicro

    Another important feature of this circuit is that once the 93CXX device
has been programmed, the whole system becomes a primitive dongle. It then
can be used as a hardware protection device for your valuable software.
Because only you know whatever was programmed in the device, no one else
knows. When the protected software runs, it first checks whether the device
is present at printer port and whether the code matches whatever programmed.
If that doesn't match, the software will refuse to continue and exit.

    Of course this is just a primitive dongle, not a complex one.  But it
does illustrate the basic principle of the dongle protection technology.

    You can build the circuit using wire-wrapping or point-to-point soldering
technique, or simply build it on a solderless breadboard (in that case a
cable is needed), or make your own PCBoard if you're going to use it for long
time. For such simple circuit, it's really a one-evening project. Now let's
play it for fun.


;----------------------------------------------------------------------------


     Figure 1. This printer port serial EEPROM programmer can also
               act as a dongle once the device has been programmed



