Skip to main content
GameDev.net gamedev.net
🔒 Locked

Basic electronic - Parallel port input

Started by Hedos Jan 10, 2005 at 2:46 PM 7 replies 650+ views
Original Post
Hedos
Hedos
Hey, I'm a begineer to electronic and I was wondering if you guys could point me in a direction where I could find some information on how to create my own electronic device and interact with it through the parallel port? Basically, all I want to do is create a small device which contains a few buttons ( maybe 4 to 6 buttons ) and read when the buttons are pressed via the parallel port, with an application I would create myself. Does anyone know a web site which would help me building this? Thanks a lot. [Edited by - Hedos on January 10, 2005 3:44:08 PM]
trzy
trzy
Quote:
Original post by Hedos
Basically, all I want to do is create a small device which contains a few buttons ( maybe 4 to 6 buttons ) and read when the buttons are pressed via the COM port, with an application I would create myself.


I take it you mean the serial port. It'll be a bit complicated to accomplish what you want to do initially because the serial port is designed to take input serially -- one bit at a time. Also, using the serial port is a bit more complex because it is usually accessed with a protocol and IIRC, the voltage levels are quite different from standard TTL 5V logic.

I'd recommend using the parallel port which is essentially a "raw" interface to your computer and is much easier to deal with electrically.
----Bart
Hedos
Hedos
Alright, as I said, I'm a begineer to electronic.
Yes, I was talking about the serial port.
What is a parallel port, I never heard of that, but it looks like it might be what I'm looking for.

edit: The parallel port is the one used for most printers?
Anon Mike
Anon Mike
For the COM port you probably want to get a RS232 driver ic. Google will give you a few hundred thousand pages worth of info.
-Mike
trzy
trzy
Quote:
Original post by Hedos
Alright, as I said, I'm a begineer to electronic.
Yes, I was talking about the serial port.
What is a parallel port, I never heard of that, but it looks like it might be what I'm looking for.


The parallel port has 25 lines (DB25 connector) -- many are ground lines. There are 8 data lines (outputs), some control lines, and some status lines usable for input. TTL logic is used where ~0-1V is a logic 0 and 3.5-5V is logic 1.

Over the years the parallel port has evolved to support different protocols for communicating with devices. The standard parallel port mode (SPP) is what you'll want to use initially. The various bi-directional and enchanced modes which allow you to use the 8 data lines as inputs require that a hardware protocol be used (as opposed to implementing one in software.)

The parallel port has 3 programmable 8-bit registers:

BASE_ADDR + 0: Data outputs (D7-D0 lines.)
BASE_ADDR + 1: Status port (used to read in the status lines.)
BASE_ADDR + 2: Control port (control lines and configuration bits.)

The base address will be something like 0x378 -- it depends on your system. It can be obtained from the BIOS data area if you're writing DOS code.

Quote:
edit: The parallel port is the one used for most printers?


Yes, it's the printer port.
----Bart
Hedos
Hedos
I'm going to write it for Linux.
Thanks for all these info, it will help me getting started.

Anon Mike: I'll take a look at this RS232 driver, but if the COM port is more complex than the parallel port, I'll certainly go with the parallel port.
GameCat
GameCat
Another way is to buy a cheap gamepad and hack the PCB inside so that your buttons make the gamepad send button events. That way you can just use direct input or something similar to read the input.
Hedos
Hedos
Quote:
Original post by GameCat
Another way is to buy a cheap gamepad and hack the PCB inside so that your buttons make the gamepad send button events. That way you can just use direct input or something similar to read the input.


That would be an idea, but I'd prefer to make my own so I can learn and understand what's going on.
Hedos
Hedos
A little up, in case someone knowing well the subject would see this.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.