Author Topic: parallel port out to PC USB in?  (Read 1823 times)

0 Members and 1 Guest are viewing this topic.

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
parallel port out to PC USB in?
« on: October 25, 2019, 07:19:51 am »
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?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13076
Re: parallel port out to PC USB in?
« Reply #1 on: October 25, 2019, 08:57:36 am »
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.
 

Offline bw2341

  • Regular Contributor
  • *
  • Posts: 163
  • Country: ca
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: parallel port out to PC USB in?
« Reply #3 on: October 25, 2019, 09:25:44 pm »
Thanks both of you! :-) I'll try to do as you write:-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: parallel port out to PC USB in?
« Reply #4 on: October 26, 2019, 08:23:30 pm »
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/
Sorry 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" ?
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline bw2341

  • Regular Contributor
  • *
  • Posts: 163
  • Country: ca
Re: parallel port out to PC USB in?
« Reply #5 on: October 27, 2019, 03:13:04 am »
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.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: parallel port out to PC USB in?
« Reply #6 on: October 27, 2019, 03:46:59 am »
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.

Would 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.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7183
  • Country: pl
Re: parallel port out to PC USB in?
« Reply #7 on: October 27, 2019, 07:46:46 am »
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.
« Last Edit: October 27, 2019, 07:48:40 am by magic »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: parallel port out to PC USB in?
« Reply #8 on: October 27, 2019, 05:37:49 pm »
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.
 

Offline RWAP

  • Newbie
  • Posts: 7
  • Country: gb
Re: parallel port out to PC USB in?
« Reply #9 on: February 02, 2020, 09:05:49 am »
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!
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: parallel port out to PC USB in?
« Reply #10 on: February 03, 2020, 07:43:08 pm »
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.
 

Offline RWAP

  • Newbie
  • Posts: 7
  • Country: gb
Re: parallel port out to PC USB in?
« Reply #11 on: February 03, 2020, 09:29:16 pm »
I guess what you are trying to replicate is something like: https://www.audon.co.uk/comsgpib/gpibusb.html

It 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.

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: parallel port out to PC USB in?
« Reply #12 on: February 04, 2020, 01:00:04 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf