B&B Electronics Parallel Printer Card PIOC Manuale Utente Pagina 9

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 17
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 8
Interfacing the Standard Parallel Port http://www.senet.com.au/~cpeacock
Interfacing the Standard Parallel Port Page 9
Bi-directional ports use Control Bit 5 connected to the 374's OE so that it's output drivers can
be turned off. This way you can read data present on the Parallel Port's Data Pins, without having bus
conflicts and excessive current drains.
Bit 5 of the Control Port enables or disables the bi-directional function of the Parallel Port.
This is only available on true bi-directional ports. When this bit is set to one, pins 2 to 9 go into high
impedance state. Once in this state you can enter data on these lines and retrieve it from the Data Port
(base address). Any data which is written to the data port will be stored but will not be available at the
data pins. To turn off bi-directional mode, set bit 5 of the Control Port to '0'.
However not all ports behave in the same way. Other ports may require setting bit 6 of the
Control Port to enable Bi-directional mode and setting of Bit 5 to dis-enable Bi-directional mode,
Different manufacturers implement their bi-directional ports in different ways. If you wish to use your
Bi-directional port to input data, test it with a logic probe or multimeter first to make sure it is in bi-
directional mode.
Using The Parallel Port to Input 8 Bits.
If your Parallel Port doesn't support bi-directional mode, don't despair. You can input a
maximum of 9 bits at any one given time. To do this you can use the 5 input lines of the Status Port
and the 4 inputs (open collector) lines of the Control Port.
The inputs to the Parallel Port has be chosen as such, to make life easier for us. Busy just
happens to be the MSB (Bit 7) of the Status Port, then in ascending order comes Ack, Paper Out and
Select, making up the most significant nibble of the Control Port. The Bars are used to represent
which inputs are Hardware inverted, i.e. +5v will read 0 from the register, while GND will read 1. The
Status Port only has one inverted input.
The Control port is used to read the least significant nibble. As described before, the control
port has open collector outputs, i.e. two possible states, high impedance and GND. If we connect our
inputs directly to the port (For example an ADC0804 with totem pole outputs) , a conflict will result if
the input is high and the port is trying to pull it down. Therefore we use open collector inverters.
However this is not always entirely necessary. If we were connecting single pole switches to
the port with a pull up resistor, then there is no need to bother with this protection. Also if your
software initializes the control port with xxxx0100 so that all the pins on the control port are high,
Vedere la pagina 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Commenti su questo manuale

Nessun commento