Electrical – How to control thermal printer from micro-controller and choose it

developmentinterfacemicrocontrollerserial

The project is to print barcode and some text with thermal printer using micro-controller. Initially I chose RP58 which has this command set and serial port.

  1. So to control the printer, do I just have to send bytes according to the command set, only? (Since I'm buying new one, I want to confirm).
  2. And in the document, "2.LF" is to print data in "print buffer", but I couldn't find command to set data in print buffer. But I guess, If I send "ON" using "47.ESC = n" command, printer might receive data into print buffer. How does printers usually receive their printing data (or texts).
  3. Since I'm using printer for development purpose, do you have better suggestions? I'm looking for printers, which are cheap, easy to acquire and work with using controller.

Best Answer

Although I have not used that specific printer, I'll answer based on previous experience with similar printers.

  1. So to control the printer, do I just have to send bytes according to the command set, only?

You should also consider the interface handshaking, to avoid over-running the input buffer of the printer. That's why it is best not to send commands "blind" to the printer, but check the state of the hardware or XON/XOFF handshake (whichever you configured on the printer), before sending commands or data.

Since the printer uses an RS-232 serial interface, not logic-level, you will need to use suitable interface ICs for the data and handshaking signals from your MCU. See the printer's user manual for more details about the handshaking signals used by the printer.

On the download page of the manufacturer's website for that printer, the "58 Driver & Tool" download for the RP58 printer family contains a Windows utility in the "PrinterTool" folder, to set hardware or XON/XOFF handshaking, serial data rate, and other initial printer settings.

  1. And in the document, "2.LF" is to print data in "print buffer", but I couldn't find command to set data in print buffer.

To send printable characters to the printer, you just send the relevant ASCII bytes e.g. send the byte 0x31 followed by Line Feed (0x0A) to print the character "1" on the paper. Again, take care about the handshaking.

But I guess, If I send "ON" using "47.ESC = n" command, printer might receive data into print buffer.

I expect the default state when starting the printer, would be that it will be "online", so that this command is unlikely to be necessary unless you have sent the "offline" command first.

How does printers usually receive their printing data (or texts).

As I explained above - just send the ASCII characters, followed by LF (0x0A) when needed.

  1. Since I'm using printer for development purpose, do you have better suggestions? I'm looking for printers, which are cheap, easy to acquire and work with using controller.

That is a shopping question and so it is off-topic. Remember, readers cannot know what is cheap for you, easy to acquire for you, and all your other purchasing considerations (e.g. good technical support, on-going hardware availability etc.).

Related Topic