AVR Serial communication using DB9 Connector

avrserial

I was using a PL2303 chip before to perform serial communication with an atmega128. It recently started getting hot and was not being detected by the computer anymore. These chips are not readily available so I was wondering if I can purchase a usb to serial cable and somehow use that to do serial communication. I spotted a serial to usb cable that even uses the PL2303 converted.

Any help is appreciated.

Best Answer

To use a USB serial cable intended for RS232 devices (as those with the 9-pin connectors are) you will have to adapt your device to within arms length of the RS232 standard.

This generally means two differences from the logic-level serial communications performed by most microcontrollers, and bare USB-serial chips:

  • the sense of the signal is inverted

  • the voltage is much higher (around 12-15v) and (at least formally) ranges below zero.

Fortunately there are ICs which implement both the voltage conversion and the inversion. In the old days, these were the 1488 and 1489 used as a pair. But for a long time now, all-in-one devices with charge pumps to produce the higher voltages from a logical supply have been available. The MAX232 is the most famous of these, though some of its many descendants would be more likely to be found in a modern design.

There are various crude things you can do in a pinch as well; disassemble the cable and tap in before its level translator IC, or build a voltage divider/limiter and try to use an ordinary logic inverter.

And there are also many other varieties of USB-serial chip to chose from, if you want to make a custom circuit or buy a cable designed for use with embedded boards and other logic-level devices.