LPT port puts out -3.3V not 5V

LPT port puts out -3.3V not 5V

Post by Rober » Sun, 30 Mar 2003 07:01:57



Hi there

I read the coffee mini howto and it told me howto control the output of my
parallel port. I used this to control my fishtank lights. Everything was
good until I moved the system to a different computer (the old one broke)
and then the relays no longer switched. I measured the "on" voltage from pin 2
of the parallel port (the same one that worked before) and it said the
voltage was -3.3V not 5V like it was on the old computer. Is there some
register I have to set or something to make it work better.

I have changed the bios setting for the parallel port to "NORMAL" the
other options were ecp and epp. I tried those too but the result was the
same.

the basics of the mt program are as follows

// something

ioperm(0x378, 3, 1);      // get permision for the LPT port
outb(1,0x378);            // turn on pin 2
usleep(10000);
ioperm(0x378, 3, 0);      // close the port

// something else

I have a Gigabyte motherboard, GA-6VTXE-A, there is a block diagram in
the manual and the thing that connects to the LPT port is "VIA VT82C686B"

Can you help, or point me in the right direction for help?

Thanks a lot in advance

Robert
remove "nospam" to reply

 
 
 

LPT port puts out -3.3V not 5V

Post by Trashguar » Sun, 30 Mar 2003 08:51:45



> Hi there

> I read the coffee mini howto and it told me howto control the output of my
> parallel port. I used this to control my fishtank lights. Everything was
> good until I moved the system to a different computer (the old one broke)
> and then the relays no longer switched. I measured the "on" voltage from pin 2
> of the parallel port (the same one that worked before) and it said the
> voltage was -3.3V not 5V like it was on the old computer. Is there some
> register I have to set or something to make it work better.

This is probably not due to a register to be set. -3.3V is WIDE outside
any specification for a parallel port that I know of. There are some
options:

1) The off chance exists that your port is physically disconnected (or
connected incorrectly), i.e. by misplaced cabling inside the system. (Is
the board an ATX one with an soldered-in onboard port? If yes, this
cannot be tha case)

2) It MIGHT be that your port IS in fact not enabled so that the pins
are tri-stated which means it picks up interference which you happen to
measure as -3.3V. This can be verified by using an oscilloscope: if the
voltage is very noisy, it's tristated or disconnected. This WOULD be a
problem as you need to initialise the register which is non-standard.

3) The port might be broken or burnt by your appliance (do you connect
the relays directly to the pins? This will pretty well kill the port
since it cannot supply the great current needed to drive the relays and
it is not protected so it migt have been burnt out the first time you
tried to connect. You need transistors as drivers for each pin.

These can easily be tested by connecting a printer to the port and
trying to print. However, with -3.3V on the pin, you might as well burn
the printer! So first try to place some "load" on the pin by connecting
a, say, 10 K resistor between pin 2 and ground. if the voltage goes up
to >-0,5V it's static (disconnected \ tri-stated), otherwise it's dead.
If it's not dead, you can connect the printer and try if it prints
(i.e., boot from a DOS bootdisk and 'echo "printer-test" > lpt1' and see
if it comes out (note that you need to press formfeed on the printer
after sending the echo to make it print. If that works, your software is
somehow broken.

ALSO make sure that you are using SIGNAL GROUND (pins 18-25) as
reference and NOT "chassis ground", i.e. the case. Most of the time the
two are the same, but they may not and by specification are not meant to be.

You can also measure what is on the other pins (1,14,16,17 or the other
7 data lines if you did not connect something to these yet that might
have burnt them). If it's all -3.3V the port is probably not connected
or tri-stated. Note that there is no guarantee to have 5V at one of
these. Just output 0xff to the port and all data lines should be at 5V.

You can also try the control port (0x37A) and place 4 into it to make
the control lines go to 5V.

Quote:> I have changed the bios setting for the parallel port to "NORMAL" the
> other options were ecp and epp. I tried those too but the result was the
> same.

It might not be necessary but I'd do that as well.

Make sure that the port is in fact set to 0x378 and enabled in the BIOS
(bion, this is a common mistake)! Also make sure that the modules ppdev,
parport and parport_pc are NOT loaded. You also should check the return
value of ioperm.

The modified code could be:

if(ioperm(0x378, 3, 1)!=0)      // get permision for the LPT port
printf("ioperm error.\n");      // print failure message
outb(0xff,0x378);            // turn on all data lines
outb(4,0x37a);
                 // turn on all control lines
usleep(10000);
outb(0,0x378);            // turn off all data lines
outb(0xb,0x37a);
  // turn off all control lines
ioperm(0x378, 3, 0);      // close the port

Running this should give you a change on all output pins regardless of
their current state. You should give a greater interval (1-2 seconds) to
see the changes in case the pins switch back to their old values after
ioperm off.

Quote:> I have a Gigabyte motherboard, GA-6VTXE-A, there is a block diagram in
> the manual and the thing that connects to the LPT port is "VIA VT82C686B"

> Can you help, or point me in the right direction for help?

Maybe that helps.

Trashguard

--



 
 
 

LPT port puts out -3.3V not 5V

Post by Byron A Je » Sun, 30 Mar 2003 14:20:26



-Hi there
-
-I read the coffee mini howto and it told me howto control the output of my
-parallel port. I used this to control my fishtank lights. Everything was
-good until I moved the system to a different computer (the old one broke)
-and then the relays no longer switched. I measured the "on" voltage from pin 2
-of the parallel port (the same one that worked before) and it said the
-voltage was -3.3V not 5V like it was on the old computer.

It probably was 3.3V, not -3.3. Positive lead of the voltmeter to pin 2,
negative to any pin from 18-25.

Quote:> Is there some register I have to set or something to make it work better.

Nope.

-
-I have changed the bios setting for the parallel port to "NORMAL" the
-other options were ecp and epp. I tried those too but the result was the
-same.

Correct.

-
-the basics of the mt program are as follows

[ Deleted for brevity, no impact on the situation]

-Can you help, or point me in the right direction for help?

Certainly. It's the nature of the modern parallel port on the modern PC.
All modern MB run on 3.3V or less. The parallel port has always been a
TTL device. As such it only has to guarantee 2.4V or more for a high
signal. With the rest of the MB being powered by the 3.3V supply, it
doesn't make sense to use the 5V supply for the parallel port when the
3.3V signal works fine for a printer.

I ran into this exact problem when designing my simple PIC programmer.

The solutions unfortunately are not trivial. The simple fact is that
nothing on a modern parallel port will generate a 5V signal. So you
will have to get it from somewhere else. Some suggestions:

1) The game port must supply 5V to the joysticks.
2) PS/2 ports have a 5V supply. An unused port or a split cable is required.
3) Pull 5V from a disk connector inside the machine.
4) Use an external 5V power supply.

