Skip navigation links - Search page - Goto navigation bar
Vv (logo)

Electronics, for fun - Some ideas for electronic hobby... and work

A serial to parallel converter


In this page you will find the description of a serial to parallel converter designed to connect a large number of digital output to a PC parallel port.

This isn't an "autonomous" circuit but should be used with other circuit, as a Micro-step driver or Unipolar step driver.

The problem

Often is required to connect a digital circuit to a PC; no problem if ten digital output are enough, no isolation is required, circuits are 5V powered...

Using this circuit you will connect to a single parallel port electronic circuits requiring up to 96 digital output, optically insulated lines, 3 to 15V powered.

Drawback is a relative high time to update... Using high speed LPT and high speed opto-isolators throughput will be up to 500 kbyte/s. 

The idea

This design use CD4094B, a simple serial to parallel converter.

The CD4094B consists of an 8-bit shift register and a  8-bit latch. Data is shifted serially through the shift register on the positive transition of the clock. The output of the last stage (QS) can be used to cascade several devices. The output of each stage of the shift register feeds a latch, which latches data on the negative edge of the strobe input. When strobe is high, data propagates through the latch to output gates.

Three optocouplers are used for electrical insulation.

A simple schematic for iso-buffer

A simple schematic for iso-buffer

... and a real circuit.

A real circuit

Here a timing diagram, where you can see from top to bottom:

  1. sixteen clock front
  2. the data line, with some one and some zero 
  3. the single strobe

Trasmissione ad un registro a scorrimento di 16 bit

Signals are inverted because optocouplers acts as inverter, see data sheet for more details.

Total time required is about 50 us but using higher speed LPT limit values is set by optocouplers to about 20 us. You can connect to a single LPT up to six of these CD4094 chains using a common clock and strobe pin.

Note that optocouplers are not high speed components. In following image, you can see a digital input signal to led pin (lower trace) and transistor output voltage: transition time is about 500 ns and maximum frequency clock is about 2 MHz.

 Un particolare in cui si vedono i tempi di salita

The software

You can write your-own code to generate timing using as reference data sheet and timing diagram in this page. 

Or you can use functions in VVIO project library.

A passive cable

To connect iso-buffer to LPT, you need a cable. You can see the simplest version in following schematic:

Lo schema di una connessione "passiva"

As sample, for 5x2 connector on the right, connections to do are:

Optocouplers  Function Led Pin 5x2 LPT pin  LPT pin name
ISO1 strobe anode 1 2 Data 0
ISO1 strobe cathode 2 25 GND
ISO2 clock anode 3 3 Data 1
ISO2 clock cathode 4 25 GND
ISO3 D1 anode 5 4 Data 2
ISO3 D1 cathode 6 25 GND
- reserved - 7 - -
- reserved - 8 - -
- reserved - 9 - -
- reserved - 10 - -

Using this simple cable there is a problem: LPT pin 2 and 3 should source current to light up to six led, one for each connector... A single LED require about 16 mA and some LPT can source no more then 20-30 mA. And if you use a portable PC current may be lower! So this connection work fine only using high current parallel port AND if you connect only a small number of chains... Otherwise you need an "active version" of cable.

In following image, a prototype for a dual-chains connection: I think it work with almost all desktop parallel port.

Un cavo passivo

Iso-Buffer

Using active cable you can:

Buffer schematic

As sample, for 5x2 connector on the right, connections are:

Optocouplers  Function Led Pin 5x2 Power LPT pin * LPT pin name
ISO1 strobe anode 1 Vcc - -
ISO1 strobe cathode 2 - 2 Data 1
ISO2 clock anode 3 Vcc - -
ISO2 clock cathode 4 - 3 Data 2
ISO3 D2 anode 5 Vcc - -
ISO3 D2 cathode 6 - 4 Data 3
- reserved - 7 - - -
- reserved - 8 - - -
- reserved - 9 - - -
- reserved - 10 - - -

* trough inverter

Note: there is a double inversion so no software modification is required.

isobuffer.tgz file contains schematic and PCB required to connect up to six chains to a single LPT.

Una fotografia del prototipo

Components

C1 470uF - 16 Vl - Electrolytic capacitor
C2  4.7uF - Electrolytic capacitor
C3 C4 C5  220 nF - Capacitor
D1D2  1n4004 - 1A diode
D3  Led
JP1JP2 JP3 JP4JP5 JP6    Connector 5x2 pin, step 2.54mm
JP7  Connector 2 pin, step 5mm
P1 Connector DB25 male for printed board
R1  2K2 - 1/4W
U1 U2 U3  74F04 - Inverter
U4  7805 - Voltage regulator

Note

isobuffer.tgz contains:

licence.txt License
schematic.pdf Circuit schematic, in pdf format 
bottom.pdf Solder pcb side, in pdf format 
assembly.pdf Components layout, in pdf format 

To build this circuit you need:



- Home page - TOC - Design - Not only electronics - Mail - Search -


- XHTML 1.0 Strict - CSS 2.1 - WCAG 2.0 L1 - Privacy - Italiano - E-mail -
Tweet