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 CCS Technical Support

Direct of PIC for printer LPT?

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



Joined: 21 Feb 2007
Posts: 4

View user's profile Send private message

Direct of PIC for printer LPT?
PostPosted: Thu Feb 22, 2007 7:42 am     Reply with quote

Hello,

I need a code to print direct of PIC for a printer LPT.

For CCS 3.2.

Thankful

Buiz
buiz



Joined: 21 Feb 2007
Posts: 4

View user's profile Send private message

PostPosted: Sun Feb 25, 2007 8:53 am     Reply with quote

Any help will be well coming!

Buiz
Imanjl



Joined: 15 Nov 2004
Posts: 42

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Sun Feb 25, 2007 3:13 pm     Reply with quote

Searching the forum yielded these, that may help u :

http://www.ccsinfo.com/forum/viewtopic.php?t=4498&highlight=printer

http://www.ccsinfo.com/forum/viewtopic.php?t=19896
Guest








PostPosted: Sun Feb 25, 2007 3:24 pm     Reply with quote

Hi,

It's been a while since I've tried this, but I can tell you it isn't too hard. Basically, you need 10 I/O lines on the PIC to drive an LPT printer. The first 8 are the data lines D0 to D7 which are outputs from the PIC to the printer. The next line is the /Strobe line (active low) which the PIC stobes low for about 0.5us to tell the printer that data is available on the data bus (D0 - D7), and finally, the Busy line which is an input to the PIC from the printer indicating the printer is ready to accept data. Of course, you will a common GND connection between the PIC and the printer.

Basically, here is what you would do to send a character to the printer:

1. Place the ASCII code for the character on the D0 to D7 pins of the PIC.
2. Check to be sure that the Busy signal from printer is low.
3. Assert the Strobe signal low for 1uS

Continue this process until you have printed all the characters.

Give it a try yourself, and if you get stuck, I can probably dig up some code for you.

Charlie
buiz



Joined: 21 Feb 2007
Posts: 4

View user's profile Send private message

PostPosted: Mon Feb 26, 2007 4:10 pm     Reply with quote

hello Charlie

It could get some example, I am beginner and I have a lot of difficulties.

It would be very thankful for the force.

Hugs

Buiz
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Mon Feb 26, 2007 4:46 pm     Reply with quote

There was a Ciruit Cellar article from the July 2006 issue which deals with network-enabling an old dot-matrix printer. While it isn't entirely microcontroller-based, you may find some useful information in the article. The link to buy the article is here: http://www.circuitcellar.com/magazine/192toc.htm

Scroll down to the "Network-Enable Legacy Equipment" article by Kris Ardis.
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