Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parallel Port Programming (in C++)

Status
Not open for further replies.

markus3

Electrical
Joined
Apr 2, 2002
Messages
3
Location
DE
Hallo! I've got a problem with parallel port programming.
I have to write to the LPT1 and then I must read from it. Writing is no problem, but I can`t read :-(
If I write for example int 64 to the port and manipulate the pins by forcing the active high of a pin to ground and read in the new value which should have changed now, it still remains 64. How can I solve this problem?
 
Make sure that 1) your parallel port is bi-directional, 2) you have configured it correctly (I think that there is a control register that you write to to set the data bus direction).
 
Hi,
melone is right, if markus3 is lucky to have a bidirectional parallel port (this is almost the case by the way), then he should activatd read mode by setting the SLCT IN (Pin 17) of parallel port, i.e bit 3 of Portadress + 2.

good luck!
 
Thank you! The Select In Pin is a very good idea ;-)
Normally, it is off (read-mode) isn`t it? Meanwhile I
solved the problem by using the status register, especially Pin 15 (Error-Pin). That functions, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top