Ser.Baudrate Property


Sets/returns the baudrate "divisor value" for the selected serial port (selection is made through ser.num).



Value Range:

0-65535, default value is platform dependent, results in 9600bps.

See Also:

UART Mode, Serial Settings


Actual baudrade is calculated as follows: (9600*ser.div9600)/ser.baudrate. The ser.div9600 read-only property returns the value ser.baudrate must be set to in order to obtain 9600 bps on a particular platform.

For example, if we need to achieve 38400bps and ser.div9600 returns 12, then we need to set ser.baudrate=3, because (9600*12)/38400=3. This serves as a platform-independent baudrate calculation, as ser.div9600 will return different values for different platforms.

This property is only relevant when the serial port is in the UART mode (ser.mode= 0- PL_SER_MODE_UART).


Technically speaking, this property should be called divisor, not baudrate. We called it baudrate so that you could easily find it.