Shop OBEX P1 Docs P2 Docs Learn Events
SERIN Problems — Parallax Forums

SERIN Problems

Kevin HarrisKevin Harris Posts: 15
edited 2005-08-25 14:57 in BASIC Stamp
Okay, I just bought a BlueSmirf wireless bluetooth module that I'm interfacing to my BS2. It runs at the standard 9600/8/N/1 settings. The code below successfully SENDS data just fine and it makes it to my computer etc... However, one it gets to the SERIN statement I push a number key and I immediately get back gibbirish and the program never loops. I noticed in the BASIC Stamp manual it saying something about the stamp having trouble snychronizing incoming data at high baud rates, could this be the case or would it be something else, like the bluetooth module etc...? Here is a sample hyperterminal session with this testing code: "Kevin01

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-25 14:04
    Kevin -

    What kind of device is connected to pin port 2? I presume pin port 3 is the Bluetooth module?

    Regards,

    Bruce Bates
  • Kevin HarrisKevin Harris Posts: 15
    edited 2005-08-25 14:05
    They both go into the bluetooth module, one is incoming from the module and one is outgoing to the module.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-08-25 14:56
    Kevin,

    ·· Perhaps you should make·an LED blink·at the end of your LOOP to verify that it is or isn't looping.· I would venture to guess it is, although I can't explain the extra characters.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    serInput VAR Byte
    
    serInput = 0
    
    DO
    SEROUT 3, 84,[noparse][[/noparse]"Kevin"]
    SEROUT 3, 84, [noparse][[/noparse]DEC serInput]
    
    
    SERIN 2, 84,[noparse][[/noparse]serInput]
    SEROUT 3, 84, [noparse][[/noparse]DEC serInput]
     
    HIGH 0
    PAUSE 150
    LOW 0
    PAUSE 150
    
    LOOP
    



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-25 14:57
    Kevin -

    The BlueSmirf supports flow control, and by using that on both ends I suspect your problems will disappear. The BlueSmirf module supports full duplex operation, but the Stamp does not. I suspect the line is being turned around faster than the Stamp can respond to it.

    Regards,

    Bruce Bates
Sign In or Register to comment.