|
Parallel Printer Port for your Space-Time Z80 Computer
With as much serial and digital I/O as the Space-Time Productions computer has on it, you would think there would be little reason for a parallel printer port. This actually arises more from running BASIC on your computer than it does from anything else. There is also the (remote) possibility of running CP/M on this board, in which case it would be nice to have a LIST: device available. Some applications might have a need to print I/O state changes with time-stamp if you are using it for security monitoring or industrial control. Using the 8255 While the 8255 could be programmed in Mode 0 to be a parallel printer port, it would require that one port be used to output printer data and a second port to output the Pin 1 /STROBE signal. This would probably fall to port C of the 8255 as half of it could be configured for output and the other nybble be programmed to input /BUSY and /ACK from the printer. If you went much more elaborate than that, you could end up expending an entire 8255 to run a parallel port for all the handshaking signals that would need to be present for ECP or EPP mode. (5 input lines, 4 output lines + data would have to be bi-directional)
There is some question about using the 8255 in Mode 1 to do the handshaking. I have searched all over the Internet for an article on how to use an 8255 to drive a parallel printer port, and have not come up with anything as of yet; so I am curious as it if it would work or not. In this output mode, Port A0-A7 bits are the output data, Port PC7 is /OBF (Output Buffer Full), this signal would become the parallel port signal /STROBE. This signal would remain low on OBF until an incoming signal on the 8255 PC2 called /ACK was driven low by the printer. for Port B0-B7 to handle the data, the /STROBE or /OBF signal is on PC1 and the /ACK is on PC2. In both instances there is another set of pins which generates a logic 1 (high) when the responding device has asserted /ACK. For Port A data, the INTR is on PC3. For Port B data, the INTR is on PC0. Using this methodology, the Z-80 could (theoretically) output data to a printer or other off-board device and go about it's merry business until an Interrupt is received from the 8255 stating the receiving device has picked up the byte. This series of handshaking events keeps the Z-80 from overrunning an offboard peripheral. In the real world, most printers today have good buffering and can accept a flurry of data from a computer before even starting to spin up a print job. In truth, it would probably be the Z-80 that is having to load the 8255 with a self-repetitive OTDR or OTIR command in order to keep the data flow up for the receiving device. Why this might not work: In every schematic that I've seen for parallel printer ports, the pin 1 signal /STROBE is almost always driven by a one-shot generator that defines the amount of time it is active low. The Tandy Model III and IV [my first electronics job] has a one-shot for the data strobe and I also stumbled fortunately across a circuit diagram for a Dick Smith System 80 computer port - actually two different schematics, both of which used nearly the same timing circuits as the Tandy computers for driving the /STROBE signal. In the instance of the 8255 The signal /OBF actually stays low until the receiving device drives /ACK low, which resets the /OBF signal. This is far different than what I've seen with other parallel port circuits. On the schematics, the one-shot that drives /STROBE is usually a 74LS123 Dual Monostable One-Shot. This is set up to provide a pulse in the neighborhood of 1µS (1 microsecond, or 0.000001 seconds). The way to roughly calc the pulse width on a 74LS123 is to take 0.28 * Rext * Cext. Using a small enough cap (in the pF range) will get you a very short pulse. I've seen one that calcs out to about 1.36 µSeconds on a proven-working schematic, and the standard says it must be a minimum of 0.5 µSeconds. The other big problem is that there is no /BUSY line to sample. So while the 8255 can go into these other Modes (1 and 2), I just am not sure if they could be configured to handle a parallel printer port in this way or not. If you have comment or experience in this area, I'd appreciate hearing from you on the subject.
Using discrete logic Most of what I present on this site for add-ons to the Space-Time Productions Z-80 computer are IC's that I have glued together in some config and hand wired. It's the easiest for me and the cheapest option, since I have a pretty good wealth of IC's and Radio Shack still sells pre-printed project PCB's. (This in spite of the fact that they've narrowed their component inventory down to where it is useless). This project is no different, I'm offering a glue-logic solution to create a simple uni-directional parallel printer port for your Z-80. I would go into a bi-directional port, but there isn't any reason for this and I don't think the Z-80 is really quite fast enough at 2 MHz to keep up with scanners, etc and the EPP or ECP mode of printing. With that said, and you have need to spool BASIC programs or real-time data off to a printer, this might be just the solution you need. Essentially I use a 74LS374 as an output port to latch the printer data. The 74LS367 is a tri-state buffer of the kind already in use on the ST Z-80, and I use this to read in the status signals from the printer. the 74LS123 acts as a dual function one-shot. The first monostable outputs the /STROBE signal to the peripheral device. The time period for this is about 1.3 µSeconds, pretty much the industry standard. The second monostable outputs a signal which is fed by OR gate back into the 74LS367 to signal the Z-80 the device is BUSY. This time is about 560 µSeconds - A pretty long time in computer standards. This should allow the receiving device plenty of time to process the printed byte, but feel free to eliminate this part of the circuit if you are using a more modern printer. I'm sure by the time you write a byte to a buffered laser printer, it is ready for the next one immediately - wasting time having the Z-80 even bother to check the line - haha. This is included more for posterity sake for those of you still using vintage printers to go with your vintage computer. A 74LS32 Quad 2-input OR gate is used to gate the I/O select line for the AMD 9513 along with /IORD and /IOWR in order to enable the appropriate IC for input or output. The third gate is used to mix the printer's own BUSY signal with the timing chain so that either condition will signal a BUSY state back to the Z-80. The pin numbers I have identified on the schematic are for a DB25 Female, which is what you'll find on the few remaining PC parallel ports. [These are quickly disappearing from today's PC's as everyone thinks USB is the way to go for all peripherals). A standard cable will connect between the DB25 and the printer's Centronics connector. Surprisingly, although PC's are removing the DB25F parallel port connectors, the printers are retaining their parallel connectors, at least the professional printers I've been seing (not those home consumer printers). Here's the schematic:
Click HERE if you do not see a menu frame to the left.
All information contained herein that is generated by J.Owens ©2007 ©2008. |