BS2p Serial communication issues
GTEE09
Posts: 4
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?
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Thank you for trying to help, though!