Shop OBEX P1 Docs P2 Docs Learn Events
MAX/MSP communicating with basic stamp — Parallax Forums

MAX/MSP communicating with basic stamp

tangramkidtangramkid Posts: 9
edited 2005-03-18 19:36 in BASIC Stamp
Hi

I'm having trouble sending data from the stamp to the serial object in Max/msp. Neither debug nor serout are working (max just hears nothing). has anyone gotten this to work? if so, how? it may have sometihng to do with baudrates, but i'm not sure.

btw, i'm on a mac with a keyspan usb-to-serial adapter.

sorry if this post is too off topic, i didn't know where else to go.

Comments

  • BeanBean Posts: 8,129
    edited 2005-03-18 12:23
    If you are using the Parallax Basic Stamp, then it is certainly not off-topic.
    If the baudrate is wrong, that would cause problems, but usually you will receive junk.
    Are you shifting the voltage levels from the stamp with a MAX232 chip or anything else ?
    The stamp sends serial data using 0volts and +5volts. The serial port on a computer uses +12volts and -12volts.
    Some computers will accept the 0 & 5volt data, many will not.
    Also make sure you use the "inverted" serial baudrate on the stamp.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out· the "SX-Video Display Module"

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-18 15:58
    Also, if you are using the BS2's 'native' serial port (the programming port) it needs BOTH 'TX' and 'RX' and Gnd connected to work. The RX (which is the Stamp's line back to the computer) uses the computer's TX line for its signalling voltage.
  • tangramkidtangramkid Posts: 9
    edited 2005-03-18 19:36
    thanks guys! i actually was recieving junk before, i just didn't have max set up correctly to print it out. it turns out that it was just a baudmode problem. in the end, i had to slow it down to 2400 (inverted) and then i could recieve bytes no problem. it seems that words don't work being sent to max; they cause junky bytes, (random #s below 255).

    aparently i didn't need a MAX232 chip, which is good. didn't want to have to wait for that teeny little thing to ship.

    thanks a lot

    EDIT:

    well, now, for some reason i'm getting junk numbers again. i'm reading a potentiometer, and it was working before, but now i get all zeros, and some random numbers sometimes when i'm changing the potentiometer.i don't hink i've changed my code at all, this just started.

    I've got a basic RC circuit, with this code:

    RCVarW VAR WORD
    RCVar VAR BYTE

    main:
    'take pin high to discharge cap
    HIGH 12
    'hold 1 mill to make sure cap is discharged
    PAUSE 1
    'measure time it takes to discharge again
    RCTIME 12, 1, RCVarW
    'scale down to something < 255
    RCVar = RCVarW / 300
    'send the result
    SEROUT 16, 16780, [noparse][[/noparse]RCVar]
    GOTO main

    i'm worried that i broke my stamp somehow
    cry.gif

    Post Edited (tangramkid) : 3/19/2005 2:58:27 AM GMT
Sign In or Register to comment.