# What is the function of diode and capacitor in RS232 shifter circuit?

as shown in the picture, can anyone explain the capacitor and diode in detail? Thank you!

• I want to say those are what create the negative supply for the RS232 signal. Take a look at this article: uchobby.com/index.php/2007/06/11/ttl-to-rs232-adaptor-explained Jul 3, 2018 at 17:26
– jonk
Jul 3, 2018 at 17:37
• @LFJY: can you post the value of Vcc. Is it 12V? Jul 3, 2018 at 18:05

RS232 logic levels are (from memory)

• high: -12 to -3 V.
• low: +3 to +12 V.

Since your level shifter is interfacing with a device with only a single-ended, positive supply there is a problem sending out a high signal on RX-RS232.

The trick here is to steal some power from the TX signal of the other device when it is high (negative). The diode charges the capacitor to a negative voltage and this is used to bias the RX line negative if the TX-TTL signal is high (which will turn the PNP transistor off).

When the TX-TTL signal is high and the PNP turned off there is a potential divider formed between the three 10k resistors, 1, 2 & 3. The best that can be obtained from this arrangement is that the RX line will be a little more positive (due to the diode drop) than $\frac {2}{3}V_{TX}$. If VTX is weak (close to -3 V) this circuit may not work as the voltage to the other device's RX will be out of specification.

• I've written up a little something here. Feel free to use, borrow, whatever you find useful from it.
– jonk
Jul 3, 2018 at 17:36
• More like a technical treatise with history of serial comms and personal projects thrown in. +1, as usual. Jul 3, 2018 at 17:40
• What can I say? ;)
– jonk
Jul 3, 2018 at 17:46
• I first used the MAX232 in about 1993. No messing about! Jul 3, 2018 at 19:09
• To those who've only experienced the MAX232 and subsequent devices for RS-232 support, I encourage them to try out an MC1488 and MC1489, someday, and see what RS-232 IC life was like before. Jim T. designed those in the mid 1960's, working at Motorola SPD (Phoenix.) The MAX232 arrived in 1987! Amazingly late, being about two decades later and arguably when RS-232 was already on its way out. We could have used it at least a decade earlier, I think. Very late in coming.
– jonk
Jul 3, 2018 at 21:47