Project

General

Profile

FAQ Adjusting The Serial Port Settings In Windows » History » Version 8

Dan Smith, 02/20/2024 02:59 PM

1 8 Dan Smith
# The mythical port settings in Windows
2 1 Dan Smith
3 4 Dan Smith
{{>toc}}
4
5 1 Dan Smith
Questions are asked and claims are made about the serial port settings in Windows so often, that the topic deserves its own page.
6
7
Many folks have found the port settings for their serial device, either in Control Panel or in the Device Manager properties for the port. They see something roughly equivalent to this:
8 2 Dan Smith
9
!Selection_014.png!
10
11 1 Dan Smith
This dialog seems to imply that the baud rate (or speed in _Bits per second_) is a property of the port and that a user can adjust this up or down to make the transfer speed increase or decrease as necessary. Further, the _Flow control_ setting invites further hope that enabling it will alleviate issues with data transfers. It is often suggested that if you're having trouble transferring data between a piece of software on your PC and an external serial device, that lowering the port speed in this dialog will lead to more reliable performance due to the slower rate of transfer. Of course, the same goes for enabling flow control, because after all, why not be extra careful of your flow by controlling it?
12 2 Dan Smith
13 8 Dan Smith
## What do the settings do?
14 2 Dan Smith
15 3 Dan Smith
In reality, none of these settings have any effect (other than placebo) on modern software. For decades now, application software has told the operating system what port settings it needs in order to converse with its assigned device, and the operating system makes those changes at the time in which the port is opened. That means that if you set your port to a pokey 2400 baud, and enable flow control just to be extra careful, those settings are immediately overridden as soon as your application opens the serial port itself. It is important to note that almost all serial devices speak at only one baud rate (or at least, only the baud rate they're configured to use). If the setting in this dialog truly affected all communication over this port, then adjusting it away from anything other than the correct setting would immediately prevent the software from communicating with the device. The same goes for flow control: a device expecting one of the flow control methods will generally refuse to talk to a computer that doesn't honor the same. Enabling it on your computer when the device isn't expecting it would have the same effect of disrupting communications.
16 2 Dan Smith
17 8 Dan Smith
## So, why are these settings here?
18 2 Dan Smith
19 6 Dan Smith
The above begs the question: _If this control has no effect, why is it even available in Windows?_
20 2 Dan Smith
21 3 Dan Smith
The answer lies in the unending desire of Microsoft (and to some degree, Intel) to provide total backwards compatibility with the original PC machines of yesteryear. Before we had real operating systems (DOS was not really an operating system by the modern definition, but did provide some of these services eventually), it was up to each piece of software to control every aspect of the serial port during communication. Thus, the operating system (DOS, and later Windows attempting to support old DOS programs) provided a way to set the baud rate that would be used if an application were to just start reading and writing to the serial port. At this time, there was little or no notion of "opening the port" in an exclusive manner, so there was less opportunity to configure the settings. Thus, the Windows serial port settings dialog really only affects legacy programs from the early 1980s that depended on external configuration of the serial port. I'd be highly skeptical of anyone claiming to still be using such a piece of software on a modern machine anymore (certainly nothing with a modern GUI interface), and thus these port settings are almost completely useless.
22 2 Dan Smith
23 8 Dan Smith
## Well then, how do I slow down communication with my device to avoid issues?
24 2 Dan Smith
25
You don't. 9600 baud (which is used for most PC->radio communication) is so incredibly slow by today's definition, that you really shouldn't have any problem keeping up with it, even with a heavily-loaded system. If your system _is_ too slow, something is seriously wrong. Remember that an i386 16MHz machine could do 9600 baud all day long with no trouble. Most machines in use today are at least a hundred times faster by even the most naive of measurements.