View Full Version : BS2e baud value code - 19200

08-29-2008, 10:13 AM
I have a goofy one here. http://forums.parallax.com/images/smilies/hop.gif I have a Matrix Orbital LCD display with a serial controller. It is default set baud at 19200. The uProject software the company provides has a bug: the baud rate setting command does not work. I am trying to communicate with it using a BS2e. How do I get the propper baud value, in hex or otherwise, to set the constant value for the baud to 19200 in my code? If I can communicate with it, I can reset its baud to a more conservative 9600 like all the rest of my Scott Edwards Serial Backpacks. Thanks.

"I know just enough about electronics to be a
danger to myself and others."

PJ Allen
08-29-2008, 11:14 AM
baudmodes (they are in PBASIC HelP) --

On the BS2, BS2e, BS2sx, BS2p, and BS2pe, serial communication is very flexible. The Baudmode argument for SERIN accepts a 16-bit value that determines its characteristics: 1-stop bit, 8-data bits/no-parity or 7-data bits/even-parity and virtually any speed from as low as 300 baud to greater than 100K baud (depending on the BASIC Stamp). The information below shows how Baudmode is calculated and show common baud modes for standard serial baud rates.

Baudmode Calculation: Determine the bit period (bits 0 - 11) BS2, BS2e, and BS2pe = INT(1,000,000 baud rate) - 20 BS2sx and BS2p = INT(2,500,000 baud rate) - 20 BS2px = INT(4,000,000 baud rate) - 20

Note: INT means 'Convert to integer.' -- drop the numbers to the right of the decimal point. Set data bits and parity (bit 13) 8-bit / No Parity = 0 7-bit / Even Parity = 8192 Select polarity bit (bit 14) True = 0 Inverted = 16384