PC COM port → MAX3232 → Arduino Uno: COM works, but Arduino receives nothing

Title:
PC COM port → MAX3232 → Arduino Uno: COM works, but Arduino receives nothing

Post:

Hi everyone,

I am trying to send serial data from an old Windows XP PC (real COM port) to an Arduino Uno through a DB9 MAX3232 RS232-to-TTL module.

My goal is simple: send characters from HyperTerminal on the PC and read them on Arduino.

Hardware

  • Windows XP PC with real COM port
  • HyperTerminal
  • Arduino Uno
  • DB9 MAX3232 RS232 ↔ TTL module
  • I tested 2 different MAX3232 modules

Arduino side

MAX3232 connections:

  • VCC → 5V
  • GND → GND
  • TXD → Arduino D10
  • RXD → Arduino D11

What I confirmed

  • PC COM2 works
  • HyperTerminal loopback test works when I short DB9 pin 2 and pin 3
  • COM1 was wrong, COM2 is the real working port
  • HyperTerminal settings are:
    • 9600
    • 8 data bits
    • no parity
    • 1 stop bit
    • flow control none

What I tested between PC and MAX3232

I tried both DB9 wiring options:

1. Straight

  • 2 → 2
  • 3 → 3
  • 5 → 5

2. Null modem

  • 2 → 3
  • 3 → 2
  • 5 → 5

I also tried a 7 ↔ 8 bridge.

Still, Arduino receives nothing in Serial Monitor.

Important observation

If I connect the PC COM signal directly to Arduino D10, I see random bytes in Serial Monitor.
So D10 is reacting, but of course that is raw RS232 and not valid TTL serial data.

That makes me think:

  • PC COM port is working
  • Arduino input is alive
  • the problem is probably in PC ↔ MAX3232 DB9 wiring or how this module is internally wired

My questions

  1. For a setup like PC COM port → DB9 MAX3232 → Arduino Uno, should the DB9 cable be:
  • straight-through
  • or null modem?
  1. Has anyone used this exact type of DB9 MAX3232 module with a PC COM port and Arduino?
  2. Is SoftwareSerial on pins 10/11 a bad choice here?
  3. What is the best way to isolate whether the problem is:
  • PC ↔ MAX3232
  • or MAX3232 ↔ Arduino?

Any advice would be appreciated.
Thanks.

#include <SoftwareSerial.h>
SoftwareSerial rs232(10, 11); // RX, TX

void setup() {
  Serial.begin(9600);
  rs232.begin(9600);
  Serial.println("Ready");
}

void loop() {
  if (rs232.available()) {
    int c = rs232.read();
    Serial.print("Received byte: ");
    Serial.println(c);
  }
}

There are examples for software serial in IDE , worth a look .there is a good pass through example

Check your db9 connections it is very easy to confuse pins .

Rx , Tx and 0v .

1 Like
  • Without sending anything from the XP, what voltage do you measure on DB09 Pins 10 and 11 ?

  • Show us how the MAX3232 is wired in your circuit.

A simple annotated schematic would be much easier to follow. What protocol is the system looking at, there are several both hardware and software.

1 Like

RS232 is at a higher voltage than 5v - that direct connect could well have destroyed the chip or its digital inputs .( check those with simple input /output sketch ).

.*IF*your computer has a RS232 port ( rare these days ) ,to which you have connected ( not a monitor connector ) to your RS232 to UART module connector , then it is likely to appear as COM port 1 and not appear /disappear on connection.

The MAX 232 clones are easily destroyed , just by looking at them — check again that loop back , by connecting its output, UART, Tx and Rx together and running serial monitor to check anything you type gets repeated back .

Btw I’m confused by your statement of using Rs232 > max232 > Arduino. And also a db9 “module “ - if you used a module , how did you connect rs232 direct to pin d10 ?

some drawings /pictures might help , something is wrong which we aren’t “getting”

Have run the example software serial from the ide. ???

I would at least have used Byte or char instead of int in your coms routine ( and declared it globally - neatness ).

NOTE !! , of course you are sending over software serial and receiving over the usb connection, so you need two instances of the serial monitor running - one to com port 1 to send , one to the com port your usb connection brings up to see your returned data from the Arduino hardware serial connection .

Turn off Cr and new line on the transmitting serial monitor .

Run this :

Nice example

There are quie a few diferent versions of the module, which exact one do you have?

If I connect the PC COM signal directly to Arduino D10, I see random bytes in Serial Monitor.

That could have damaged the D10 pin

Look like this?


Use straight through RS232 cable.

waiting for the schematic. A bit of caution RS232 can range from +25V to -25V.
The duck found: RS-232 voltage levels represent logical states for data transmission, where a logical "1" (mark) is indicated by a voltage between -15V and -3V, and a logical "0" (space) is indicated by a voltage between +3V and +15V. This standard allows for reliable communication between devices over serial connections.

for example using a UNO to communicate over RS232 have a look at Arduino-UNO---TTL-and-RS232-serial

@hammy mentioned in post 6 that "The MAX 232 clones are easily destroyed "
this also applies to the TTL-RS232 modules (see photo in post 7)
over the years I had 5 or 6 of these modules fail probably by incorrect wiring

1 Like