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

How can I interface PIC to Printer

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



Joined: 02 Jan 2007
Posts: 15

View user's profile Send private message

How can I interface PIC to Printer
PostPosted: Sat Jun 20, 2009 9:52 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sat Jun 20, 2009 11:02 am     Reply with quote

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

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

RE:
PostPosted: Sat Jun 20, 2009 11:30 pm     Reply with quote

what 'POS serial Printer' are you using....?

thanks
arunb
creative_35



Joined: 02 Jan 2007
Posts: 15

View user's profile Send private message

PostPosted: Fri Jun 26, 2009 4:23 pm     Reply with quote

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

View user's profile Send private message

Re: RE:
PostPosted: Fri Jun 26, 2009 4:25 pm     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Fri Jun 26, 2009 10:00 pm     Reply with quote

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

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

post printer model name..
PostPosted: Sat Jun 27, 2009 1:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jun 27, 2009 6:35 am     Reply with quote

@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

View user's profile Send private message

PostPosted: Sun Jun 28, 2009 12:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jun 28, 2009 4:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jun 28, 2009 7:14 pm     Reply with quote

Thankyou, now I can draw the track with rts /cts.
I always used to do the PCB first Smile
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Mon Jun 29, 2009 9:01 am     Reply with quote

creative_35 wrote:
Thankyou, now I can draw the track with rts /cts.
I always used to do the PCB first Smile
You shoul consider buying printer and testing it with PC before drawing tracks Wink
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