CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Interfacing Printer output to PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

Interfacing Printer output to PIC
PostPosted: Sun Oct 02, 2011 8:34 pm     Reply with quote

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: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Oct 02, 2011 10:15 pm     Reply with quote

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: 19436

View user's profile Send private message

PostPosted: Mon Oct 03, 2011 2:01 am     Reply with quote

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: 9198
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Oct 03, 2011 6:38 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group