Can a BS1 control a PSC?
Kevin B Slater
Posts: 49
· 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.
· 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
' {$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
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
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
·· 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
· 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! · 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 Williams
Applications Engineer, Parallax
Thanks so much again for your and Parallax's support.
Kevin