Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I've purchased a Mini Thermal Printer from Adafruit. The documnetation 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?

share|improve this question
1  
Probably very little aside from software. If the printer produces any reply data, you might need a voltage limiter on that though. You might want to ask on the adafruit forums, since they sell both the printer and pi's as well. –  Chris Stratton Oct 7 '12 at 15:59
    
As far as I can tell there is no reply data. –  Jivings Oct 7 '12 at 17:33
1  
@AlexChamberlain in a word, no. That is not something people worry about in logic translation at all. A higher voltage driver damaging a lower voltage receiver, or a lower voltage driver failing to be reliably registered by a higher voltage receiver yes, but not excessive current draw when driving a a simple logic input from another family. –  Chris Stratton Oct 7 '12 at 23:49
2  
Have you seen this? sparkfun.com/products/8745 –  Alex L Oct 8 '12 at 6:23
1  
@RongNguyen You can get it to print anything you like, you'll just have to do the hard work yourself. There's a tutorial here. –  Jivings Jun 17 at 16:31

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer

This may be what you need:

4-channel I2C-safe Bi-directional Logic Level Converter - BSS138

or

8-channel Bi-directional Logic Level Converter - TXB0108 (non I2C)

share|improve this answer
    
This is not needed for a send-only connection. –  Chris Stratton Oct 13 '12 at 15:40

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".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.