-1

Is it possible to set the baud rate to 10400? (Using .Net)

Mike
  • 47,263
  • 29
  • 113
  • 177
ajax
  • 1
  • 1
  • 1
  • 1
    With the right hardware and device driver, yes, no problem. The standard Windows device driver will flip you the bird. – Hans Passant Jan 22 '10 at 16:03
  • @EFraim: What else can you set the *baud rate* of (as such) in a typical .Net environment than a serial port? – Bandi-T Jan 22 '10 at 16:04
  • @Bandi-T: Of whatever. See the definition of baud rate. Serial ports are also not born equal. Some of them are implemented by user-space drivers. – EFraim Jan 22 '10 at 16:21

4 Answers4

1

Have you examined the .NET SerialPort class documentation - the baud rate is one of the constructor arguments.

That said, the standard baud rates are generally considered to be:

110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600 & 115200

...so your serial hardware many not support the somewhat curious rate you're trying to use.

John Parker
  • 54,048
  • 11
  • 129
  • 129
1

You don't need this. Trust me. Even if you think you do, you don't.

Thorsten79
  • 10,038
  • 6
  • 38
  • 54
  • 4
    A little more context would be nice for those of us who are curious... =) – Erik Forbes Jan 22 '10 at 15:27
  • Google search for 10400 baud results in links to documents mentioning OBD-II, the protocol to communicate with embedded computers in cars. See for example this link: http://www.andywhittaker.com/ECU/OBDIISoftware/tabid/69/language/en-GB/Default.aspx – Bandi-T Jan 22 '10 at 15:33
  • Good job entering this into Google. But I'll beat you with 20 years experience fiddling with all sorts of serial circuitry: You need a port chip that groks the weird baud rate. Which means that normal FIFOs in roundabout 100% of all .NET PCs won't be able to serve the baud rate. So you need an adaptor. And I guarantee you this converter will work with any off-the-shelf serial chip (or emulate the same using USB). – Thorsten79 Jan 22 '10 at 18:36
  • Hence you were right in the first place - I just provided references in response to Erik Forbes. (Sorry I did not make it clear that my reply was not directed at you.) – Bandi-T Jan 22 '10 at 21:12
1

A baud rate of a standard RS-232 UART can be set only at values which are divisors of 115200. 115200 does not divide by 10400. The closest divisor is 11, which will give you ~10472.72727272 baud. You can set this rate by issuing a direct IOCTL to the serial port.

rustyx
  • 80,671
  • 25
  • 200
  • 267
-1

The direct answer is Yes. If you are implying another question (will it work?) I think you need to try it and see.

Dim mySP As New IO.Ports.SerialPort
mySP.BaudRate = 10400
dbasnett
  • 11,334
  • 2
  • 25
  • 33