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).
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).
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.
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.