Kenny Barber
Kenny Barber

Reputation: 245

RTS and DTR High on serialport open

Can anyone tell me how to stop RTS and DTR turning on when a serialport is opened with wish85?

The attached image shows what happens at turn.

This doesn't seem to happen when you open a serialport with visual studio in C#.enter image description here

In TCL, I have used

set com [open com7: w]
fconfigure $com -ttycontrol {DTR 0}
fconfigure $com -ttycontrol {RTS 0}

and in C# its just

SerialPort sp = new SerialPort("COM7", 300);
sp.Open();  // to open the port

Upvotes: 0

Views: 2185

Answers (1)

cup
cup

Reputation: 8267

In C#, the default is to set everything to 0. For handshakes, according to https://learn.microsoft.com/en-us/dotnet/api/system.io.ports.handshake?view=netframework-4.7.2 , 0=no handshake.

If you look at the wiki page for tcl on serial ports, under handshake, it says that there is no default handshake configuration: it depends on your OS.

Presumably, the default is RTS/CTS. If you do not want any handshake then specify a handshake of none. Unfortunately, in tcl, you can't query this - it is a write only value.

Upvotes: 1

Related Questions