Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I have a small board that controls some appliances through the parallel port.

What i want to do is to put on high/low pin X with out modifying the rest of the pins (short story, control each pin individuality)

Example: D0-D5 = 1 what i want D0 = 0 and D1-D5 = 1

Thanks a lot.

share|improve this question
Which OS? Which language. C++ Boost library has a very open license, is cross-patform and very reliable. It has a asio module, which I am currently using to cotnrol a serial port (webalice.it/fede.tft/serial_port/serial_port.html). Maybe this could work out for the parallel port too. Good luck! – Vorac Sep 12 '12 at 7:46
Also google search for "parallel port terminal" (without the quotes) turns up loads of results. Haven't researched them, however. – Vorac Sep 12 '12 at 7:48

1 Answer

Usually in this situation I keep a variable with the whole byte, change the bits I want and then write it back to the port.

Example in C:

PortValue = 0x00;    // Set all bits to 0
LPT = PortValue;

PortValue |= 0x01;   // Set the bit 0 to 1
LPT = PortValue;

PortValue &= ~0x01;  // Set the bit 0 to 0
LPT = PortValue;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.