Shop OBEX P1 Docs P2 Docs Learn Events
BS2p Serial communication issues — Parallax Forums

BS2p Serial communication issues

GTEE09GTEE09 Posts: 4
edited 2009-04-20 02:59 in BASIC Stamp
For a design project I'm working on, I have a BS2p Stamp communicating serially with a pc running Matlab, and also communicating with a MLX90614 IR Thermometer Module. The PC is connected through the dedicated serial in/out ports (pins 1 and 2) and the thermometer is communicating via some of the IO pins. For communication with Matlab, the Stamp is using a baud of 17405 (2400 baud, 8 data/no parity, inverted) and the sensor is using 240 (9600 baud, 8 data/no parity, true). Individually both systems seem to work. I can send and receive data from Matlab, and a separate program has no trouble talking to the sensor using the exact same code.

The problem comes in the program where I'm doing both things. At the beginning of the program, the Stamp sends a command to Matlab, which makes Matlab send a Word of data back. Then the Stamp sends a 'read temperature' command to the sensor, and executes a SERIN command waiting for the response. Either the sensor never gets the command from the Stamp, or the Stamp never sees the response from the sensor, because the program hangs at that SERIN command every single time. We've tried playing with different baud rates with no success.

The only thing I can think of would be that somehow the serial communication with Matlab is interfering with the communication with the sensor, but since they're occurring on completely different pins that doesn't seem to make much sense to me. Does anyone have any insight on what might be happening here?

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-04-20 01:55
    Could you use the attachment manager to attach your code to your next post?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • GTEE09GTEE09 Posts: 4
    edited 2009-04-20 02:59
    Actually it seems the problem just fixed itself. For whatever reason it seems to have trouble talking to the sensor on the very first attempt, and then after that it's perfectly fine.
    Thank you for trying to help, though!
Sign In or Register to comment.