Author Topic: Pin 4 goes high automatically when one of the status pins connected to the GND!  (Read 37634 times)

Rightia

  • Member
  • ***
  • Posts: 7
I have faced a strange behavior of the pin number 4!
When I connect one of the status pins to the ground, pin number 4 turns on automatically!
Does anyone know why it happens? How can I prevent  the pin 4 to be activated without my command while I am sending input via status pins?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

Rightia

  • Member
  • ***
  • Posts: 7
Unfortunately, I couldn't find any helpful information about it!
Any idea how I can solve this problem?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
You've done all of these:

Set the port to SPP or PS/2 mode in the system BIOS.

Configure the data lines as outputs by writing zero to bit 5 of the control port (base address + 2).

Set DisableWarmPoll in the registry as described in my FAQ.

and you still see the problem?

Rightia

  • Member
  • ***
  • Posts: 7
It still doesn’t work!

- I configured the data lines as outputs.
- I disabled DisableWarmPoll in the registry. (so, it is now 00000001)
- However, I cannot find SPP or PS/2 in the system BIOS. I only have EPP+ECP, Output_Only, and Bi-Directional.
What can I do for this part?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Use Output only if possible, otherwise bidirectional.

Rightia

  • Member
  • ***
  • Posts: 7
I set it to Bi-Directional and I still have the problem!
When I close the switch of the pin 13, the pin 04 goes high automatically!


                220 ohms    LED
Pin 04 -------^^^------|>|------|
                                              |
                           switch          |
Pin 13 ----------------/ ----------|
                                              |
                                              |
Pin 25 ----------------------------|

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Have you written zero to pin 4?

Rightia

  • Member
  • ***
  • Posts: 7
Yes, and before I press the switch, the LED is off.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
In bidirectional mode, S4 is XFlag, which goes high to indicate support for using the data lines as inputs. It looks like the port driver is responding on detecting XFlag's going low.

If you set the port to output-only in the BIOS, you can still use the status bits for inputs and the driver won't try to negotiate other modes. That's what I would try next.


Rightia

  • Member
  • ***
  • Posts: 7
I set it to Readout-Only and I still have the problem!
Don't you have this problem with your own parallel port?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
I don't recall ever seeing this problem or anyone's posting about it here. However, I haven't used a parallel port in a while and no longer have any PCs with them.

You've done everything I can think of to keep the pin from responding.

Rightia

  • Member
  • ***
  • Posts: 7
Thank you so much anyway!
Still one more question:

For solving the problem you said: "Configure the data lines as outputs by writing zero to bit 5 of the control port (base address + 2)."

The program with which I am working doesn't let me change any codes there. Is there any way to configure the data lines as outputs in the registry of Windows XP?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Output is the default state for the data lines. Unless your code or some other driver code is changing it, the lines will be outputs.

If you select Output only in the BIOS, the data lines will always function as outputs.

If you would like to describe in more detail what you are trying to accomplish with the port, we might be able to suggest the best approach.