9-Wire RS232 to 3-Wire TTL
Here is a circuit that "steals" power from the RS-232 side (so called "parasite power") to generate the negative voltage needed for true RS-232 levels:



RS-232 signal levels are -3 to -15v marking (idle), and +3v to +15v spacing (active). (PC's typically use -5V and +5V since they fall within that range.) Level shifters must be used to converter the RS-232 levels to the TTL signal levels used by the UART in a microcontroller, and also to reverse their polarity (for the UART, high is idle, and low is asserted, opposite of RS-232).

Going from the RS-232 TX output from the PC to the input of the UART is simple, use the positive (asserted) voltage to ground the TTL RX lead via Q2, and ignore the negative voltage so the TTL RX lead will be pulled high by resistor R1 in the diagram.

Going the other way, a low level on TTL TX will result in VCC
(typically 5V) placed on the PC RX lead. But where to get a negative voltage without a negative supply? Since the PC TX lead is normally negative, it is used to charge up the capacitor C1 through the diode, much like the 1-Wire circuit. This voltage is then used to keep the PC RX lead negative when it is not being asserted.