Using BS2 to Control Lynx6

I am using a Lynx 6 arm and I programmed the arm using the RIOS software. I then exported the code and programmed my BS2 to control the arm. However, it’s not working. I hooked it up to the ssc-32 as shown in the tutorial, and I removed the baud jumper so that it operates at a baud rate of 38.4 k. If anyone has any ideas please let me know.

The following is BS2 the code that RIOS exported:

' {$STAMP BS2}
' {$PBASIC 2.5}
' ------------------------------------------------------
' Lynxmotion RIOS SSC-32 'Export' Program
' RIOS SSC-32 project : AFM
' Date : 11/15/2007 10:26:21 AM
' ------------------------------------------------------
' Format : Basic Stamp 2 - PBasic 2.5
' Original filename : AFM.bs2
' Arm : L6
' Positions : Word (max accuracy, max memory used)
' ------------------------------------------------------

DATA  Word 1569, Word 1529, Word 1503, Word 1245, Word 1469, Word 1449, Word 1000, Word
DATA  Word 2037, Word 1391, Word 1937, Word 1805, Word 1469, Word 1479, Word 1320, Word
DATA  Word 2037, Word 1391, Word 1941, Word 1805, Word 1469, Word 2199, Word 120, Word
DATA  Word 1489, Word 1391, Word 1943, Word 1805, Word 1469, Word 2199, Word 4440, Word
DATA  Word 1489, Word 1391, Word 1943, Word 1805, Word 1469, Word 1431, Word 990, Word
DATA  Word 1715, Word 1513, Word 1423, Word 1181, Word 1471, Word 1429, Word 870, Word
DATA  Word 789, Word 1513, Word 1423, Word 1181, Word 1469, Word 1431, Word 1890, Word 15000
DATA  Word 789, Word 1513, Word 1423, Word 1181, Word 1607, Word 1431, Word 30, Word
DATA  Word 1715, Word 1513, Word 1423, Word 1181, Word 1471, Word 1429, Word 1860, Word

idx    VAR   Word
time1  VAR   Word
pause1 VAR   Word
pos1   VAR   Word
pos2   VAR   Word
pos3   VAR   Word
pos4   VAR   Word
pos5   VAR   Word
pos6   VAR   Word

PAUSE 500

Main:
  FOR idx = 0 TO 8
    READ idx * 16, Word pos1
    READ idx * 16 + 2, Word pos2
    READ idx * 16 + 4, Word pos3
    READ idx * 16 + 6, Word pos4
    READ idx * 16 + 8, Word pos5
    READ idx * 16 + 10, Word Pos6
    READ idx * 16 + 12, Word time1
    READ idx * 16 + 14, Word pause1
    SEROUT 15, 6, "#0P", DEC pos1, " #1P", DEC pos2, " #2P", DEC pos3,
       " #3P", DEC pos4," #4P", DEC pos5, " #5P", DEC pos6," T", DEC time1, 13]
    PAUSE time1 + pause1
  NEXT
  GOTO Main

You removed the jumper by the D in BAUD right?

Make sure you have the data cable connected to pin 15 on the Bot Board. This is the wide spaced end to connect to ground and the I/O pin. The narrow spaced end goes to the SSC-32 with the black wire closest to the outside of the board.

You have a BS2 or BS2-E right? If you are using a BS2 with other than a 20mHz crystal the baud rate parameter will need to be changed to your stamps correct value.

Are you using a Bot Board, or some BOE thing from Parallax?

Yes i removed that jumper by the D in baud. I am not using a bot board just a BS2 by itself. I have it connected to pin 15 and ground on the stamp and to RX and ground on the SSC-32. how do I know if it has a 20Mhz crystal?

It does use a 20Mhz crystal. I tried a sample code that is on the website and that works but the code i exported from RIOS won’t work.

What is the difference in the serout command between the working code and the RIOS generated code? Can you further define “won’t work”?

I’m having the same problem trying to get the SSC-32 to control the arm with the BS2. I originally used a BS2, then I moved up to the BS2px, but I still get random outputs withe the arm. Usually the arm will just randomly slam itself into the base-NOT GOOD!

I’ve tried all kinds of differnt baud rates, but I guess I just dimply don’t fully understand how to calculate the correct baud.

I have the AL5C arm, a Parallax Super Carried board, a BS2px (more memory) and am using the RIOS software to program the complex sequences. I have pin 15 on the BS2 connected to the RX on the SSC-32 and the black wire connected to ground on both boards.

What am i missing?

~Jerald

Hey Jerald,

We need to see your code… Telling us you have tried “all kinds of different baud rates” isn’t really helpful. Telling us which baud rate you used would be better.

I recommend using 38.4k as I don’t think the Stamp can talk faster than that. From my experimentation I have found 6 is the magic number. That’s non inverted 8 data no parity.

serout 15,6,"#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15 P1500",13]

I figured it out, all I had to change was the baud rate from 6 to 84 and it worked perfectly. :slight_smile:

Thanks much for your help and suggestions.

Jerald