parallel port out to PC USB in? - Page 1
Forum section: electronics / general

author: FriedMule
author_rank: Frequent Contributor
timestamp: October 25, 2019, 07:19:51 am
content: I have an old Audio Precision ATS-1 that can deliver it's testing result direct to a printer, using a parallel port, using PCL (old HP compatible).Is it in any way possible to direct that output to an USB in and grab that as an image or something else?

author: Ian.M
author_rank: Super Contributor
timestamp: October 25, 2019, 08:57:36 am
content: A parallel port as seeen by old dumbish printers is just eight bits of output data, a strobe to indicate a new byte is there, and a busy signal to tell the PC to hold off sending more data + a few status lines. IIRC there's a FTDI USB <=> parallel chip that can handle that more or less auto-magically, but then you'll have to code to FTDI's propriatary drivers on the PC side.If you use a MCU with USB and a parallel slave port, you can do the same with more control over the format of the data the PC is presented with. e.g. masquerade as a COM port and stream the PCL to the PC, to log to a file for later processing by a graphics program that understands PCL import.You could even handle the job on an Arduino, provided you added an external flipflop to handle the strobe/busy handshaking to 'hold off' the data stream till your sketch has processed the current byte. Hint: Strobe goes to Set, then the Arduino clocks in a '0' to clear the busy signal. I cant remember whether the handshakes are active high or active low so there may be a few inverters involved.

author: bw2341
author_rank: Regular Contributor
timestamp: October 25, 2019, 06:28:05 pm
content: I remembered a similar topic!https://www.eevblog.com/forum/chat/looking-for-help-capture-printer-data-on-parallel-port/Someone created a product for this exact problem.http://www.retroprinter.com/about-the-retro-printer/what-does-the-retro-printer-do/

author: FriedMule
author_rank: Frequent Contributor
timestamp: October 25, 2019, 09:25:44 pm
content: Thanks both of you! :-) I'll try to do as you write:-)

author: FriedMule
author_rank: Frequent Contributor
timestamp: October 26, 2019, 08:23:30 pm
content: Quote from: bw2341 on October 25, 2019, 06:28:05 pmSorry but could only find one version of the "The retro printer" on there page, it is using a GPIB port. But is it so simple that I can just ad an adapter from parallel port to GPIB and then mount "The retro printer" ?

author: bw2341
author_rank: Regular Contributor
timestamp: October 27, 2019, 03:13:04 am
content: It looks like the Retro-Printer plugs into the GPIO of a Raspberry Pi. The software to interpret the Epson printer codes was written by the designer and runs on the Raspberry Pi. The supported output options include text only, PDF, or the raw printer stream. Since the Raspberry Pi is a full computer, you can render the PDF (with Ghostscript?) and send it directly to a modern printer. (via CUPS?)It looks like PCL input is supported, but relies on downloading, compiling and installing GhostPCL, a PCL interpreter from the Ghostscript developers.So it looks like you have to add the cost of a Raspberry Pi, but you end up with a very flexible solution.

author: james_s
author_rank: Super Contributor
timestamp: October 27, 2019, 03:46:59 am
content: Quote from: Ian.M on October 25, 2019, 08:57:36 amWould you even need the external logic? I haven't added up the number of pins and it's been a long time since I've done much digging into parallel printer ports but couldn't you just have the Arduino (or whatever uC) read the strobe and manipulate the busy signal to start and stop the data coming in? It should be possible to do everything in firmware. Shouldn't need to process the incoming byte, just have strobe trigger a hardware interrupt that loads a byte into a variable. The Arduino language is a bit cumbersome doing this but it should be possible to do.

author: magic
author_rank: Super Contributor
timestamp: October 27, 2019, 07:46:46 am
content: I think it depends on how the master handles BUSY. If it waits for busy to toggle up and down then OK, if it assumes that BUSY comes up immediately and enters a loop waiting for BUSY to go down, that could be a problem if it enters the loop before your IRQ raises BUSY.Perhaps the SPI slave peripheral could be used to implement fast-acting BUSY response?That being said, interrupt latency can be pushed below 1µs.

author: james_s
author_rank: Super Contributor
timestamp: October 27, 2019, 05:37:49 pm
content: This kind of makes me want to experiment with that, certainly a small CPLD could do this very easily but it would be interesting to see if it can be done with just a microcontroller. The parallel ports at least on old PCs prior to the various enhanced modes were not particularly fast. By the time I was knowledgeable enough to really dig into something like this, parallel ports were largely obsolete.

author: RWAP
author_rank: Newbie
timestamp: February 02, 2020, 09:05:49 am
content: I have just come across this topic. I am the person behind the Retro-Printer module (www.retroprinter.com).If your equipment generates PCL output, then yes you should be able to capture it on an Arduino or similar and use GhostPCL to convert it to a PDF and print via CUPS.The main issues we found in developing the Retro-Printer was timing of signals which is critical - not all equipment seems to wait for the ACK signal before sending the next byte, and some equipment is also quite choosy as to needing 5V on certain pins otherwise it refuses to accept that a printer is attached!

author: james_s
author_rank: Super Contributor
timestamp: February 03, 2020, 07:43:08 pm
content: At this point what I'd really like to see is a GPIB virtual plotter that can save on SD cards or pipe it to a PC via USB. I've got too many projects on my plate already though.

author: RWAP
author_rank: Newbie
timestamp: February 03, 2020, 09:29:16 pm
content: I guess what you are trying to replicate is something like:https://www.audon.co.uk/comsgpib/gpibusb.htmlIt is hard to know how much demand there would be for such a project - there are various adaptors I have found on google, although many are now discontinued and cost around $300-$500.This is something which should be achievable with a Raspberry Pi and HAT similar to the Retro-Printer, but would need a lot of testing and development to ensure that the signals from a GPIB port were being captured and converted.If someone is willing to work on this, then we may be interested, but realistically, you need to be looking at a market of at least 200-300 devices to make the return on investment worthwhile.The other option would be to do it as a hobby type project where the boards are self-built, but then the price per unit would be much higher.

author: james_s
author_rank: Super Contributor
timestamp: February 04, 2020, 01:00:04 am
content: I assumed self built hobby project is what we were discussing. I already have an arduino based GPIB interface so I know it's doable, I don't think the one I'm using can emulate a plotter or printer but the hardware or something similar ought to be able to do it. The plotter protocol can't possibly be very complex given the sort of hardware it originally was implemented with.