首页 > 代码库 > Make a printer-port EEPROM programmer and dongle
Make a printer-port EEPROM programmer and dongle
You can easily use a PC‘s printer port for serial-EEPROM programming. You can use a device-programmer circuit used to program the MicroWire serial EE-PROM 93CXX (Figure 1). The circuit is so simple that any further simplification seems impossible. This programmer circuit contains no microcontroller, as most device programmers do. It needs neither a separate power supply, or "wall-wart," nor a cable. When in use, it directly plugs into the PC‘s printer port. However, you still can use a cable if convenient—for PC printer ports behind the PC, for example. The circuit also requires neither a resistor nor a decoupling capacitor.
These advantages come from the PC‘s printer-port resources and the architectural simplicity of the MicroWire serial EEPROM. The printer port comprises the 8-bit data, status, and control registers. Each register has its unique address. On the classic IBM PC, the data port serves solely for output, but the control port can serve as either input or output. The eight-pin, tiny, serial EEPROM consumes less than 1-mA current in the active state, and the printer port‘s data pin can supply a few milliamps, so this design uses D7 (Pin 9) as a power-supply pin. No decoupling capacitor is necessary in practice.
The MicroWire chip uses the CS (chip-select), SK (clock-signal), DI (data-input), and DO (data-output) pins to control its read/write operations. This design uses the chip-select signal from the reverse level of the control bit (Pin 17). It also ties together pins DI and DO and connects them to the Control bit (Pin 1), which can serve as input or output, thereby saving one pin. These selections caused no problems in practice. Because control Pin 1‘s logic is the reverse of the logic level on bit C0, the software must take care of the inversion. The MicroWire interface normally requires a pullup resistor on the DO pin, but such a resistor is already inside the PC, so it‘s unnecessary.
Once you settle on the hardware design, the main task is to write software. This task is not difficult. For many embedded-system-software engineers, it‘s routine and interesting. A freeware executable program, Pseep2.exe, is available for this purpose. A sample demo program, secret.bin, allows you to practice the programming. Click hereto download the software for this Design Idea. It handles only one MicroWire device—the popular 93C46‘s read/write operation as an example. Another important feature of this circuit is that, once you program the 93CXX device, the system becomes a primitive dongle. You can then use it as a hardware-protection device for your valuable software. Only you know whatever was programmed in the device.
When the protected software runs, it first checks whether the device is present at the printer port and whether the code matches what you programmed. If a match doesn‘t exist, the software refuses to continue and exits. The dongle is primitive, but it does illustrate the basic principle of dongle-protection technology. You can build the circuit using wire-wrapping or point-to-point soldering techniques on a solderless breadboard, in which case you‘ll need a cable, or with your own pc board. It‘s a one-evening project.
Make a printer-port EEPROM programmer and dongle