Question

Previously I was using CBR_9600 when communicating with 9600 baud devices. But there does not seem to be a CBR_28800 setting. Is it possible to set the baud rate using the DCB structure of 28800?

Was it helpful?

Solution

According to MSDN, the baud rate can either be one of the defined constants (such as CBR_9600, CBR_38400, etc) or any integer value. The constants are just defined to the values, so it's not really an enumeration at all. From the link:

The baud rate at which the communications device operates. This member can be an actual baud rate value, or one of the following indexes.

OTHER TIPS

Yes. CBR_9600 is just equal to 9600. It should be possible to plug in 28800 and it will just work.

Note that if you use rates other then the "standard" rates, the actual rate may differ from the target rate. In the hardware a "baud rate divisor" register divides down a master clock to achieve the desired baud rate, so a finite number of discrete values are available. However the resolution available at low rates is high; the increments get larger at low divisor values.

This can be a problem if communicating with devices that use different UART hardware and clocking than the PC, because the resultant rate differences can in extreme cases be beyond specified tolerances.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top