Shop OBEX P1 Docs P2 Docs Learn Events
Flow control over Bluetooth — Parallax Forums

Flow control over Bluetooth

CoderManCoderMan Posts: 2
edited 2009-03-26 03:33 in Robotics
Hi. I'm programming the serial communication for a boe-bot project at school (BS2, PBASIC 2.5). I am utilizing the eb500 module for Bluetooth communication. I have successful, non-blocking serial communication between the PC and the boe-bot (over bluetooth) utilizing the serin command:

command VAR BYTE

DO
   SERIN 0, 84, 20, no_command, [noparse][[/noparse]command]
   SEROUT 1, 84, [noparse][[/noparse]command] 'repeat the command back
   ' (do things with the command)
LOOP

no_command:
   'do something if there is no command received, blah blah blah





How should I modify this if I want to implement flow control? The Basic Stamp programming manual discusses this somewhat, but assumes a connection for regular serial (not Bluetooth serial emulation) and I am not sure if it is supposed to work the same and what pins to use.

Thank you for your patience - I am fairly new to PBASIC programming.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-24 04:31
    Have you looked at the EB500 manual? RTS and CTS are normally used for flow control. Table 4 shows the connections. Page 114 discusses the command needed to enable flow control. CTS would be used with SEROUT and RTS would be used with SERIN. Read the Stamp Manual for details on flow control with SERIN and SEROUT.
  • GeorgeLGeorgeL Posts: 131
    edited 2009-03-24 19:47
    Look at the attached code in my ealier post:
    http://forums.parallax.com/showthread.php?p=793833

    It has a VB2008 interface for connecting to the Bluetooth and the BS2 code.
  • CoderManCoderMan Posts: 2
    edited 2009-03-25 21:48
    Thanks guys. I looked through the eb500 manual again and found the pin diagram. I found (I think) which pin numbers to use by comparing the pin diagram in the eb500 module with the pin diagram surrounding the header on the Board of Education.

    I also did not realize that the eb500 had to be switched into flow control mode first through the command interface.
  • edited 2009-03-26 03:33
    The eb500 no longer supports hardware flow control. Even when those pins were connected, the flow control they used was not compatible with the BASIC Stamp's flow control.

    For PC/BASIC Stamp communication, it's best for the BASIC Stamp to tell the PC when it's ready for a message. The PC can just wait patiently until it receives that signal, and then send its message. This protocol arrangement is much more important that flow control.

    Good luck with your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.
Sign In or Register to comment.