Two Stamps SEROUT conflict
omin
Posts: 5
I have two Basic Stamps 2 which I'm trying to connect to a single
Bluetooth Modem (Bluesmirf Gold from Sparkfun). The way this works is I
have PIN 5 and PIN 10, from the first and second Stamp's respectively,
connected to the RX pin on the Bluetooth Modem. I use the commands
SEROUT 5, 6, [noparse][[/noparse]data] and SEROUT 10, 6, [noparse][[/noparse]more data] to output my data from
the stamps to the modem. The problem is that the data is all messed up
when I read it on my PC. If I only use 1 Stamp at the time it runs
flawlessly, the problem only occurs when I use the two Stamps at the same
time. I'm considering using FC to solve this problem, but I'm not sure if that'll do
the trick. I'm not interested in transferring data between stamps only to the Modem.
Any help is highly appreciated.
Bluetooth Modem (Bluesmirf Gold from Sparkfun). The way this works is I
have PIN 5 and PIN 10, from the first and second Stamp's respectively,
connected to the RX pin on the Bluetooth Modem. I use the commands
SEROUT 5, 6, [noparse][[/noparse]data] and SEROUT 10, 6, [noparse][[/noparse]more data] to output my data from
the stamps to the modem. The problem is that the data is all messed up
when I read it on my PC. If I only use 1 Stamp at the time it runs
flawlessly, the problem only occurs when I use the two Stamps at the same
time. I'm considering using FC to solve this problem, but I'm not sure if that'll do
the trick. I'm not interested in transferring data between stamps only to the Modem.
Any help is highly appreciated.
Comments
Unless I am missing some information here what you are trying to do can’t be done without extra hardware or at least communication between the BASIC Stamps. It would seem that both stamps could, at any time, be trying to access the same resource. Even without that, with the baud mode you’re using you’re driving the line so the other BASIC Stamp is fighting against that pin. I’d be surprised if one or both I/O pins weren’t already damaged.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The stamps are interfering with each other. The Stamp that is idle is adversely affecting the signal line.
Two possibilities may help.
1. isolate the two signals with 1K ohm resistors. That is, come from pin 5, through the 1K, then to the line going to the modem. Similarly, come from pin 10, through a second 1K and on towards the modem. You may have to play a bit with the resistor sizes (up and down).
2. use the "open" version of the serout command. Look in the Help file, under SEROUT, towards the end of the write-up. It is designed to allow you to do exactly what you're attempting.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
I'll try·"open mode" when i get home.
Post Edited (omin) : 3/11/2008 7:48:08 PM GMT
-Phil
Even with resistors on the lines, how will one BS2 know when the other is busy sending data? If they both send at the same time you will still get corrupted data…
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I think that'll take care of possible race conditions. Anyone else want to check my thinking?