Shop OBEX P1 Docs P2 Docs Learn Events
serin/out to pc problem — Parallax Forums

serin/out to pc problem

DLKDLK Posts: 5
edited 2009-04-13 09:53 in BASIC Stamp
I think I looked everywhere that I could think of with no luck

I need to control a switch with a vb6 program which is easy enough plus the switch has to return a count of contact closures in a given period to the vb6 program.

I've tried using handshaking but must have done something wrong but don't know what.

It's been a year or so since I last tried it but the need has come up again.

Any help out there?

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-04-12 01:40
    Sure, if you want help you need to start by including a drawing of your circuit, attach your code using the attachment manager, have links to the hardware you are trying to use and ask specific questions about the problem you are having with your circuit.
    Hope all this helps you out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • DLKDLK Posts: 5
    edited 2009-04-12 18:37
    I'd be happy to send drawings & a program if I still had it.· Last year when the hard drive failed so did what I had.· I haven't tried making a program for this since because I'd probably would have wound up in the same boat and blowing a lot of time getting nowhere.

    What I have seen is a lot of stamps to other stamps or to robotics but nothing where 232 is used with pc's and rts/cts in a two way condition.

    I was hoping to get aimed at some programs or sites.

    Thanks anyway.· I'll keep looking when I have the time.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-12 18:53
    Have you looked at the Stamp Manual in the chapters on the SERIN and SEROUT statements? The flow control input for the SEROUT statement is treated the same as the data input line for the SERIN statement in that you need a 22K series resistor if you're connected to an RS232 port without some kind of interface circuit (like a MAX232). Like the voltage issues with the SEROUT data output line, the SERIN flow control output line may not work with your RS232 port because the Stamp uses voltage levels of +5V / 0V rather than the standard RS232 voltages (+5V / -5V minimum).
  • DLKDLK Posts: 5
    edited 2009-04-12 19:12
    Hi Mike,

    Yep, I know I tried that setup and the program I made for both the VB6 and the stamp programs worked fine as long as I was sending either the serout alone or the serin alone.· Meaning one or the other was commented out.· When I tried to send data back & forth using both serin and out is when I had the problem.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-12 19:31
    As Franklin mentioned, it's really impossible to help more without a schematic and source code. What you're describing should work, has worked for others.
  • DLKDLK Posts: 5
    edited 2009-04-12 20:26
    Understood. When I can get back to it I will. Maybe then I'll have more info for you or Franklin to work with.
    Thanks again
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-04-13 02:28
    Hi, when you pick up on this project again it will be worth bearing in mind that·if you use the programming port (P16) for Stamp/PC communications that the Stamp will echo back to the receive buffer every byte transmitted from the PC.

    If you don't clear the receive buffer before the next transmission from the Stamp the data and the echo can get mixed together giving errors in what you expect.

    I mention this because you say you are unable to send and receive in the same program , the above could be a possible reason.

    Jeff T.
  • DLKDLK Posts: 5
    edited 2009-04-13 09:53
    Thanks Jeff.· I believe I used 10 and 12 or 11 and 13 back then.

    I'm always open to help even when I just can't get to the project immediately.
Sign In or Register to comment.