Shop OBEX P1 Docs P2 Docs Learn Events
servo controller and bs2sx — Parallax Forums

servo controller and bs2sx

poernakapoernaka Posts: 7
edited 2005-04-05 14:10 in Robotics
Hello stampers.

I have a bs2sx and its working fine. I bought·a psc (rev. b)·but i can't get it to work. here is what i have done.

Set·the power to vdd. (jumper on the BOE)
Connected the serial cable (X15).
Set the power to the PSC with 7.2 volts.
Switched on the power of the bs2sx (position 2)
switched on the power of the psc. (red led lights up)
switched on the servo power of the psc (servo's move to start position)

Then i tested the stamp code to get the firmware version. ( stamp reacts normal) but I don't get the firmware version. (every time the serout command runs i see the green light on the psc blink).
Then i thought maybe the baudrate is not oke. So I tried to changed the baudrate, that also did not work.
Then i thougt lets just write a program to move one servo, that also did not work.
Then i thougt lets try the other PSC (i bought 2) but this one react the same, i can't imagine that both are broken. SO basicly the PSC doesn't react to the command sent by the stamp.

Does anybody know what the problem is ? I'm getting desperate here. I want my hexapod to move its bud

Bas
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-05 13:04
    Did you change to the correct baudmode value? It is always helpful to attach code giving you troubles for others to examine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • poernakapoernaka Posts: 7
    edited 2005-04-05 13:41
    Woh that's a fast reaction and that at 6 o'clock in the morning ( youre place)

    I used the examples from the psc documentation (pdf).
  • poernakapoernaka Posts: 7
    edited 2005-04-05 13:53
    U used the following code for finding the firmware version but it keeps repeating 'Finding psc' ( the green light blinks on the psc)

    '{$PBASIC2.5}
    Sdat PIN 15
    Baud CON 396
    buff VAR Byte(3)

    FindPSC:
    DEBUG "FindingPSC", CR
    SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCVER?",CR]
    SERIN Sdat, Baud, 500, FindPSC, [noparse][[/noparse]STR buff\3]
    DEBUG "PSCver:", buff(0), buff(1), buff(2), CR
    STOP
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-05 14:10
    Yes, "396" as a baud-rate selector is correct for 2400 baud for the BS2. The BS2sx doesn't use that number, it uses 1021.

    Change "BAUD CON 396" to "BAUD CON 1021" and it should work.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-05 14:10
    The examples in the documentation are for the BS2 -- you're using the BS2sx so you MUST change the baudmode parameter to account for the BS2sx timing.· The EASIEST way to deal with this is by taking advantage of conditional compilation built into our IDE.· If you start with the attached template you can define the correct baudmode parameter by doing this:

    Baud··· CON·· T2400 + Open

    If you do it this way, change the SEROUT line to remove the $8000 (since it's part of the Baud defintion)

    Find_PSC:
    · DEBUG "Finding PSC", CR
    · SEROUT Sdat, Baud, [noparse][[/noparse]"!SCVER?", CR]
    · SERIN Sdat, Baud, 500, FindPSC, [noparse][[/noparse]STR buff\3]
    · DEBUG "PSCver:", buff(0), buff(1), buff(2), CR
    · STOP

    While I stand by the notion that conditional compilation is the best long-term route, you can get yourself going by changing the Baud constant in your program from 396 (BS2) to 1021 (BS2sx).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA


    Post Edited (Jon Williams) : 4/5/2005 2:12:53 PM GMT
Sign In or Register to comment.