Shop OBEX P1 Docs P2 Docs Learn Events
Baud rate Between $STAMPS? — Parallax Forums

Baud rate Between $STAMPS?

$WMc%$WMc% Posts: 1,884
edited 2008-09-29 15:15 in BASIC Stamp
·I'm tring to use a program written for the BS2 on a BS2P40! Using 2400Baud.On a ONEWIRE Bus·w/ [noparse][[/noparse]SEROUT / SERIN]. ·I have changed the "Baud···· CON··· 396" for the BS2; ·to "Baud·CON·1021" for the BS2P40 along w/ the directive {stamp BS2} to {stamp bsp}.....This program works great on the BS2, But when used on the BS2P40 all I get is "hirocliffick" or some out of range values in $HEX ????···· What In the World Am I· missing?????.... I have included some file ATTCH. below that apply to this topic..Any help·or Insite ,·will be grately APP.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-09-27 03:48
    Uh, which file? Can't help you if I need to look through a 1000 lines of code.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-09-27 19:01
    ·I'm sorry if I wasn't specific on the Baud rate... Useing the BS2P40 w/ a one wire serial bus @ 2400 Baud. example=·"SEROUT 15,Baud,[noparse][[/noparse]KEY]"---"SERIN 15,Baud,[noparse][[/noparse]KEY]".I used "Baud CON 1021" for the Baud rate OF 2400 w/ the BS2P40.How do I Fig. the timeing Value for the BS2P40?I feel this is the problem when useing the BS2P40.Again I used this program w/ the BS2 w/ a "Baud·CON ·396" and it worked fine, So I know its wired write.I have a lot of info on the BS2, But not much on the BS2P40,So any info that you would like to share would be greatly App._$WMc%
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-27 23:36
    The BS2p40 is the same processor as the BS2p24 (or BS2p) and uses the same Baud constants. The Basic Stamp Manual has formulas for calculating the proper Baud constant for any Stamp model (except the BS2px ... see the BS2px supplement for that). The Manual also has constants for all Stamp models (except the BS2px) for standard Bauds. Read the chapters on SERIN and SEROUT for details.
  • SRLMSRLM Posts: 5,045
    edited 2008-09-28 04:09
    Mike:

    Which version of the manual are you looking at? My version (2.2) does have a formula for calculating Baudmode. For the BS2px it lists:

    INT(4,000,000/baud rate) - 20

    It's on page 418. Is this what you're talking about?
  • $WMc%$WMc% Posts: 1,884
    edited 2008-09-28 04:42
    I looked @ the Baud rates for the BS2p/BS2P40,....the values giveing on page 397 of the Basic$stamp Manual are not rite/or they don't apply to the BS2P40; "1021" is what the chart shows for the BS2P. @ 2400Baud on page 397 &·pg.419·It does NOT WORK,································ 8-BIT-NOPARITY-true.·Thier is a foot note that says the BS2p may struggle to synchronize @ higher Baud rates, But not so @ 2400Baud???

    Post Edited ($WMc%) : 9/29/2008 12:24:27 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-29 15:15
    Hello,

    Your duplicate post has been removed. Please do not post duplicate messages on the same subject. Follow up in your original thread so we can follow the progress. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.