Checking Out a Parallel Port for 3.3 volt Compatibility.

The VMU seems to run on 3.3 volts and may or may not be tolerant of 5 volt inputs (we don't know yet and I don't feel like sacrificing a VMU). My best guess is that they are tolerant of up to about 3.6 volts, but, like I said, this is just a guess.

Parallel ports vary, so it's impossible to determine if yours outputs only 3.3 volts. The only way to know is to measure it. You'll need a voltage meter and a small piece of wire (to probe the connector with). We'll use the dos program "debug" (included with windows) to manually tweak the parallel port.

There are two types of measurements to make: measure the outputs and measure the inputs (yes, the inputs.) The outputs usually output 3.3 or 5 volts at low impedance (meaning that they will drive significant amounts of current, raising the possibility of damage). These outputs can be reduced using a voltage divider. Inputs are typically open-collector, meaning that the parallel port actually pulls up these pins with a medium-value resistor to 5 volts. This is mainly for compatibility reasons. This medium value resistor (I measured mine at 2.2 kohm) may or may not allow too much current and/or voltage to a VMU

1. First, you need to determine the I/O address of your parallel port. I'll give you more ways than you can shake a stick at:

a. Guess according to this table. It's usually 0x378:
LPT1=0x378, LPT2=0x278, Monochrome Display / Printer Adapter=0x3bc
b. Check out your BIOS settings
c. Ask windows: System properties > Device Manager > Ports (Com  LPT) > ECP Printer Port > Resources > Input/output range
d. Ask DOS: at the command line, type 'debug', and then 'd 40:8' at the prompt. The results will look like this.
    -d 40:8
    0040:0000                          78 03 00 00 00 00 80 9F
    0040:0010  27 C2 00 7C 02 20 00 00-00 00 3A 00 3A 00 08 0E
    The first three bytes listed will be your parallel port numbers in reverse order. In the example above, I've got a port a 0x378 and no others (indicated by the zeros)
e. What? That's more than enough ways!
2. If you haven't already, fire up the DOS debug program by typing 'debug' at the windows command line.

