1
\$\begingroup\$

I'd like to connect R-Pi serial to PC's RS232 port without IC (such MAX3232), using only diode (thus block negative voltage to 0V), voltage divider resistors, and common BJT.

For TXD (RX from R-Pi perspective): Using my USB-to-RS232 adaptor, measured voltage level for logic high is 7.5V, 6.85V after 0.65V diode voltage drop, so I'll use 270:220 ohm resistor for 3.07V (for 10 mA current) - 3.36V (no current, no voltage drop) divided voltage. Current is limited to about 10 mA with 490 (270+220) ohm resistance.

For RXD (TX from R-Pi perspective): Borrowing power from DTR line, switch it using BC557 PNP transistor (DTR to collector; emitter to RXD) with base connected to R-Pi's TX in series with 680K resistor (for limiting drawn current to 0.5 mA).

Schematic

My question is: will this work? (I'm not sure whether impedance of the connected pins will affect this simple circuit). Thanks in advance for your response.

\$\endgroup\$
1
\$\begingroup\$

There are lots of issues with the circuit that you drew. I could go on at great length about what is wrong, but it doesn't matter because there is one fundamental issue: RS-232 levels are inverted from TTL signal levels. A binary '1' coming out of your PI is a high voltage level, but a binary '1' to your PC is -12 volts (ideally). Your circuit doesn't do the inversion.

Other issues that you have are: Modern RS-232 ports can't source much current. 10 mA is probably too much. RXD needs a pulldown resistor. The transistor might have problems switching correctly-- you can use an NPN to level shift AND invert.

\$\endgroup\$
  • \$\begingroup\$ Thanks, you're certainly right. I've forgot about that level inversion. I'll edit the question accordingly. Would you please elaborate more about some issues would be arise other then level inversion? And how much current may I actually draw (since in V28 spec it's said up to 100 mA)? \$\endgroup\$ – excalibur May 29 '13 at 7:03
  • \$\begingroup\$ @excalibur Consider the MAX3232 chip family, which only outputs +/-5.4v and can drive up to 2.5 mA per output while maintaining +/-5.0v on the outputs. While chips like these follow the letter of the RS-232 spec, they do not follow the spirit of the spec. Since chips like this are commonly used in modern RS-232 type devices, you need to be aware of these to successfully interface some things. As for what you need to do, I suggest coming up with a new circuit and then posting a new question about that specifically. I could expand on this circuit, but it wouldn't be as useful for you. \$\endgroup\$ – user3624 May 29 '13 at 13:28
0
\$\begingroup\$

Another way to level shift is using mosfets and some resistors. This for example is how is best recommended to level shift the I2C communication protocol. Phillips Semiconductors (Now NXP) have a good application note on this that maybe helpful which can be searched for using the note number AN97055 or found at http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf

\$\endgroup\$

protected by W5VO May 29 '13 at 2:03

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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