serial outout from Pi
Chris Hall (132) 3554 posts |
I hoped optimistically that simply taking pin8 (UART TXD) and pin6 (Ground) of the header plug on the Pi and connecting them to DB9 pins 2 and 5 (RX and Ground) on a serial cable attached to a portable PC would work OK. I get garbage unfortunately. I have checked the PC terminal is set to 115200 8N1. Any suggestion for a simple circuit that would work please? Hopefully this will be unnecessary once all is working. |
Leo (448) 82 posts |
The output on the RPi is a 3.3V TTL signal, so you would need an adaptor to convert that to the 5V signals required by the PC. I’ve successfully used a TTL to USB adaptor (such as found on ebay ) to get serial output on a PC. If you want to connect it to a RISC OS machine you’d have to find one that goes from TTL to a 9 pin Serial connector directly. |
Rick Murray (539) 13840 posts |
Yikes! Hook a multimeter onto your PC’s serial port – check you didn’t just try to hit your RPi with +/- 9V(ish, or worse!) on the incoming data line! There seems to be some confusion in the above post. Standard TTL operates at 5V not 3.3V. It (probably) will work as 3.3V is above the ~2.8V(ish) trigger level, but CMOS would probably handle interfacing better due to a wider range of supported input voltages. However, real world serial signalling uses a plus and minus swing at a variety of voltages – a PC’s serial port can be anything from +/- 4V to as high as +/- 25V (though personally I’ve encountered around +/- 9V the most) [ boring details ]. In short, you want to hook it to a little MAX3232 or the like to act as a buffer between what the RPi uses, and real-world serial. |
Chris Hall (132) 3554 posts |
check you didn’t just try to hit your RPi with +/- 9V(ish, or worse!) on the incoming data line! I did think about that. That’s why the only connected line is the TXD from the Pi to the RXD (an input) on the PC. |
Chris Hall (132) 3554 posts |
… and I couldn’t see any need to get data from the PC to the Pi (where voltage would have been a problem issue). |
Winston Smith (1524) 56 posts |
I’ve been using one of these (link below) with the RPi, works quite nicely. http://www.sparkfun.com/products/718 It’s USB based, so you need the FTDI drivers installed if you don’t already have them. |
Dave Higton (1515) 3525 posts |
Don’t forget that RS-232 level shifters are expected to invert the signals. |
Jeffrey Lee (213) 6048 posts |
This is the TTL to serial converter that I’ve been using to connect my Pi to my Iyonix. Somewhat ironic how a level shifter with a real serial connector costs more than a USB to serial chip! Also if you buy the above item don’t be put off if it comes with a mini USB connector for power. I’m not entirely sure when you’d want to use the power connector, but it seems to work just fine when using the ribbon cable to take power from 3.3V rail on the Pi’s expansion connector. |
Chris Hall (132) 3554 posts |
Many thanks – this works nicely, see full-size picture (some 935k).
|