4

Is there a way in software to make a USB to serial adaptor work like it is using a null modem cable while it is actually using a straight through cable?

(Using an off-the-shelf USB to DB9 adaptor for RS232 under windows).

Wxffles
  • 43
  • 1
  • 1
  • 3
  • 1
    Which chipset does your adapter have? The three common ones are Prolific PL230x, FTDI or SiLabs CP210x, and now there are standards-based chips on the market, like Microchip MCP2200. – markrages Jun 14 '11 at 02:55
  • @markrages - do any of them let you pick which pins are transmit and receive? – JustJeff Jun 14 '11 at 03:09
  • Ah, no, now that I think about it. It isn't the USB->serial chip that's the problem, but the transceiver chip (e.g., MAX232). You can completely reprogram the Microchip part, but it will do no good unless the transceiver is rewired too. It's a shame, a null-modem USB->serial would be a useful gadget. – markrages Jun 14 '11 at 04:23
  • Yes, the level translator is probably the issue. OTOH, you likely only need three wires. I've done it with paperclips by taping the connectors together and bending the paperclip wire to span the holes. It held up surprisingly well. – Chris Stratton Jun 14 '11 at 04:44

2 Answers2

2

No probably not. As discussed above the USB->UART part of the converter is not as much of an issue, as is the RS-232 transceiver chip. Since the RS-232 transceiver has dedicated TX and RX there is no way to switch it in firmware.

I agree such a device would be useful in a way similar to Ethernet cards which can auto-sense if you are using cross-over cable or strait cable.

The best solution to your problem would probably be to just buy or build your own null modem adapter.

mjh2007
  • 3,899
  • 25
  • 50
1

No???

I say "yes", with zero improbability or need for imitation. The only differences I can think of between the two cables is that one end has the RX and TX pins swapped at one end. Why not etch a PCB with a SPDT toggle switch and a relay, or a DPDT toggle switch to swap the pins? Maybe even put both male and female receptacles on the PCB, so that any serial cable will do... and then 3D print an enclosure, or have one printed. I suppose you could go even further with some basic detection of who has TX on what pin, while the TX pin reads differently than the RX pin with a multimeter (one of them is "floating"), so maybe add an "exclusive or" gate with an LED indicator to display which mode it's in; I'd go the DPDT toggle switch route to assert the mode because a switch has a lot less "magic" and I'd rather assert a mode just in case sensing fails.

Also, I'm pretty sure that most USB to serial adaptors/cables don't automatically switch to accommodate your needs.

Voltage Spike
  • 82,181
  • 41
  • 84
  • 220
Hitch
  • 11
  • 1