Parallel port how many bits
When IBM was in the process of designing the PC, the company wanted the computer to work with printers offered by Centronics , a top printer manufacturer at the time. IBM decided not to use the same port interface on the computer that Centronics used on the printer. Instead, IBM engineers coupled a pin connector, DB , with a pin Centronics connector to create a special cable to connect the printer to the computer. Other printer manufacturers ended up adopting the Centronics interface, making this strange hybrid cable an unlikely de facto standard.
When a PC sends data to a printer or other device using a parallel port, it sends 8 bits of data 1 byte at a time. These 8 bits are transmitted parallel to each other, as opposed to the same eight bits being transmitted serially all in a single row through a serial port.
The standard parallel port is capable of sending 50 to kilobytes of data per second. Sign up for our Newsletter! Mobile Newsletter banner close. Mobile Newsletter chat close. Mobile Newsletter chat dots. Mobile Newsletter chat avatar. Mobile Newsletter chat subscribe. You will generally need to select a lower speed if errors occur during data transfers.
Speed variations are: Kb, Kb, and 1Mb. Unlike serial ports which rely on a chip to do the data transmission, parallel data is handled entirely with software. Parallel ports have three registers:. The way in which data is transmitted over parallel ports varies, but a general description follows. The device on the other end normally a printer then asserts its BUSY line.
The other control lines are used for various purposes. The ERROR signal from the printer can be used for any type of error that would cause the printer to be unable to receive data. In general, if any of these signals are asserted, BUSY is also asserted. The PC has three additional output control lines.
Usage of these lines varies with the particular software and printer in use. In the original PC implementation, they are used as follows:. For example, when the software needed to change to a different font, it would deselect the printer. As stated earlier, not all of these controls lines are used in the same manner.
In addition to one bit of data, other control signals are also sent and received. Sending data one bit at a time is relatively slow, but serial ports have the advantage of using fewer wires to connect two devices and being able to communicate over relatively long cable distances.
Most serial ports can easily communicate over ft. In addition, there are a wide variety of serial peripherals available which make use of the standard RSC specification. Furthermore, recent advances have made serial data transmission reliable at higher data rates. These data rates are referred to as "bps" bits per second or "baud" rates.
The chip is designed to handle the higher data bus rates of the faster computers. The serial data communications however is identical to the It is beyond the scope of this lesson to describe the detailed workings of these chips.
Actually, a serial port consists of eight addresses and a parallel port has three. The address used to refer to a particular port is the first or BASE address. However this may not always be the case as explained later. The lower case h denotes that it is in hexadecimal. These addresses may change from machine to machine. If a Parallel card is found there, it is assigned the next free device label. The last port of call, is h and follows the same procedure than the other two ports. Therefore it is possible to have a LPT2 which is at h and not at the expected address h.
Now what address is LPT1? Life wasn't meant to be easy. Most of the time the base address is used to interface the port rather than LPT1 etc. When BIOS assigns addresses to your printer devices, it stores the address at specific locations in memory, so we can find them.
Each address will take up 2 bytes. The following sample program in C, shows how you can read these locations to obtain the addresses of your printer ports. The base address, usually called the Data Port or Data Register is simply used for outputting data on the Parallel Port's data lines Pins This register is normally a write only port. If you read from the port, you should get the last byte sent.
However if your port is bi-directional, you can receive data on this address. See Bi-directional Ports for more detail. Any data written to this port will be ignored. Please note that Bit 7 Busy is a active low input. Likewise with Bit 2. When a printer is attached to the Parallel Port, four "controls" are used. The printer would not send a signal to initialize the computer, nor would it tell the computer to use auto linefeed.
However these four outputs can also be used for inputs. If the computer has placed a pin high e. Therefore these lines are "open collector" outputs or open drain for CMOS devices. This means that it has two states. A low state 0v and a high impedance state open circuit.
Normally the Printer Card will have internal pull-up resistors, but as you would expect, not all will. Some may just have open collector outputs, while others may even have normal totem pole outputs. In order to make your device work correctly on as many Printer Ports as possible, you can use an external resistor as well.
Should you already have an internal resistor, then it will act in Parallel with it, or if you have Totem pole outputs, the resistor will act as a load. An external 4. 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 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. This mode is only possible if your card supports it. Any writes to these two bits will be ignored. The schematic diagram below, shows a simplified view of the Parallel Port's Data Register. The original Parallel Port card's implemented 74LS logic.
These days all this is crammed into one ASIC, but the theory of operation is still the same. The non bi-directional ports were manufactured with the 74LS's output enable tied permanent low, thus the data port is always output only. When you read the Parallel Port's data register, the data comes from the 74LS which is also connected to the data pins. Now if you can overdrive the ' you can effectively have a Bi-directional Port. What is very concerning is that people have actually done this.
I've seen one circuit, a scope connected to the Parallel Port distributed on the Internet. No wonder why. Others have had similar trouble, the 68HC11 cannot sink enough current 30 to 40mA! Bi-directional ports use Control Bit 5 connected to the 's Output Enable 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. 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. The Bars are used to represent which inputs are Hardware inverted, i.
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.
If we connect our inputs directly to the port For example an ADC 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 xxxx so that all the pins on the control port are high, then it may be unnecessary.
If however you don't bother and your device is connected to the Parallel Port before your software has a chance to initialize then you may encounter problems.
Another problem to be aware of is the pull up resistors on the control port. The average pull-up resistor is 4.
0コメント