In any case you'll probably need to add a transistor driver for the relay.
Get any old NPN transistor (like a 2N2222) and wire as follows:

* Connect the emitter of the transistor to ground.
* Connect the collector to one end of the relay coil.
* Connect the other end of the coil to the +5 supply from the list above.
* Connect the base of the transistor to pin 2 on the parallel port through
  a 470 ohm resistor. Any resistor between 470 and 1000 ohms should do fine.
* Finally as with almost any relay circuit, wire a diode across the coil

You'll find this is pretty much a standard relay driver. the 3.3V signal
from the parallel port will turn on the transistor which will drive the
relay.

Hope this helps,

BAJ

 
 
 

LPT port puts out -3.3V not 5V

Post by David Schwart » Mon, 31 Mar 2003 11:32:05


        Your problem is almost certainly hardware and not software. What does
the circuit you've connected to the parallel port look like? Does it
contain a resistor to ground? What value? Does it buffer the output or
try to use it to drive a [reed?] relay directly?

        DS

 
 
 

1. Problem Updating RH5.0 to kernel-2.0.32-3 w/pcmcia-cs-2.9.12-3

Help!

Following the instructions for updating the RH5.0 kernel on my laptop
from kernel-2.0.31-7 to kernel-2.0.32-3 w/pcmcia-cs-2.9.12-3, the
instructions say to "rpm -i" the kernel RPMs.  They also say to do
the same with the "pcmcia-cs" RPM.

But when I try the "rpm -i" with the pcmcia-cs RPM, rpm issues
several "conflicts with" messages and refuses to load the new RPM.

I am now stopped dead in my tracks with my long-weekend marathon
upgrade.  (Haven't modified /etc/lilo.conf nor tried to reboot yet.)

What should I do at this point?  I suspect I should probably do the
pcmcia RPM with -U instead, but what if I want to boot the old
kernel again?

(Please reply via email as well as posting, as connections to the
news server I use for the Linux groups is quite slow and I'm not
confident that it always gets everything in a timely manner.)

Thanks,
Jim
--
Jim Seymour

http://home.msen.com/~jimsun

2. pcfs not recognized -sol7x86

3. PROBLEM: I/O ports allocation bug in Linux kernel 2.4.18-3

4. Linux and Compaq Armada 77xx laptops

5. Not working: RH50 + Thinkpad 560X + pcmcia-cs-2.9.12-3

6. using remap_page_range with pci_alloc_consistent

7. Building 2.2.16-3 kernel with de4x5 support (not as a seperate module)

8. Sound problems on a Performa 6400/180

9. -- Generating 5v from Parallel Port

10. parallel port: why +5V on pin 12 in rest

11. XEmacs 20.3-3 and RH 5.1

12. Bug in the INN-2.2.2-3 Package from Red Hat Linux 6.2 Serverinstallation?

13. jdk-1.0.2.2-3.i386 on RedHat 4.2