Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Communication Problem — Parallax Forums

BS2 Communication Problem

paul1985paul1985 Posts: 8
edited 2007-03-26 15:45 in BASIC Stamp
I'm working with a BS2 and I've successfully used the basic stamp editor to write a program via RS-232.· I've even tested my program using the debug feature in the editor, and everything works fine.· My problem is that the stamp doesn't like any signals sent via another programs by rs232 (by "doesn't like", I mean nothing happens at all).· I've used hyper terminal and LabView.· I've even looked at the pulses I'm sending to the BS2 on an oscilloscope.· They are the exact same pulses that I see when I'm in the editor using the debug option.· Same voltage levels and everything.· Any ideas what could be wrong?· Would it be helpful if I showed you all·the simple program I made?· Isn't the debug mode essentially hyper terminal?

Thanks,
Paul

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-03-22 21:13
    Yes, please show us your test program. What settings are you using in Hyperterminal? What is the reset pin doing while you're trying to send data?

    -Phil
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-03-22 21:36
    The one big difference between DEBUG commands and Hyperterminal is that Hyperterminal holds DTS high.

    On the BS2, if you hold DTS high, the BS2 stays in reset.

    The BOE board has a couple of capacitors to de-couple this reset, so that no matter HOW long Hyperterminal holds it high, the BS2 only gets one reset and can then run. I'm assuming you're not using a BOE board, because this symptom is so typical of that situation.

    You COULD disconnect the DTS line in your serial cable, that's another way around this problem.

    Edit:· D'oh!· Yes, the "DTR" signal, not "DTS".· Sorry about that.

    Post Edited (allanlane5) : 3/23/2007 2:14:35 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-23 14:11
    I think Allan means DTR...Not DTS·(which pertains to digital audio)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • paul1985paul1985 Posts: 8
    edited 2007-03-24 18:14
    Thanks to everybody for their responses and help. I've been without internet for the past couple of days and apologize for my late response. I'll be looking into this issue of the DTR line and the BS2 resetting. If it still is useful, here is the simple program I'm using to test the BS2:

    SerData VAR Byte

    Loop:
    SERIN 16, 16780, [noparse][[/noparse]WAIT ("a"),DEC SerData]
    IF SerData = 1 THEN Sub
    IF SerData = 2 THEN DoThis
    GOTO Loop

    Sub:
    HIGH 8
    GOTO Loop

    DoThis:
    LOW 8
    GOTO Loop

    I will give you all an update after I look into the possible resetting issue. Thanks again.

    - Paul
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-03-25 04:39
    Hi Paul, Loop is a reserved word so I dont think you can use it as a label so you need to change that. The two routines·need to be·subroutines with return statements.

    SerData VAR Byte

    main:
    SERIN 16, 16780, [noparse][[/noparse]WAIT ("a"),DEC SerData]
    IF SerData = 1 THEN GOSUB Sub
    IF SerData = 2 THEN GOSUB DoThis
    GOTO main

    Sub:
    HIGH 8
    RETURN

    DoThis:
    LOW 8
    RETURN

    After you have modified the DTR on your serial cable and connect to hyperterminal set flow control to none in the hyperteminal connect dialog box.

    Jeff T.
  • paul1985paul1985 Posts: 8
    edited 2007-03-26 00:09
    My problem has been solved - thanks to everybody for their help. All I did was disconnect the DTR line, and everything worked properly. Thanks again!

    - Paul
  • Sarten-XSarten-X Posts: 32
    edited 2007-03-26 07:14
    On a side note, Loop works fine for me as a label
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-03-26 07:33
    And it will continue to do so until you begin using PBASIC 2.5. That's when LOOP was implemented.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-03-26 15:45
    Thanks Bruce & Sarten·I kinda suspected that might be the case. I have only ever used the Pbasic 2.5·language so loop does not work as a label for me.

    I guess that is another good lesson learnt,for me anyway,·to keep up with the latest software it gives you more commands and widens your control options.

    Jeff T.
Sign In or Register to comment.