I want to control a hardware device which is controlled by its RS232 interface (B in the figure) using a microcontroller board and a UART/RS232 converter (A in the figure.)

enter image description here

The UART/RS232 converter module is this one. As you see it is a female DE-9 RS232 connector.

The hardware also has a female DE-9 RS232 port as control interface.

Do I need a male to male adapter such as this one? I'm not sure if it should be crossed pins.

  • 3
    \$\begingroup\$ Can't tell you the pinout of your devices. Check. \$\endgroup\$ Dec 7, 2023 at 14:39
  • 5
    \$\begingroup\$ It depends on if one or both of these devices consider themselves modems or terminals. To connect two terminals, you need a "null modem", meaning a mechanical device which flips the signals. \$\endgroup\$
    – Lundin
    Dec 7, 2023 at 14:42
  • \$\begingroup\$ It's clear that the linked PMOD device has the correct female connector to plug directly into a terminal device (like a computer), without the need for a null modem adapter. What's not clear is the configuration of your MCU board. The connector gender implies that it is also configured as a DCE device - in which case you would need a cross-over adapter. However, it is the wild west, and you need to provide more information about the MCU setup to be sure. \$\endgroup\$ Dec 7, 2023 at 14:54
  • \$\begingroup\$ @ChrisKnudsen The HW is controlled by female DB9. MCU is using only rx tx and gnd. The PMOD decie also female. So I need a male male cross-over adapter. But is doesnt exist, I couldnt find in my search. \$\endgroup\$
    – user4444
    Dec 7, 2023 at 15:01
  • \$\begingroup\$ @Lundin the HW is slave and MCU master.. MCU will send byte telegrams and in response will receive byte telegrams from the HW. \$\endgroup\$
    – user4444
    Dec 7, 2023 at 15:03

4 Answers 4



  • Both devices are terminals, with signal termination.
  • Both devices have an EIA RS232 standardized DB9F using the bare minimum of signals: Rx (pin 2), Tx (pin 3) and GND (pin 5).

Then a gender changer will not work, since it is a straight connection connecting pin 2 female to pin 2 male etc.

You need a null modem which looks the same but flips signals 2 and 3 (and a bunch of others, in case you also use hardware handshaking etc) but does not flip ground. Looks about the same but has different signal routing. Example. They are typically male-to-female, but maybe it is possible to find a male-to-male one somewhere.

  • 1
    \$\begingroup\$ "maybe it is possible to find a male-to-male one somewhere": Seeing how this is not a shopping/product recommendation site, I would never go out of my way to suggest that maybe cablestogo.com has a part number with 52165 that is claimed to be a M/M null modem cable. Be aware that there's no associated useful documentation, so you may lose your nickel. \$\endgroup\$ Dec 7, 2023 at 15:25
  • \$\begingroup\$ @ChrisKnudsen The quick & dirty solution is to buy a null modem + a gender changer from RS or whatever. The slow & dirty solution is to build one yourself using 2 DB9M IDC connectors, some ribbon cable and nippers. Done that more times than I can count. Luckily RS232 is finally dying out in favour for differential signal technologies. \$\endgroup\$
    – Lundin
    Dec 7, 2023 at 15:29
  • \$\begingroup\$ There is no male-male null modem adapter. But how about using a female/male null modem adapter and a gender changer such as: MCU --> Pmod's female RS232 conn(A) --> "Female/Male gender changer-"-> "Female/Male null modem adapter" --> HW's female RS232 conn(B) --> HW . Would that work? \$\endgroup\$
    – user4444
    Dec 7, 2023 at 15:45
  • \$\begingroup\$ @user4444 I didn't spot one on RS, but surely they exist. Googling "rs232 male-to-male null modem" gives lots of hits from admittedly bad reputation vendors like Amazon or Aliexpress. \$\endgroup\$
    – Lundin
    Dec 8, 2023 at 7:47
  • \$\begingroup\$ StarTech does one and they're usually a step up from complete trash: bestbuy.ca/en-ca/product/… \$\endgroup\$ Dec 10, 2023 at 2:35

The connector is not a DB9 but a DE9.

The Digilent adapter is a DCE side device with female connector, intended to be connected to a DTE such as a computer with a male connector.

Your other device is also equipped with a DE9 female connector, so assumption is that it is also a DCE side device and needs to be connected to a DTE.

You cannot connect two DCEs directly together with an adapter that does not swap pins.

You need an adapter cable to cross over the data pins.

You can easily buy null modem cables between two DTEs as it is very common to connect computers together.

However you need a cable that can connect two DCEs together.

Better make your own cable to get the pinout and handshaking correct as required by both devices.

  • \$\begingroup\$ I cannot find a male-male null modem adapter. But how about using a female/male null modem adapter and a gender changer such as: MCU --> Pmod's female RS232 conn(A) --> "Female/Male gender changer-"-> "Female/Male null modem adapter" --> HW's female RS232 conn(B) --> HW . Would that work? \$\endgroup\$
    – user4444
    Dec 7, 2023 at 15:45
  • \$\begingroup\$ Or a short male to male null modem cable as you mention? But I cannot find that as well. \$\endgroup\$
    – user4444
    Dec 7, 2023 at 15:47
  • \$\begingroup\$ @user4444: Just buy two male DE-9 connectors and make your own adaptor cable. \$\endgroup\$ Dec 7, 2023 at 16:54

You can check where TX and RX is connected with a multimeter. If the device is on, the TX pin shows a negative voltage in the range of -5..12 V relative to pin 5 (= GND).

The RX pin provides no voltage or just some mV relative to pin 5.

A typical female RS232 connector has TX assigned to pin 2 and RX assigned to pin 3. On a male connector it is the other way round.

The cable between the connectors must route TX of one device to RX of the other device and route pin 5 straight through.

The required swap of pin 2 and 3 is done with a null modem cable if both connectors have the same gender.

But some manufacturers do not understand this concept and place female connectors with a pin assignment of a male connector or vice versa. So a quick verification with a multimeter preserves time and nerves.

Some systems use the handshake signals on pin 7 and 8. A null modem cable swaps them as well.

In theory a cross over of pin 4, 6 and 1 could be necessary, but I have never seen an application, that uses these signals except ancient modems.


You can buy kits containing two male connector housings along with wires and a shell. You can then assemble the wires into the shells and put the shells in the housing in whatever configuration you need.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.