Shop OBEX P1 Docs P2 Docs Learn Events
BS2p24 and Baud Rate — Parallax Forums

BS2p24 and Baud Rate

Harry StonerHarry Stoner Posts: 54
edited 2004-07-23 15:38 in BASIC Stamp
I bought a couple of the "scratch and dent" BS2p24 stamps from Parallax. Hope to use one in place of an existing BS2 for faster serial I/O. Currently I can do reliable I/O at 2400 baud. The BS2p is about 3X faster, so would that correspond to 7200 baud (or say 4800)? Seems like a simple obvious question but maybe it's not.

I will be putting together a new breadboard for this on the weekend (if I have all the components I need on hand) so should be able to start testing this soon.

Thanks.

Harry

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-23 15:28
    If you don't change your code then you may have a problem as the BS2p is indeed faster. I trust that you have our latest compiler (2.1). It allows conditional compilation which simplifies parametric changes for different BASIC Stamp modules. Here's a bit of code I use for serial programs:

    #SELECT $STAMP
    · #CASE BS2, BS2E, BS2PE
    ··· T1200· CON· 813
    ··· T2400· CON· 396
    ··· T4800· CON· 188
    ··· T9600· CON· 84
    ··· T19K2· CON· 32
    ··· T38K4· CON· 6
    · #CASE BS2SX, BS2P
    ··· T1200· CON· 2063
    ··· T2400· CON· 1021
    ··· T4800· CON· 500
    ··· T9600· CON· 240
    ··· T19K2· CON· 110
    ··· T38K4· CON· 45
    #ENDSELECT

    Inverted·· CON· $4000
    Open······ CON· $8000

    Baud······ CON· T2400


    This lets me change modules without worrying about changing the SERIN and/or SEROUT baudmode parameter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Harry StonerHarry Stoner Posts: 54
    edited 2004-07-23 15:38
    Thanks Jon. I downloaded the conditional compilation examples yesterday and will indeed use them. I will also add conditional statements for the pulsout times (if I recall the units are different for different Stamp models).

    It would be a nice PBASIC future feature (say that out loud quickly 5 times) to have C-style includes for stuff like this to make the code more readable. E.g. #INCLUDE StampDIffs.bs2 or something similar.

    Doesn't affect anything executable so hopefully would be do-able.

    Thanks.

    Harry
Sign In or Register to comment.