Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing Thermal Printer Using MikroC

Status
Not open for further replies.
Re: interfacing thermal printer with microcontroller

You don't necessarily need "commands" to print out lines of text. They are understood by any usual printer without special settings, just use a carriage linefeed sequence to print a line.

Nevertheless it seems like there's a user manual downloadable under the link you gave, containing commands and such.
 
do u mean i only send data to printer like LCD?
Not need special setting?
what about adafruit software???
i want to connect PIC to this printer directly , this program for what?
thanks 4 your replay :)
 

do u mean i only send data to printer like LCD?
Rather like typing text in a terminal program.

I'm not familiar with the specific printer, you need to check the manual if the serial interface uses 5V UART level, that connects directly to a processor or RS232 level that must be translated by a MAX232 IC. Also the baud rate setting method should be documented.
 
could you see this file 4 me plzzzzzz?
https://www.adafruit.com/datasheets/A2-user manual.pdf

page 9 say : ESC/POS PRINTING COMMAND SET
in mikroC , i don't need this command right?

i want to use any small printer 4 my project
could you advice me specific printer work easy ?
realy thanks 4 your help
 

I have answered the question before, as far as it's possible based on the present information. You don't need specific printer commands to print lines of text. You may want to use to set specific attributes, e.g. character types or size or to print graphics.
 
i can's understand how i write lines by mikroC ?
there isn't any library 4 printer to send data to printer to print it , could u explain more plz ?
 

u mean if
i connect the printer directly with pic with uart_write(mydata)
it will print easily?
 

The PIC uart can connect directly to the printer's TTL interface. According to the informations in your link, the baudrate can be either 19200 or 9600 baud.
 
could u tell me how to connect any "small printer" directly with pic ?
could u advice me any type of printer i will use?
 

could u tell me how to connect any "small printer" directly with pic ?
could u advice me any type of printer i will use?

Any printer with an RS232 interface is easy to connect. If it supports ESC/P (old Epson printer compatible mode) then it is easy to print to, just like the one you have discussed already. Many POS terminal printers are this type.

Any printer with a parallel (Centronics) interface is not as easy to connect as RS232, but it can still be done. It needs more connections and you will have to write software to control the parallel interface. Again, it needs to support ESC/P to be easy to use.

That's all that you can easily do with a simple PIC or Atmel MCU.

Standard desktop printers rarely come with serial or parallel (Centronics) interfaces now, they are nearly always USB only. But, if you find one that has RS232 or parallel, check if it also supports ESC/p (or it says it is Epson or MS-DOS compatible).

ESC/P is the control language of the printer. If you just send printable characters, the printer will print them. It is that simple.

Link to read about ESC/P: https://en.wikipedia.org/wiki/ESC/P
 
u mean
if i want to print data from pic connected directly with printer from data stored in pic without computer ( without using c++ program to send data to printer)
-i will bought serial printer with RS232 interface supports ESC/P ?
i want to know how to use this ( ESC/P ) mode with MikroC compiler ?
thanks bro 4 help
 

FoxyRick : the last question
finally
do u mean if i write in program ( uart_write("string") ) and send to printer interface it will print and appear in paper ......correct?

You don't need specific printer commands to print lines of text. You may want to use to set specific attributes, e.g. character types or size or to print graphics.
do u know what it mean attributes?

- - - Updated - - -

http://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic32/help/printout_library.htm this is printout in mikroC
did he mean this attribute in library of printout ?
 

do u mean if i write in program ( uart_write("string") ) and send to printer interface it will print and appear in paper ......correct?

Correct.

do u know what it mean attributes?

Attributes are things like bold, italic, underline and other things that the printer can do with the text that you send.

For example, you could send the ESC/P control code to turn on bold printing (the control codes to do that are 0x1B followed by 0x45) then the text that you send will be printed in bold typeface. Then, you would turn bold off again by sending the control code to turn it off (0x1B, 0x46).

There are many other things that the printer might be able to do, and many other control codes for those things. See the links I gave you, or here is another website with them: https://www-01.ibm.com/support/docview.wss?uid=nas1fc1d7250de9fbe02862573fe00666ef5

Note in the example I gave, that both codes start with 0x1B. That is the Escape character (abbreviated Esc, hence the ESC in the name ESC/P) code on a PC keyboard. It is not a printable character (like the letter 'A' or symbol '%') - it has no symbol itself. It is used to tell the printer that you are sending a control code, instead of text for printing. The byte that follows the Escape character is interpreted as the command.

Now, read those documents and see what else it is possible to do with these printers and control codes.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top