Windows 3.11 Serial Port Parity Settings

Microsoft Windows 3.11 managed serial communication parity configurations through a combination of graphical Control Panel settings, the Win16 Communications API, and the standard communications driver (COMM.DRV). By interfacing directly with the PC's Universal Asynchronous Receiver-Transmitter (UART) hardware, Windows 3.11 allowed users and legacy 16-bit applications to define how data integrity was checked across RS-232 serial connections using None, Odd, Even, Mark, or Space parity modes.

User Configuration via the Control Panel

End users configured system-wide default parity settings through the Ports applet located within the Windows 3.11 Control Panel. Selecting a COM port (such as COM1 through COM4) and opening its Settings dialog presented a dropdown menu for parity options:

  • None: No parity bit was generated or expected (standard 8-N-1 format).
  • Odd: The parity bit was set to ensure the total number of 1s in the data bits plus parity bit was odd.
  • Even: The parity bit was set to ensure the total number of 1s was even.
  • Mark: The parity bit was permanently transmitted as a logical 1 (mark).
  • Space: The parity bit was permanently transmitted as a logical 0 (space).

These choices were saved in the SYSTEM.INI file and served as the default parameters whenever a port was opened without application-specific overrides.

Programmatic Control via the Win16 API

Software running on Windows 3.11 bypassed generic DOS interrupts (such as INT 14h) in favor of the Win16 Communications API. Applications configured parity programmatically using a data structure known as the Device Control Block (DCB):

  1. Opening the Port: An application called OpenComm() to obtain a communication handle.
  2. Defining Parameters: The application filled or modified a DCB structure. Parity was controlled specifically by two fields:
    • fParity: A binary flag enabling or disabling parity checking.
    • Parity: A byte specifying the parity type (NOPARITY, ODDPARITY, EVENPARITY, MARKPARITY, or SPACEPARITY).
  3. Parsing Command Strings: Developers frequently used BuildCommDCB() to translate standard string configurations (such as "COM1:9600,e,7,1") directly into the DCB structure.
  4. Applying Settings: The program passed the populated DCB to SetCommState(), instructing Windows to apply the configuration.

Driver and Hardware Execution

Once an application or the operating system invoked SetCommState(), the request was processed by COMM.DRV. This driver interacted directly with the system's UART hardware (commonly the 8250, 16450, or 16550A chips).

COMM.DRV translated the parity selection into the physical UART's Line Control Register (LCR):

  • Bit 3 enabled parity generation and checking.
  • Bit 4 determined even or odd parity.
  • Bit 5 enabled "stick" parity, which forced the bit to a permanent state for Mark or Space modes.

When parity errors occurred during reception, the UART flagged a parity error (PE) bit in the Line Status Register (LSR). COMM.DRV trapped this condition and passed it to the application via GetCommError(), allowing communication software to request retransmission or notify the user of corrupted data.