View previous topic :: View next topic |
Author |
Message |
creative_35
Joined: 02 Jan 2007 Posts: 15
|
How can I interface PIC to Printer |
Posted: Sat Jun 20, 2009 9:52 am |
|
|
Hi friends,
How can I interface a POS serial Printer to Microcontroller? Do I need a max232? what connections of a serial port necessory to print? I need a circuit diagram. Thanks in Advance. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sat Jun 20, 2009 11:02 am |
|
|
What you want is standard i/o printf - serial services - RS 232 - then you get formatting - all sorts of help driving the printer and don't forget the \r\n - since most/all older POS printers are serial rs 232 operated.
SO
Yes you will need a MAX232 or similar part like HIN202 etc
and you will need to alter your schematic - and yes
you do need a circuit for that.
This is probably the wrong place to look for somebody to do your design and coding for you though.
Expend some effort on both the hardware and software front - and I'm sure folks will chime in with suggestions.
My rule is :
if ( !effort_expended ) help =0; |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Sat Jun 20, 2009 11:30 pm |
|
|
what 'POS serial Printer' are you using....?
thanks
arunb |
|
|
creative_35
Joined: 02 Jan 2007 Posts: 15
|
|
Posted: Fri Jun 26, 2009 4:23 pm |
|
|
asmboy wrote: |
This is probably the wrong place to look for somebody to do your design and coding for you though.
Expend some effort on both the hardware and software front - and I'm sure folks will chime in with suggestions.
My rule is :
if ( !effort_expended ) help =0; |
Thanks for the effort you did for replying to this question. I didn't ask you to do any software or hardware for me. Just asked a sample circuit diagram to interface a printer in serial port. I will do the rest. Anyway you silently said that you don't know about it. |
|
|
creative_35
Joined: 02 Jan 2007 Posts: 15
|
Re: RE: |
Posted: Fri Jun 26, 2009 4:25 pm |
|
|
arunb wrote: | what 'POS serial Printer' are you using....?
thanks
arunb |
I think all serial printers are interfacing in a common method. Correct me if I am wrong, thankyou |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Jun 26, 2009 10:00 pm |
|
|
for basic text , \r\n ,tab, bs etc - yes consistent -
for graphics output -
there is some variation in ESC bit map method , mfgr dependant.
1- what do you want to print - lines of text or graphics ?
2- reiterating - what is your printer make and model ?
3- for other programs you have written already ,
how RU doing STDIO - now? -
getc, putc, printf and so on ?
what hardware circuit do you use for that already to get instructions and
communicate results to an outside host or modem?
4- read the MAX232 and your_pic data sheets
locate the rs 232 connections
the max 232 datasheet has a circuit you wont go wrong with.
go forth and prosper
l |
|
|
karthickiw
Joined: 09 Aug 2007 Posts: 82 Location: TN, India
|
post printer model name.. |
Posted: Sat Jun 27, 2009 1:50 am |
|
|
hi,
Are you using thermal printer? because most of POS contain thermal print. If you using thermal printer means, send the thermal printer model name and make . |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Sat Jun 27, 2009 6:35 am |
|
|
@creative: As for the HW part you need at least MAX232 or derivative of that. Considering the SW part. Diferent printer manufacturers have diferent style of driving the printer .... some manufacturers have diferent way per model. But generaly speaking you will probably be sendng ESC commands to the printer.
Also for the HW part how many connections you'll need is model dependant. Sometimes you'll get away with RX/TX/GND, another time there will be needed more connections like RTS/CTS ....
If you have specific question it is easier to answer. |
|
|
creative_35
Joined: 02 Jan 2007 Posts: 15
|
|
Posted: Sun Jun 28, 2009 12:28 am |
|
|
Thanks for all the replies,
Actually I am intending to buy a thermal printer connectable to a serial port. I know that I have to study commands for the specific printer.
I don't need graphics, just text only.
A serial port has so many pins CTS, RTS,DSR DTR,CD RI, RX,TX, SG.
Some printers may use all these pins. Some printers may use some of them.
Txd, RXd and Ground are necessary for all bidirectional communication.
My question is what are the minimum necessary pins for any printer except Txd, Rxd, and Ground to print some text and monitor printer busy condition?
I hope a serial printer may have RS232 included in its circuit. If I use RS232 in my hardware I think it may invert the signals. Am I right?
Do I need an isolation chip between the printer and my hardware to reduce noise from the printer?
And finally which printer commands are easy to study? Epson? Citizen?
Hope you got it. Thank you, |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Sun Jun 28, 2009 4:05 am |
|
|
Epson uses ESC commands, not so hard to implement.
Regarding minimum printer connection, usually it will do RX/TX/RTS/CTS. You will know when you try, that is the best method. Several years ago I interfaced epson dot matrix printer via serial port, I didn't use aditional ready/busy control and it was working with no problem. |
|
|
creative_35
Joined: 02 Jan 2007 Posts: 15
|
|
Posted: Sun Jun 28, 2009 7:14 pm |
|
|
Thankyou, now I can draw the track with rts /cts.
I always used to do the PCB first |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Mon Jun 29, 2009 9:01 am |
|
|
creative_35 wrote: | Thankyou, now I can draw the track with rts /cts.
I always used to do the PCB first | You shoul consider buying printer and testing it with PC before drawing tracks |
|
|
|