Shop OBEX P1 Docs P2 Docs Learn Events
Contact closures to RS-232 - need advice — Parallax Forums

Contact closures to RS-232 - need advice

MATTGMATTG Posts: 5
edited 2009-09-24 15:51 in BASIC Stamp
Hello,

New to microcontrollers.· Looking to use a basic stamp 2 module to translate contact closures into RS-232 commands·that would·drive an eight input·video switcher.· I'm looking at the stampworks experiment kit to get started.· Will the basic stamp 2 module handle this?· Does anyone have any pointers or tips on where to start?· Thank you in advance.

MG

Post Edited (MATTG) : 9/14/2009 5:18:51 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-09-14 16:57
    Matt, as per our forum guidelines please use a subject line that describes the type of help you need. Your subject doesn't convey this information. You can use the pencil icon to the top-right of your message to edit the subject line. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-14 17:08
    Start with the "What's a Microcontroller?" tutorial and the "BASIC Stamp Syntax and Reference Manual" both of which are downloadable for free. Look here www.parallax.com/Resources/ResourcesHome/tabid/473/Default.aspx under "Downloads and Press", then select "BASIC Stamp Documentation" and "Stamps in Class Downloads" to find the tutorial and Manual. The StampWorks Manual is also very helpful.

    It sounds like a BS2 module can handle what you want, but I would recommend the BS2p if you haven't ordered the BS2 yet. The BS2p / pe / px has some very useful statements and extra memory that the BS2 doesn't have.
  • MATTGMATTG Posts: 5
    edited 2009-09-16 17:09
    Mike - thanks for the advice.· Ordered a BS2p per your recommendation and have been experimenting with it.· Through the tutorials I came up with the attached program.· Eight buttons operate eight LEDs.· This seems like a good start to what I am trying to accomplish this time around.·

    My question at this point -·How do I latch a button press?· I would like to select an input and have it stay hot until the next input is selected.·

    Thanks in advance,

    Matt

    Post Edited (MATTG) : 9/17/2009 4:40:55 PM GMT
  • MATTGMATTG Posts: 5
    edited 2009-09-23 22:01
    Okay, here is where I am now.·

    Switches are latching outputs, &·I can see that the correct commands are being sent via my viewport terminal.

    Since this is my first project, does anyone have any suggestions?· Thanks in advance.

    -Matt
  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-23 22:35
    Here's a simplified version that makes use of the names for the I/O registers when grouped as bytes.
  • MATTGMATTG Posts: 5
    edited 2009-09-24 14:17
    Mike,

    Wow, that really cut it down.· It's going to take a little time to digest what you did.· Just looked up OUTH, DIRH, and INL . . . those make sense.· When I do a CNTL-T to check syntax, it comes back with "expected a variable modifier" highlighting Bit in line 63.· Can you explain?· ·

    Thanks again,

    Matt
  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-24 14:39
    The error message is because I mistyped. That should have been "temp.BIT0(i)" or "temp.LOWBIT(i)". Either one should work.
  • MATTGMATTG Posts: 5
    edited 2009-09-24 15:51
    Mike,

    Thanks again.· Both "temp.BIT0(i)" and "temp.LOWBIT(i)" worked.· Now I need to figure out how to hold "i" HIGH until another button is pressed.

    Matt
Sign In or Register to comment.