Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Apr 2, 2002
3
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?
 
Replies continue below

Recommended for you

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