J
Jon Slaughter
- Jan 1, 1970
- 0
Does anyone know how the open collector control port in the SPP is
+5
|
4.7 kohm
|
R____|________ TTL input/output
| out
|/
W---|
|\
|
Gnd
I can't seem to find anything that shows how the port is read from and I'm
trying to understand its behavior when reading based on it. The above is
just what I think it probably is but I could be wrong. When reading from
the port W must be 0 and then R follows out. But this isn't quite true
because R seems to latch W to 1 and I have to write W = 0 to allow R to
follow out again.
Basically I'm trying to setup an input and output line into a control port
pin. I read that I have to use all the pins as either input or output but
not mixed? This is probably because I have to reset the pin and I cannot do
them individually? If this is the case then I have to use a status port pin
to read the line when it is working as an input?... which makes it more
complicated.
This is where I'm getting most of my info:
http://www.beyondlogic.org/spp/parallel.htm
and this is specifically where I'm having trouble:
"An external 4.7k resistor can be used to pull the pin high. I wouldn't use
anything lower, just in case you do have an internal pull up resistor, as
the external resistor would act in parallel giving effectively, a lower
value pull up resistor. When in high impedance state the pin on the Parallel
Port is high (+5v). When in this state, your external device can pull the
pin low and have the control port change read a different value. This way
the 4 pins of the Control Port can be used for bi-directional data transfer.
However the Control Port must be set to xxxx0100 to be able to read data,
that is all pins to be +5v at the port so that you can pull it down to GND
(logic 0)."
Not sure why I have to really do all port pins for bi-direction. (Obviously
I can't read and write at the same time but I think I can interleave them to
get what I want)
Any ideas?
Thanks,
Jon
+5
|
4.7 kohm
|
R____|________ TTL input/output
| out
|/
W---|
|\
|
Gnd
I can't seem to find anything that shows how the port is read from and I'm
trying to understand its behavior when reading based on it. The above is
just what I think it probably is but I could be wrong. When reading from
the port W must be 0 and then R follows out. But this isn't quite true
because R seems to latch W to 1 and I have to write W = 0 to allow R to
follow out again.
Basically I'm trying to setup an input and output line into a control port
pin. I read that I have to use all the pins as either input or output but
not mixed? This is probably because I have to reset the pin and I cannot do
them individually? If this is the case then I have to use a status port pin
to read the line when it is working as an input?... which makes it more
complicated.
This is where I'm getting most of my info:
http://www.beyondlogic.org/spp/parallel.htm
and this is specifically where I'm having trouble:
"An external 4.7k resistor can be used to pull the pin high. I wouldn't use
anything lower, just in case you do have an internal pull up resistor, as
the external resistor would act in parallel giving effectively, a lower
value pull up resistor. When in high impedance state the pin on the Parallel
Port is high (+5v). When in this state, your external device can pull the
pin low and have the control port change read a different value. This way
the 4 pins of the Control Port can be used for bi-directional data transfer.
However the Control Port must be set to xxxx0100 to be able to read data,
that is all pins to be +5v at the port so that you can pull it down to GND
(logic 0)."
Not sure why I have to really do all port pins for bi-direction. (Obviously
I can't read and write at the same time but I think I can interleave them to
get what I want)
Any ideas?
Thanks,
Jon