View previous topic :: View next topic |
Author |
Message |
buiz
Joined: 21 Feb 2007 Posts: 4
|
Direct of PIC for printer LPT? |
Posted: Thu Feb 22, 2007 7:42 am |
|
|
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
|
|
Posted: Sun Feb 25, 2007 8:53 am |
|
|
Any help will be well coming!
Buiz |
|
|
Imanjl
Joined: 15 Nov 2004 Posts: 42
|
|
|
Guest
|
|
Posted: Sun Feb 25, 2007 3:24 pm |
|
|
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
|
|
Posted: Mon Feb 26, 2007 4:10 pm |
|
|
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: 1908
|
|
Posted: Mon Feb 26, 2007 4:46 pm |
|
|
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. |
|
|
|