Electronic – the difference between RS-232 and TTL UART?

rs232uart

I always need to communicate with the TTL UART port on the MCU with a computer. When I talked about that, people always refer the UART port as an RS-232 port. Are they correct? If not, what is the difference between them?

Also, can I use a RS-232-to-USB converter for a TTL UART port?

Best Answer

The port on your USB<->RS-232 converter will output something like +/-9V and can accept +/-25V or short circuit without damage.

The UART on your MCU uses logic level (0V/3.3V or 0V/5V typically). Applying less than 0V or more than Vcc can destroy the MCU chip.

Also the logic levels are inverted between the two types (excepting an option on a very few MCUs).

To bidirectionally invert and convert between the UART levels and RS-232 levels one would typically use a chip such as the MAX232 (for 5V logic). The MAX232 also generates its own +/-9V supplies from a single +5V supply using a charge pump voltage doubler.

TL;DR:

No you cannot use the USB-RS-232 (aka USB-serial) cable to connect the two. There are USB-TTL Serial converters available cheaply. There are some gotchas with the cheapest Chinese ones as far as 3.3V operation goes, be sure to research it a bit. Adafruit carries such devices for $10. I think you can find them at Digikey and other sources as well.

enter image description here

Since the hardware interface is not defined by any standard at the MCU end they are typically furnished with uncommitted fly wires with female terminals to mate with 0.025" square pins as you would find on a 0.1" pitch header. I bought half a dozen similar devices for my firmware programmer and she's been using them to talk to various development boards.

Related Topic