R
Rich Grise
Guest
On Tue, 21 Dec 2004 20:54:09 +0000, Danny T wrote:
mean that that one's inverted.
http://ee.cleversoul.com/parallel_port.html
http://www.galeon.com/jcgr/
http://www.infonewsindia.com/pinout/Index.html#6A
According to this chart, they've got LPT1 at 3BCh - that's wrong. It's
378h. 890d = 37Ah is the control port. You write to it to control pins
1, 14, 16, and/or 17. 889d = 379h is the status port, which reads in
pins 10, 11, 10, 13, and 15.
So, theoretically, you could set, say, pin 14 and use it as a "chip
select" for an 8-bit latch, or register. Write the data to 888,
read the memory byte where you've stashed your memory of the last
byte written, (where C1 is high) AND it with FEh to send the strobe
pulse, output that to 890 decimal, OR the byte with 1, send it, and
send 01 to turn off the pin 14 chip select. Now you've latched a
byte. You can use that to create chip selects to capture output
from the data port to any other latch - but you'd have to write
a 1 to, say, C2 (04h) to enable your "data" latch, write the
data to whichever of the other bank of latches has been selected
by the control latch. Or you could just pick either/or with one
of the other control bits - you could address 8 different ports
by manipulating 3 of the control bits. And you could decode one
8-bit port to address one of up to 256 outputs.
Have Fun!
Rich
Pin 1 is the strobe, which they say is active low; I'm guessing that theyDominic-Luc Webb wrote:
May I ask if you can take advantage of any of the status bits?
This is entirely possible. I've never played with the parallel port
before, so my first step today was to connect the 8 data pins up to
LEDs, all connected back to port 25 (ground) and see if I could send
data. (this worked - I have tacky dancing lights!)
I didn't touch the status ports, because I wasn't entirely sure if I
could use them in the same way as the data pins, or if they're
"special". Currently I'm using a horrible interop DLL (I'm writing
managed .NET code in C#) and writing to the dataports is simply a call like:
Output(888, 0); // All off
Output(888, 255); // All on
888 being the address of pin1. If I change this number, I don't know
what will happen - maybe the status ports are the same, maybe not. I'll
look it up tomorrow when I'm a little more awake
888 is the decimal address of pins 2 through 9, which is the data port.
mean that that one's inverted.
http://ee.cleversoul.com/parallel_port.html
http://www.galeon.com/jcgr/
http://www.infonewsindia.com/pinout/Index.html#6A
According to this chart, they've got LPT1 at 3BCh - that's wrong. It's
378h. 890d = 37Ah is the control port. You write to it to control pins
1, 14, 16, and/or 17. 889d = 379h is the status port, which reads in
pins 10, 11, 10, 13, and 15.
So, theoretically, you could set, say, pin 14 and use it as a "chip
select" for an 8-bit latch, or register. Write the data to 888,
read the memory byte where you've stashed your memory of the last
byte written, (where C1 is high) AND it with FEh to send the strobe
pulse, output that to 890 decimal, OR the byte with 1, send it, and
send 01 to turn off the pin 14 chip select. Now you've latched a
byte. You can use that to create chip selects to capture output
from the data port to any other latch - but you'd have to write
a 1 to, say, C2 (04h) to enable your "data" latch, write the
data to whichever of the other bank of latches has been selected
by the control latch. Or you could just pick either/or with one
of the other control bits - you could address 8 different ports
by manipulating 3 of the control bits. And you could decode one
8-bit port to address one of up to 256 outputs.
Have Fun!
Rich