Parallel Printer Port driver for Z80 [message #9820] |
Wed, 16 March 2022 14:17  |
lynchaj
Messages: 1080 Registered: June 2016
|
Senior Member |
|
|
Hi
I am looking for Z80 assembler code example for a parallel printer port driver. This is for the Z80 PRINT V1 board just introduced for the Z80 MBC. Hopefully this code will be incorporated into RomWBW to support IBM PC compatible LPT: (aka Centronics)
This particular parallel port is implemented using discrete logic chips although there are several ways to implement such as using a PPI, PIO, etc. What I would like to capture is the parallel port protocol for handshaking with the parallel printer or other device
Any help greatly appreciated, Thanks, Andrew Lynch
|
|
|
|
|
Re: Parallel Printer Port driver for Z80 [message #9823 is a reply to message #9822] |
Thu, 17 March 2022 18:34  |
cluso99
Messages: 40 Registered: June 2017
|
Member |
|
|
Andrew,
The centronics interface is just a plain 8 bit parallel interface with a couple of pins for handshaking. There is no protocol as such. You just send the characters in ASCII to be printed and terminate with <cr> or <Cr><lf> depending on the printers' settings.
There are two ways for handshaking. Once you set the valid 8bit data out you strobe the data available pin (sorry, cannot recall precise naming) and then you either look for Busy to complete, or look for the data ack strobe to indicate completion of the character transfer. Either method works. Search for a Centronics protocol description - this is a standard that all printers comply with - I interfaced many of these to the mini I worked with in the 80's.
<ff> will advance the paper to TOF (top of form) although this may require a VFU (vertical format loop - used to be done with a punched paper tape loop on older printers) loop to be soft loaded, and this mechanism is often specific to the printer.
Some printers have extra character sets which can use the 8th ASCII bit, and others can use <esc> sequences or <si>...<so> sequences. All these are specific to the printer.
Hope this helps,
Ray
[Updated on: Thu, 17 March 2022 18:40] Report message to a moderator
|
|
|