Shop OBEX P1 Docs P2 Docs Learn Events
SpeakJet - BS2px Question — Parallax Forums

SpeakJet - BS2px Question

SN96SN96 Posts: 318
edited 2007-10-23 16:48 in BASIC Stamp
Hello all,
·
I have built my own SpeakJet board and it works fantastic with the BS2 (Homework Board). I really would like to get the BS2px but I'm worried that I will not be able to have the same success as with the BS2. In the demo code, for the SpeakJet, it uses $0054 for the baud rate. The SpeakJet is set at 9600 baud from the factory. My question is; what will that magic number be for the BS2px? Is·$0054 hex for 9600? I am really weak with programming and would appreciate any help at all.

Attached is a picture of my homemade speakjet board with integrated two channel sound sensor. Other features include Memsic tilt sensor socket and a simple PING sensor plug that provides a convenient way to connect the cable to the board and have everything go though a single larger connector. This is an older project I have wanted to revisit and get it ready for my biped robot.




▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike





Post Edited (SN96) : 10/23/2007 2:15:56 AM GMT
640 x 480 - 194K
640 x 480 - 226K
1328 x 1002 - 1M

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-23 02:37
    For BS2px, 9600, 8-N-1, True = 396 (DEC) or $18C
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-23 03:15
    All of the BS2px "magic numbers" are in the BS2px supplement with a link on the BS2px product page.
  • SN96SN96 Posts: 318
    edited 2007-10-23 14:05
    Mike,

    what's the formula for finding out the hex value? The speed of the mcu is part of the equasion, right?

    I have another mcu that runs at 100,000 instructions persecond but It has some issues.

    Thanks PJ for the hex value, I will give that a try.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    ·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-10-23 15:40
    Mike -

    Take a look at the SERIN and SEROUT command in the PBASIC Reference Manual (free download from the Parallax web site), or in the PBASIC Help File for the formula for generating the appropriate BAUDMODEs.

    Yes, the speed of the PBASIC Stamp is one element in the consideration, but speed (baud rate or Stamp speed) is by no means the only consideration. There also exists a set of conditional variables which can be added at the beginning of any PBASIC Stamp program to "set" some of the common BAUDMODE parameters (by name) auto-magically based on the PBASIC Stamp type, and certain qualifiers in the variable name. I suspect once you see the conditional template you'll get the idea rather quickly.

    Others will have to point you to the template, as I'm not very well schooled in providing Forum links unfortunately.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • SN96SN96 Posts: 318
    edited 2007-10-23 16:48
    Thanks Bruce,

    That's the kind of help I was after. I want to learn how to do this. I have the latest Pbasic IDE so I will check out the help file. I am more mechanically inclined vs. math and programming and appreciate the help. My custom pc board would have been impossible without the generous help of Bean and another friend Pete from another forum. Its nice to have people in the online community provide guidance to make things heppen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike



    ·
Sign In or Register to comment.