Shop OBEX P1 Docs P2 Docs Learn Events
serout, linux — Parallax Forums

serout, linux

sara lidgeysara lidgey Posts: 3
edited 2005-11-15 09:48 in BASIC Stamp
Hi,

I'm having a hard time getting serout working. I use linux and am just getting started with the stamp. I use "cat /dev/ttyS0" to view my debugging statements in a terminal but for some reason I can't see any output from SEROUT (command: SEROUT 16, 9600, [noparse][[/noparse]"Hello"]) this way. SERIN ( command: SERIN 16, 84, [noparse][[/noparse]comd] ) works fine for me. I've tried various baud rate experiments with no luck. I'm using a BS2 stamp with an ATN line, which I switch for input and output.
stampbc is the basic stamp software I'm working with.
Any hel p would be appreciated,
Thanks,
s

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-11-13 09:34
    I think you need to look up the serin comman in the help file!

    SEROUT 16, 9600 [noparse][[/noparse]"HELLO"] isn't quite valid!

    If you want to output at 9600 you have to choose the right baudmode value!
    Assuming you actually want 9600 8N1 you'd need to put in 16468...so it'd become:
    SEROUT 16, 16468 [noparse][[/noparse]"HELLO"]
    NOW, since you're using pin 16 you don't need to use "Inverted", you should be able to use the TRUE value
    So it's probably:
    SEROUT 16, 84 [noparse][[/noparse]"HELLO"]

    Also be sure to connect the grounds together!

    Looks like you had a proper baudmode value for your SERIN command (SERIN 16, 84....why not the other one?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-13 18:50
    Steve,

    ·· Regardless of which baud mode you choose for port 16, it will be inverted anyway.· Also, the SERIN and SEROUT commands require a comma after the baud parameter, before the first bracket.· As posted that will not work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • steve_bsteve_b Posts: 1,563
    edited 2005-11-13 19:25
    haha...that's what I get for thinking I'm smart after a few beers!!

    My mistake!

    Goes to show that not all answers are correct!! User beware! [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Adrian SchneiderAdrian Schneider Posts: 92
    edited 2005-11-15 09:48
    Hi

    About communication between a Stamp and Linux you may want to have a look at this article:

    http://forums.parallax.com/showthread.php?p=536320

    You may find the "showtty" utility useful to tweak stty settings under Linux.


    Regards
    Adrian
Sign In or Register to comment.