Author Topic: Parallel Port  (Read 13321 times)

Olakunle

  • Member
  • ***
  • Posts: 17
Parallel Port
« on: March 31, 2013, 07:05:11 am »
Dear sir,
I was trying to control the bits written to some LEDs via the parallel port data port that was bidirectional :

Private Sub ScrollBar1_Change()
Label1.Caption = ScrollBar1.Value
Out &H3BC, ScrollBar1.Value
End Sub.
I could already access the parallel port using inpout32.zip files and windows 98 compatibility mode on windows xp, the problem am having is that when I tried to read the data port and other ports, they  permanently reads 20 no matter what I write into them, also when I connected bits 0, 1, and 2 to LEDs, the LEDs turned on meaning that logic 1 is there but when I vary the values on the scroll bar according to the code, there was no change on the output LEDs. Sir, what am I doing wrongly. Thanks.
Olakunle.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Parallel Port
« Reply #1 on: March 31, 2013, 11:42:42 am »
If control port bit 5 = 0, the data port is an output port. Values written to the port will appear on the port's pins.

If control port bit 5 = 1, the data port is an input port. Reading the port will return the state of the port's pins, which may be controlled by external circuits. Values written to the port have no effect.

How did you connect the LEDs? What pins? Did you write to control port bit 5? 

Olakunle

  • Member
  • ***
  • Posts: 17
Re: Parallel Port
« Reply #2 on: April 01, 2013, 04:30:40 am »
Sir,
after writing a 0 to the bit 5 of the control port with Out &H3BE, &H0,  the 0  still could not appear at the output. The LEDs are permanently on no matter what value I write to the data port. I am using an IBM T23 laptop computer, the circuit is wired in such a way that pins 2 and 3 of the parallel port  connects to the anode pins of 2 different LEDs while the cathodes of these LEDs go to the ground pins of the parallel port. If am not mistaken the status port should read 120 by default but am only reading 20 from all the 3 ports.
I also tried to write a 1 into bits 5 and 7 of the control port  respectively to read an external data connected to the data port but it still reads 20. The program given in the previous email compiles without any error message. The problem is that I can write to the data port registers but as of now no data could come in or go out from the data  port. I am using ms word vba which I  have used successfully before to access the parallel port of a dell laptop computer. Sir, what are all the other possible solutions.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Parallel Port
« Reply #3 on: April 01, 2013, 10:38:22 am »
Are you using the correct port address? &h3BC is more common. Check Windows Device Manager for the value.

cappy2112

  • Member
  • ***
  • Posts: 10
Re: Parallel Port
« Reply #4 on: May 24, 2013, 01:46:44 pm »
Sir,
after writing a 0 to the bit 5 of the control port with Out &H3BE, &H0,  the 0  still could not appear at the output. The LEDs are permanently on no matter what value I write to the data port. I am using an IBM T23 laptop computer, the circuit is wired in such a way that pins 2 and 3 of the parallel port  connects to the anode pins of 2 different LEDs while the cathodes of these LEDs go to the ground pins of the parallel port. If am not mistaken the status port should read 120 by default but am only reading 20 from all the 3 ports.
I also tried to write a 1 into bits 5 and 7 of the control port  respectively to read an external data connected to the data port but it still reads 20. The program given in the previous email compiles without any error message. The problem is that I can write to the data port registers but as of now no data could come in or go out from the data  port. I am using ms word vba which I  have used successfully before to access the parallel port of a dell laptop computer. Sir, what are all the other possible solutions.

Is it possible that these outputs are open collector and need pullup resistors?