Measure the outputs while they are outputting.
3. Set the mode to output: Type 'o 37a 0'. (of course, if you don't have a base address of 378, adjust accordingly)
4. Set the output to ones: Type 'o 378 ff'
5. Measure the output voltage: Put the negative lead of the voltmeter on ground (pins 18-25 or use the metal case of the computer) and the positive lead on pin 2. You should read around 3.3 or 4.8 volts, or something else. If this voltage is too high, you can use the zener circuit, voltage divider or the open-collector driver.

Measure the outputs while they are inputting.
6. Set the mode to input: Type 'o 37a 20'.
7. Measure the output voltage at pin 2 (same case as in step 5). You'll probably read 4.75 volts. If you measure over 3.6 volts, you've got two options: Either use any of the three solutions, or ignore it. The "ignore-it" theory is that this special mode is used only by certain software and probably isn't enabled. Usually input mode is used by programs such as lap-link or interlink, but it may be used with special printer drivers (Does anyone know if the HP printer drivers that show detailed printer status use this?)

8. Return the mode to output: Type 'o 37a 0'.

Measure the inputs.
9. Measure the voltage on pins 10, 11, and 13. They are probably all the same, but try them all, just in case. If you measure more than 3.6 volts, use a zener circuit, pull down or the open-collector driver.

10. Determine the best solution for you. If you aren't comfortable, consult someone who is. I can't be responsible for any damage that you cause to your computer and/or VMU.
 

Solutions

Zener Diode
This circuit is the most flexible and works in both directions -- to reduce a 5 volt parallel port input down to a safe voltage for a VMU input, and also to protect a VMU output from a parallel port's 5-volt pullup. The only problem is that the zener diode may be a special order part; for those in the US, I don't think radio shack stocks low-voltage zeners.

A zener diode conducts at a certain voltage. Ideally, it will conduct as much current as it takes to limit the voltage. Because the zener can absorb more power than a driver can safely put out, using a resistor to limit the current (and power) is advised.
 

                            2 kohm
parallel port --------------/\/\/\-----+-------> to VMU
                              R1       |
                                     __|__/
                                    / / \    Zener diode
                                     /___\   3.3 volt
                                       |
                                       |
                              ground ------------------------+----------> ground
 

The value of the resistor isn't too critical and any value from 2K-10K should work. The resistor should be on the 5 volt side. If your parallel port only supplies power through a pull-up resistor (as opposed to driving it directly), then theoretically you could count on the current-limiting properties of that resistor and not include one in your circuit. But, unless you know what you're doing, it's safer to just an in an extra one.

Note that a zener diode, conducts like a normal diode (with an approximate 0.7 volt drop) when forward biased. The magical zener property only happens when reversed biased. A zener diode of infinite voltage would work just like a normal diode. For this reason, the diode is connected with it's anode to ground (the end without the stripe) in what looks like a polarity where it will never conduct.
 

Voltage Divider
A voltage divider is a circuit that is suitable for reducing an output voltage. It isn't suitable for a pin used as an input. The basic theory is that two resistors, connected end-to-end, will produce a voltage that is proportional to their resistances.

                            2 kohm
parallel port output -------/\/\/\-----+-------> to VMU
                              R1       |
                                       <
                                    R2 > 3 kohm
                                       <
                                       |
                              ground ------------------------+----------> ground

The basic formula is out voltage = R2/(R1+R2) * input voltage. The above circuit takes in 5 volts and outputs 3 volts. You'll want to keep the sum of R1 and R2 in the range of 5 to 10 kohms; otherwise you'll either suck too much current out of the parallel port or you won't supply enough current to the VMU.
 

Pull-Down
A pull-down circuit is suitable only when there is a high-impedence driver (such as what the parallel port uses to pull up an input). The circuit is similar to the voltage divider illustrated above, except that R1 is internal to your parallel port. You'll have to figure out the value of R1 and calculate an appropriate value for R2.

To figure out R1, you'll need to make two voltage measurements. First, measure the output voltage (or input voltage in the case of the parallel port) without anything connected (just the voltage meter). I'll call this Voc, and on my computer, it measured 4.75 volts.  Second, connect a load resistor, typically 4.7 kohm, from the output to ground, and measure the voltage output. I'll call this Vload, and I measured 3 volts on my computer. Now use the following formula to calculate R1:  R1=4.7k*(Voc-Vload)/(Vload). For my case, R1=4.7k * (4.75-3)/3 = 2.74k ohm.

Next, we calculate the necessary R2 needed to produce the correct voltage. Actually, I lucked out-- since I measured 3 volts using a 4.7 k ohm resistor, I thought that was good enough and used that (as long as it is over about 2.5 volts, you should be ok.). But, if you wanted to calculate the perfect resistor, use this formula: R2=[R1/(1-(3.3/Voc))]*(3.3/Voc).  For me this would have been 6.24 kohm, which is pretty close to what I used.

Remember the rule above-- R1+R2 should be in the range of 5 to 10 kohms -- this is especially important if R1 is too low, which would indicate that you have a low-impedence driver and that a pull-down isn't applicable.
 

Open-Collector driver
This is more sophisticated than either approach, and requires the use of an IC. It allows matching of signals between computers operating on different voltages. It's a little too complicated to describe entirely here (but if there is demand, I will). It is an open-driver collector, so the output voltage is dependent on what type of pull-up resistor you use. The chip itself must be powered with the maximum input voltage it will see (typically 5 volts), and you can probably even power it off the parallel port if you use a bit that is known to be on as a power supply.

Here's the basic circuit:

                       10k-20k typical
                       +---/\/\/\-----------------< VMU power supply (pin 1 or 14)
              |\       |
              | \      |
              |  \     |
input --------|   >----+--------------------------> input to VMU
              |  /
              | /
              |/

Make sure that the buffer used is an open-collector output, such as the 74LS07 or 74HC07. Power it as described above.
 
 

updated 8/17/00 - zener solution added -- thanks Sören!

back to my vmu page