PDA

View Full Version : Baud rate Between $STAMPS?



$WMc%
09-27-2008, 09:32 AM
·I'm tring to use a program written for the BS2 on a BS2P40! Using 2400Baud.On a ONEWIRE Bus·w/ [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.

SRLM
09-27-2008, 11:48 AM
Uh, which file? Can't help you if I need to look through a 1000 lines of code.

$WMc%
09-28-2008, 03:01 AM
·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,[KEY]"---"SERIN 15,Baud,[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 Green
09-28-2008, 07:36 AM
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.

SRLM
09-28-2008, 12:09 PM
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%
09-28-2008, 12:42 PM
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 Savage
09-29-2008, 11:15 PM
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