« Reading a variable resistor with the Basic Stamp | Main | Instructions for making a serial communication cable »

October 11, 2004

Communicating between the Stamp and an authoring tool

  1. Connect the black wire (the one with the 22k resistor) from your serial communication cable to the Stamp's Pin 0. Connect the red wire to the Stamp's Pin 1. Connect the green wire to ground.
  2. Load the following program into your Stamp programming software and download it to the Stamp: serialCableTest.bs2
  3. The Stamp should print to the debug window: "Program starting ...", and then every few seconds "Waiting for serial input ..."
  4. Remove the programming cable from the Mac/PC's serial port, and replace it with the communication cable (the one that's connected to pins 0, 1 and Ground).
  5. Now load one of the following three programs into your chosen authoring tool:
  6. Before you run any of these programs, make sure you've selected the correct serial port.
    • Max/MSP/Jitter: By sending the serial object a "print" message, you can determine by letter (a, b, c, d, etc) which port is which and then replace the parameter in the serial object.
    • Director: Typing "put findports()" into the message window lists all available ports. Replace "USA191" with the correct port (if you are using a Keyspan adapter, read the comments for some useful details).
    • Processing: make sure to select the correct serial port from the Sketch menu before running the program.
  7. Run the program. Your authoring tool should initiate a two-way communication with the Stamp, sending it the number 100 to trigger the next count from 0 to 400 and back again.

Posted by Perry at October 11, 2004 09:06 AM

Comments

make sure you read all of Perry's notes, especially at the very beginning, of the Director movie script. It points you where to go for the Xtra you'll probably need as well as certain lines you will need to de-comment to run a check on the port.

Posted by: kellee at October 13, 2004 04:38 PM

also, i tried to cheat the system by connecting one keyspan adapter to the stamp, and another one to the serial communication cable. didn't work - my computer recognized them as separate entities and got confused. so use only ONE keyspan adapter, and have EITHER the stamp plugged in, or the serial communication cable.

Posted by: kellee at October 13, 2004 05:41 PM

Hmm -- actually, that should have worked, Kellee. Did you have them both plugged in before you started the Stamp software? Usually, the two adaptors will be assigned different but similar names (like USA19191.1 and USA191811.1), and you just have to make sure that you select the correct one for programming and communication.

You can figure out which is which by plugging one in first, running Keyspan Serial Assistant (in Applications) to see what its name is, then plugging in the other one & it should appear in the Keyspan window.

Posted by: perry at October 13, 2004 11:48 PM

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?