View previous topic :: View next topic |
Author |
Message |
arunkish
Joined: 23 Dec 2008 Posts: 83
|
Interfacing Printer output to PIC |
Posted: Sun Oct 02, 2011 8:34 pm |
|
|
Hello
I have a device which outputs some reports generated directly to the printer in PCL format. I am planning to read the output from the device using PIC and send the data to the PC using RS232, later I will convert the PCL file into an image or PDF etc. Is this possible ? What hardware should I use, have anyone done this before? Please advice.
Best Wishes. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Oct 02, 2011 10:15 pm |
|
|
on a PIC? ouch.
Take a look at GhostScript for Unix to get an idea of what you're digging into.
It's open source, so you can download to anywhere and look at the source code.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Mon Oct 03, 2011 2:01 am |
|
|
Converting the PCL to an image, as bkamen says, difficult.
However, simply taking the data from the port, and sending it on, 'possible'. However you need to think about the timings involved. If this is coming from a conventional parallel port, speeds up to perhaps 500MB/sec, will be quite likely. You can delay the output, but depending on the implementation of the port, you may find that data keeps coming for several hundred bytes after you assert the 'busy' line back to the device. Given that the serial link is going to transfer 'at best' perhaps 10KB/sec, and more typically 1KB/sec, you need to verify that the device does accept at least handshake signals, and busy signals, and what the timings involved are. PIC's with a PSP port, will be the easiest to use for the connection.
Such converters are 'off the shelf' items though. Are you sure you are not re-inventing the wheel?.
<http://www.etabg.com/rs232c.html>
<http://www.telebyteusa.com/catalog/manuals/m109a.htm>
<http://www.blackbox.com/Store/Detail.aspx/Parallel-Converter-V-DB9-Centronics/PI045A>
Best Wishes |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Mon Oct 03, 2011 6:38 am |
|
|
Converting the data from 'printer port 8 bits' to 'RS-232 serial' is easy and there are modules available though pricey ($138 from Black Box !) as opposed to a $5 PIC and some connectors.
Be careful with store bought units as you want Parallel TO Serial....most are the other way round !!
The easy solution is using a PIC with the PSP peripheral like the 16F877.The 'trick' is to utilize a pair of circular buffers and ISRs to achieve high data transfers to the PC.You can get almost 1 megabaud rate this way.With an 18F4550 you can get over 1M baud.
Total cost, one off,all new parts may be $50. |
|
|
|