Shop OBEX P1 Docs P2 Docs Learn Events
Can a BS1 control a PSC? — Parallax Forums

Can a BS1 control a PSC?

Kevin B SlaterKevin B Slater Posts: 49
edited 2005-06-19 21:26 in BASIC Stamp
· According to the help file the BS1 SEROUT command can communicate at 2400,N,8,1.· According to the PSC manual it communicates at 2400,N,8,2 at start-up.· I have in fact hooked up a PSC to·P0 of my BS1 and ran the following program.

' {$STAMP BS1}
SYMBOL buff0 = [color=purple]B0[/color]
SYMBOL buff1 = [color=purple]B1[/color]
SYMBOL buff2 = [color=purple]B2[/color]

  [color=blue]DEBUG[/color] [color=red]"Finding PSC"[/color], [color=purple]CR[/color]
  [color=blue]SEROUT[/color] 0,0, ([color=red]"!SCVER?"[/color])
  [color=blue]SEROUT[/color] 0,0, [color=purple]CR[/color]
  [color=blue]SERIN[/color] 0,0,(buff0,buff1,buff2)
  [color=blue]DEBUG[/color] [color=red]"PSC ver: "[/color], buff0, buff1, buff2, [color=purple]CR[/color]


· The only thing I see in the debug window is "Finding PSC".· The green LED on the PSC does flash for a brief second.· So I assume that the difference in the stop bits would not allow the BS1 to control the PSC.

· Are my assumptions correct?

Kevin

ADDENDUM:· I just hooked the PSC to my BS2 and ran the sample program in the PSC manual to check the version number and it does work so I know that my PSC is working and it is hooked up correctly.

Post Edited (Kevin B Slater) : 6/19/2005 8:19:14 AM GMT

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-18 12:26
    Kevin -

    According to the PSC documentation I just consulted, the proper command to retrieve the version number is "!SCID?",CR not as you have indicated. I'd try that first.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-18 15:04
    Your SERIN syntax is wrong -- try this:

    Main:
    · DEBUG CLS, "Finding PSC", CR
    ··SEROUT 0, OT2400,·("!SCVER?", $0D)
    · SERIN 0, OT2400, buf0, buf1, buf2
    · DEBUG "PSC Version ", [url=mailto:#@buf0]#@buf0[/url], [url=mailto:#@buf1]#@buf1[/url], [url=mailto:#@buf2]#@buf2[/url], CR
    · END

    The BS1 SERIN instruction puts *wait* qualifiers into parenthesis -- so in your version of the program the BS1 is waiting to match whatever you currently have in buf0, buf1, and buf2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 6/19/2005 1:48:00 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-18 23:15
    Bruce Bates said...
    Kevin -
    According to the PSC documentation I just consulted, the proper command to retrieve the version number is "!SCID?",CR not as you have indicated. I'd try that first.
    Regards,
    Bruce Bates
    Bruce,

    ·· Please download the latest version of the documentation from our website.· I believe the version you have is somewhat outdated.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kevin B SlaterKevin B Slater Posts: 49
    edited 2005-06-19 08:13
    Jon,
    · As usual your answers are helpful and informative.· The program worked like a charm, other than the '?' being left off the SCVER command.

    · I downloaded the new manual for the PSC and the sentence that had the communication settings had been changed to read that the PSC is set at 2400 baud when powered up.

    · I took the time to change the programs in the PSC manual to BS1 format.· If there is a better way to code these programs by all means let me know.· I started on the Javelin, and I just received my BS1 that I bought from the crazy warehouse manager that was selling stuff on eBay! smilewinkgrin.gif· So my PBASIC is deep in the learning stage.

    Thanks again,

    Kevin

    Post Edited (Kevin B Slater) : 6/19/2005 8:16:05 AM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-19 13:49
    Oops ... that'll teach me for not using copy-and-paste when I could. Original post is fixed (for others).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Kevin B SlaterKevin B Slater Posts: 49
    edited 2005-06-19 21:26
    No problem Jon, it did cause me a hiccup when I copied the program from the forums as I didn't want to introduce my own errors in to your program. Tried the program didn't work, so I was about to post another message that it wasn't working, I then decided to go though the program again and just happen to notice the problem.

    Thanks so much again for your and Parallax's support.

    Kevin
Sign In or Register to comment.