The interface circuit described here provides a bidirectional 8-bit parallel port operated through a PC’s serial port. The serial port also powers the circuit so that no additional power supply is required.
An 8-bit universal shift/storage register (74HC299) is used to buffer the input/output data (see the figure). The 74HC299 needs four control signals to perform the shift, load, and output enable functions. These signals are: CLK (clock), S0 (shift/load control), SL (serial input), and G1 (output enable). In addition, the serial port also should provide a stable power supply to the IC.
Because the serial port has only two directly controllable lines (pin 4 and 7), a few signals have to share one output line. The power supply (Vdd) and CLK share pin 7, which normally is high. The clock signal is generated by a C program with high duty cycle (see the listing). Note that both pin 4 and pin 7 are clamped to 5.1 V by D1 and D2.
The IC will be powered by C2 when pin 7 is low. C2 will be recharged when pin 7 returns high. The S0, SL, and G1 signals are formed on pin 4. In Load mode, pin 4 is high such that one clock signal will load input D0-D7 into the IC. In Shift mode, the duty cycle of the pin 4 signal is selected to keep S0 low and G1 high. In Output mode, pin 4 remains low so that the data in the IC will appear on D0-D7.