Products Support Sales Company Scott Edwards Electronics, Inc.
 

BASIC Stamp II SX Baud Settings

User manuals for our products include demo programs for the Parallax BASIC Stamp II (BS2). A new high-speed variant of the BS2, called the BS2-SX, requires different baudmode settings than the original.

This tip tells how to set the correct baudmode for your BS2-SX.

Baudmodes, Old and New

What Parallax calls a 'baudmode' is a value that specifies the bit timing and other parameters for its Serin and Serout instructions. For instance, in the example below, $4054 is the baudmode.

    SEROUT 0,$4054,["Hello!"]

In some cases, you'll see the baudmode value set as a constant whose name, rather than the number itself, is used throughout the program.

    N9600 CON $4054 ' 9600 baud, inverted.
    SEROUT 0,N9600,["Hello!"]

To change the baudmodes in a program for the BS2-SX, you must find all of the Serout and Serin instructions and change the baudmode number. Or, if the number has been defined as a constant, change the value of that constant. Before we give examples, here are the two baudmodes used in our manuals and their BS2-SX equivalents:

Baud BS2 BS2-SX
2400 $418D $43FD
9600 $4054 $40F1

For applications other than our products, there are a lot of possible baudmodes. These are listed in the data sheets for the BS2-SX.

If the Serout instructions in a program example have the baudmode value embedded in them, just use Find/Replace to change all instances:

    BS2:
    SEROUT 0,$4054,["Hello!"]

    BS2-SX:
    SEROUT 0,$40F1,["Hello!"]

If the program uses a named constant to define the baudmode, just locate that line and make the change once:

    BS2:
    N9600 CON $4054 ' 9600 baud, inverted.
    SEROUT 0,N9600,["Hello!"]

    BS2-SX:
    N9600 CON $40F1 ' 9600 baud, inverted.
    SEROUT 0,N9600,["Hello!"]

That's all you need to know to update the baudmode settings for the new BS2-SX. See the Parallax documentation for more information on the BS2-SX's higher speed and additional features.


Scott Edwards Electronics Inc.
1939 S. Frontage Rd. #F, Sierra Vista, AZ 85635
phone 520-459-4802; fax 520-459-0623
e-mail info@seetron.com