title: How to get PySerial to accept 921600 Baud rate
body: <p>We have a motor controller that implements a USB->Virtual COM port that has a fixed baud rate of 921600 (the manual even states that the baud rate cannot be changed).  I found that if I use a terminal program like Terminal, I can pass the custom baud rate of 921600 and communicate with the instrument with no issues.  We are using Windows 7 pro, 64-bit version.</p>
  
  <p>However, when I tried to do this in PySerial (v.2.7) using Python 2.7.10 (32 bit) like this:</p>
  
  <pre><code>import serial
  ser = serial.Serial("COM3",921600)
  </code></pre>
  
  <p>I always encounter error saying that parameter is incorrect.</p>
  
  <blockquote>
    <p>File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 202, in _reconfigurePort
        raise ValueError("Cannot configure port, some setting was wrong. Original message: %r" % ctypes.WinError())
    ValueError: Cannot configure port, some setting was wrong. Original message: WindowsError(87, 'The parameter is incorrect.')</p>
  </blockquote>
  
  <p>The valid Baudrates seem to be the one listed in serialwin32.py</p>
  
  <pre><code>BAUDRATES = (50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
               9600, 19200, 38400, 57600, 115200)
  </code></pre>
  
  <p>When I use any of the baud rate from the list there I can open the serial port (but not necessary able to communicate with the instrument).</p>
  
  <p>Just adding 921600 hundred to this list in serialwin32.py doesn't do anything.  I have searched several forums and websites and so far nobody seems to have an answer on how to set this higher baud rate in Windows.  The baudrate above 115200 used to be unreliable in older versions of Windows, but I assume that Windows 7 should be able to handle a much higher transfer rate now especially that many USB IC like FTDI and CH430 can handle a much higher baud rate than 115200.</p>
  
  <p>Does anyone know a way to get pySerial to accept a higher baudrate than 115200 in Windows?</p>