16

I've purchased a Mini Thermal Printer from Adafruit. The documentation states:

This printer is ideal for interfacing with a microcontroller, you simply need a 3.3V to 5V TTL serial output from your microcontroller

Since the serial pins on the GPIO output at 3.3V I assumed that I could just connect the printer directly to the pins and it would just work without a protection circuit. Is that a naive assumption? What else do I need to do in order to use the printer?

Ghanima
  • 15,958
  • 17
  • 65
  • 125
Jivings
  • 22,656
  • 11
  • 94
  • 140

3 Answers3

5

The voltage levels are not a problem, a LVTTL logical '1' will also be a TTL logical '1'. The only issue can be the (sinking) current, as Alex Chamberlain already suggested. This can be a problem.

This sinking current depends on the input circuit of the printer, as we can only guess how it is constructed, it might be better to be safe then sorry!

So to be safe put a CMOS buffer in between. A 74LCX244 for example. If something would start to smoke then, it will not be your Raspberry Pi.

Edit: I noticed criticism about the current statements, to back this statement up:

Quote from klabs.org:

  • CMOS output stages can also be tricky and subtle device characteristics can cause errors. Check all specifications carefully! For example, many CMOS devices when driving loads are specified at only very low current levels for high or logic '1' signals. However, TTL inputs take substantial currents and do not present the high impedance seen by CMOS FET inputs and the output may be dragged down.

More information about this current issue here: 5 V TTL and CMOS Input and Output Voltage Levels:

  • CMOS -> TTL: you may need a buffer to handle extra sinking current when CMOS output goes low

Hope this helps.

ikku
  • 4,544
  • 1
  • 26
  • 28
1

I believe "TTL serial" means async serial you'd find in a common UART. A natural way to attach this printer to a PI would be to find a UART on the board (GPIO 14/15?) or attach one to another bus. There are a few good (FTDI, CP2102) and worse (Prolific) chips available for USB and loads for I2C and SPI. If the device demands handshaking, you'll have to worry about that as well. The Adafruit page doesn't seem to use any (Tx/Rx only if I read it right).

If you do want to do this over actual GPIO (logically fine, but see others for warnings about electical compatibilty), you could search for "software uart".

XTL
  • 1,389
  • 9
  • 22