It’s never a good idea to let signals float around in the no-man’s land between the high state and the low state. This is why we so often use pullup and pulldown resistors. You set the line to a known, definite state by default and then switch it as necessary.
Some uses of pullup and pulldown resistors are obvious. Some are part of the specification (the SDA and SCL lines of an I2C bus, for example, should have pullups). But sometimes the decision isn’t so clear-cut.
Let’s take a look at the signal lines involved with the most common form of the Centronics parallel printer interface and thoughts about whether they should have pullups or pulldowns on my SmartParallel interface board.
In this summary, I’ll refer to signals I measured on both the Epson MX-80 F/T III dot matrix printer’s Centronics port and a parallel port on a Dell PC when neither one was connected to anything.
/STROBE, /INIT and /AUTOFEED: These are outputs from the host (inputs to the printer). They are active low. The /STROBE signal is sent to indicate that data is ready on the bus while /INIT causes a printer reset. Both are sent as pulses. Rogue signals on these lines can cause all sorts of mayhem.
/AUTOFEED tells the printer to perform a line feed whenever it is sent a carriage return (in addition to performing the CR itself).
These lines are held high by default by both the Epson and the Dell, and it seems a no-brainer that the lines should have pullup resistors (I’m using 10kΩ) on the SmartParallel.
As these lines are managed by the microcontroller, you could argue that one can simply set the signals high via software. But there’s always the issue of what happens while the board and microcontroller are powering up. Pullups just add certainty.
/ACK and /ERROR: These are outputs from the printer. /ACK is pulsed low during the process of transmitting a character and /ERROR is taken low when … well, when there’s an error. These are both active low and so I think deserve pullup resistors.
BUSY and PAPER END (PE): These are outputs from the printer and are active high. The meaning of each signal should be self-explanatory. The Epson holds these lines low by default. The Dell, interestingly, has pullups on these signals. This might be one way of detecting whether a printer is present. But my feeling for the present is to not use pullups (or pulldowns, which would also make sense) on these lines.
/SELECT-IN: This is an output from the host. It’s active low in that a low signal from the host tells the printer ‘you have been selected’. However, it was often ignored completely. This is the only signal I don’t have going via a buffer on the SmartParallel. Both the Epson and Dell have this pulled low by default, so there might be an argument for adding a pulldown resistor. But I’m going to leave it alone for the time being, simply setting the relevant GPIO low on the microcontroller. But my gut says this should have a pulldown. I’m even toying with the idea of pulling this down to ground and not even connecting it to the microcontroller at all.
SELECT: I’ve left this one until last because it’s the one that has caused me most head-scratching. SELECT is an output from the printer and is active high. Basically, when this line is high, the printer is saying ‘I am selected’, which is another way of saying ‘I am online’. Hitting the ‘On-Line’ toggle button on the printer, for example, toggles the state of this signal.
The Epson and Dell both take this line high by default. But my first instinct, when I drew up the initial schematic, was to add a pulldown resistor. Why? My thinking was that, if no printer is attached, this line should not go high. Why would it indicate an ‘online’ printer where there’s no printer at all? The fact that the Dell pulls this high was a surprise. But having a definite value is certainly desirable.
My instinct at the moment is to add a pullup, but I may experiment with a pulldown.
So this is the state of play as I mess around with creating a stripboard version of the interface: /STROBE, /INIT, /AUTOFEED, /ACK, /ERROR and SELECT will all get pullup resistors. BUSY and PE won’t get pullups or pulldowns (but may get pullups in the future). And /SELECT-IN won’t have anything for now, but may be graced with a pulldown quite soon.