[SOLVED] Wrong characters over Serial with RS232 Converter

Hi,

I'm trying to send text to Arduino (Mega 2560) from Windows 10 (via Windows CMD or PuTTY) over Serial. I am using an RS232 to USB converter with a DB9 connector (based on an FTDI USB Serial converter chip) wired to Arduino's Serial1.

The problem is that wrong characters are received. For example:

sent | received
a | O
b | '
c | N
d |
e | M
...
g | L
...
i | K

No matter which device (PC/Arduino) is the sender and which one the receiver, the same thing happens; when I send 'c', I receive 'N'!

Packet format on both sides is configured to 8N1 and the baudrate is also correctly set.

This is the code I'm using on Arduino to receive each character from CMD/PuTTY and echo it on Serial Monitor:

void setup() {
 Serial1.begin(115200);
 Serial.begin(115200);
}

void loop() {
  while( Serial1.available() ){
      char incoming = Serial1.read();
      Serial.print(incoming);
  }
}

I wonder what could be causing this :-\ Any help will be greatly appreciated!

Thanks :slight_smile:

skepticmind:
I wonder what could be causing this :-\

The missing RS232 to TTL converter on the Arduino side?
The damage you inflicted on the Arduino serial pins by connecting RS232 to it?

The missing RS232 to TTL converter on the Arduino side?

Yup...I just came to the same conclusion a few minutes ago after questioning my initial assumption that RS232 and UART are the same thing. :-[

Thank you!

The damage you inflicted on the Arduino serial pins by connecting RS232 to it?

By the way I don't think there would be any damage, as the RS232 converter is powered through my laptop's USB port, so the voltage level must be 5v, not dangerous for the Mega. Right?

That depends on the level of compatibility to the standard, see RS-232 - Wikipedia