Shop OBEX P1 Docs P2 Docs Learn Events
using !SCPSD in PSCU but servo still not off at the startup — Parallax Forums

using !SCPSD in PSCU but servo still not off at the startup

bhaskarghsh4bhaskarghsh4 Posts: 20
edited 2013-12-09 04:34 in BASIC Stamp
Hello,
I am using PSCU with basic stamp . I used "!SCPSD" to deactivate all the 16 servo channels of PSCU. After burning the code in the basic stamp whenever I start the parallax board & power up the PSCU (but not activating usin !SCPSE) the servo takes a predefined value even though channel is deactivated.
thanks for your kind attention.

Comments

  • PublisonPublison Posts: 12,366
    edited 2013-11-27 05:43
    Are you using the channel number with a CR.?
    ' {$STAMP BS2}' {$PBASIC 2.5}
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Sdat PIN 15 ' Serial Data I/O Pin
    Baud CON 396 ' Constant For 2400 Baud
    Disable:
    DEBUG "Disabling Channel 0", CR
    SEROUT Sdat, Baud+$8000, ["!SCPSD", 0, CR]
    STOP
    
  • bhaskarghsh4bhaskarghsh4 Posts: 20
    edited 2013-11-27 23:26
    yes ...
    I did it
    I used the following code
    FOR lup=0 TO 15
    SEROUT PSC, baud+$8000, ["!SCPSD", lup, CR]
    NEXT
  • PublisonPublison Posts: 12,366
    edited 2013-11-28 15:20
    yes ...
    I did it
    I used the following code
    FOR lup=0 TO 15
    SEROUT PSC, baud+$8000, ["!SCPSD", lup, CR]
    NEXT

    That should work if you have the VAR for PSC pin declared correctly.

    Could you post your entire code and maybe a picture of your setup?

    Does the PSCU respond to normal servo commands?
  • bhaskarghsh4bhaskarghsh4 Posts: 20
    edited 2013-11-29 01:19
    OK I am attaching the code which is as follows:4vehicle_wid_joy_recent.bse
  • PublisonPublison Posts: 12,366
    edited 2013-11-29 03:58
    Your Baudmode seems to be incorrect. Change:
    baud CON 384
    
    to
    baud CON 396
    

    396 is the correct setting for 2400 Baud on a BS2e. (Default mode on the PSCU).
  • PublisonPublison Posts: 12,366
    edited 2013-12-02 08:01
    Did changing the Baudmode fix the problem?
  • bhaskarghsh4bhaskarghsh4 Posts: 20
    edited 2013-12-08 21:26
    Thank you sir for giving your valuable suggestion. Thank u very much.
    But I am sorry to say that it didn't fix the problem.
    :(
  • Mike GMike G Posts: 2,702
    edited 2013-12-09 04:34
    Are you sure the PSCU is up and running and without servo power when !SCPSD is initially sent to servo IDs 0-15?

    The SUB vehi_swch:
    1) Disables all servos.
    2) Enables rw, lw, and vs.
    3) Sends a position command.

    The PSCU will send the current position then the updated position. Is this the expected behavior?

    The code base is large and complex. Create a simple program specifically for testing servo enable and disable. This will verify enable and disable commands function as expected. Once verified you'll know if the problem is the PSCU or a bug in the code.
Sign In or Register to comment.