Shop OBEX P1 Docs P2 Docs Learn Events
BS2P40 baud rates — Parallax Forums

BS2P40 baud rates

littlerichlittlerich Posts: 27
edited 2008-01-20 20:34 in General Discussion
I know there is a document that gives the codes for setting up serial data and I cannot find it.

I have a couple of RF modules and have had them going previously but today all I get is garbage.

Currently just trying to receive the data in a windows application that came with the transmitters. (Technically they are transceivers)

Think I have proved everything else is working:
remove TX pin from stamp = no data received
change data to a small string and small string of data is received
data in a loop so same garbage repeating.

I can only think I have accidentally messed up the serial command.

The only other thing to change is I went from ver 2.3.0 to 2.3.9 of Parallax software
Also I am using the same computer to setup Stamp, disconnect software and open monitoring application on receiver. So having to shut software between attempts. Com port seems to be coping with this however I haven't ruled out Com port confusion.

Well I am confused anyway.

Extract from program below:

' {$STAMP BS2p}
' {$PBASIC 2.5}

Turbine1_Rot VAR Word ' could be more than 255rpm so used word and can be 0 to 65535

Radio_Tx CON 14 'Radio on pin
Radio_Baud CON 240 'Radio baud 9600 8-N-1

x VAR Byte
y VAR Byte

Main:

x = 10
y = 20
DO
x = x+1
y = y+2
GOSUB Radio_update
LOOP
END

' Subroutines

Radio_update:
PULSOUT Radio_Tx, 1200 'set pin high to be a serial port
SEROUT Radio_Tx, Radio_Baud, [noparse][[/noparse]"hello richard "]
'SEROUT Radio_Tx, Radio_Baud, [noparse][[/noparse] DEC(x), " " ]
'SEROUT Radio_Tx, Radio_Baud, [noparse][[/noparse] DEC (y), " " ]
'SEROUT Radio_Tx, Radio_Baud, [noparse][[/noparse]"hello saskia "]
PAUSE 1250
RETURN

As you can see i have commented out several lines anyway from the data to be transmitted.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-20 07:09
    As is true for almost all Parallax products, the links to the documentation and examples can be found on the webstore page for the product. The 433MHz units' documentation can be found here: www.parallax.com/Store/Accessories/Communication/tabid/161/CategoryID/36/List/0/Level/a/ProductID/111/Default.aspx?SortField=ProductName%2cProductName.

    The Baud constant you gave should be correct for 9600 Baud on a BS2p. If you're not using Parallax's modules, there may be other issues.
  • ZootZoot Posts: 2,227
    edited 2008-01-20 16:58
    Use this code in all of your Stamp programs and you'll be ready-to-go with Baud rates without having to look up the values for each flavor of Stamp


    #SELECT $STAMP                                        ' Baud rates
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T4800       CON     188
        T9600       CON     84
        T19K2       CON     32
        TMidi       CON     12
        T38K4       CON     6
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T4800       CON     500
        T9600       CON     240
        T19K2       CON     110
        TMidi       CON     60
        T38K4       CON     45
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T4800       CON     813
        T9600       CON     396
        T19K2       CON     188
        TMidi       CON     108
        T38K4       CON     84
    #ENDSELECT
    
    SevenBit        CON     $2000
    Inverted        CON     $4000
    Open            CON     $8000
    
    
    'e.g
    MyBaud CON T38K4+Open ' will give you correct 38K4 open true value for any Stamp
    
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • littlerichlittlerich Posts: 27
    edited 2008-01-20 20:34
    Thank you very much.
    Hopefully I'll have sorted soon.
Sign In or Register to comment.