×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

parallel port output question..

parallel port output question..

parallel port output question..

(OP)
I've connected a led to my parallel port and programmed it to turn on and off.. but how do I do if I want to send say 0xff to pin nr 8 and no more?
Because when I turn on the led with outportb(0x378,0xff) I guess that the port starts to output a stream with 1 untill i turn it of.. or?

RE: parallel port output question..

You can think of all parallel port outputs (data & control bits) as latched values.  Once you write a value to it, it will not change until you write a different value.

RE: parallel port output question..

(OP)
yes.. I got that but how do i do if I want to send say 0xff and no more?(in c)

RE: parallel port output question..

if you write a value to the parallel port, then it will never change unless you change it.  Are you looking for the actaul C command?

RE: parallel port output question..

(OP)
I know the command but I got a unit that needs a specific hex as a handshake... and when It got that it sends a signal back.
and the problem I have is to send that command to a specific I dont realy get it...
I use the command outportb(0x378,?) but what should I place on the ? if I like to send say 33h to pin 8?

RE: parallel port output question..

(OP)
"send the command to a specific pin." should it be..

RE: parallel port output question..

Hi vm01bjni,
Pin 8 is related to bit 6 of the data register. As the name said, it is a bit not a byte. So if you want to send 33h to this pin outportb(0x378, 0x80), you must send it one bit per one bit or in other words serially, of course with delay time between bit. But if you really want to do so, then why you do not use the serial port??!

cheers

RE: parallel port output question..

(OP)
ok i get it.. is it possible to connect say pin 8 to pin 10 and make a loopback to monitor what you send?
would it work to send a bit with outbportb and then recieve it with inportb?

RE: parallel port output question..

theoritically it should work, but first you must be sure, that your parallel port support read & write, but normally all modern computers support this capability (find the discussion about this in : Thread233-20414 ). You should set a bit to toggle the write and read modus.
You should make this step :
- set the write modus
- send data to pin 8 = outportb(0x378, 0x80)
- set the read modus (this doesn't change the status of
  the data registers)
- read data from pin 6 = inportb(0x378, 0x20)
recall, pin 10 is conducted to status register !!

regards

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources