Shop OBEX P1 Docs P2 Docs Learn Events
SHIFTOUT syntax question — Parallax Forums

SHIFTOUT syntax question

basicstampedebasicstampede Posts: 214
edited 2008-10-02 13:48 in General Discussion
Hello.··Does BS2 code

SHIFTOUT DQ, Clock, LSBFirst, [noparse][[/noparse]WrCfg, %10]

translate in SX/B to

SHIFTOUT DQ, Clock, LSBFirst, WrCfg
SHIFTOUT DQ, Clock, LSBFirst, %10

Thanks.·

Comments

  • BeanBean Posts: 8,129
    edited 2008-10-02 01:47
    Yeah just be aware that the second SHIFTOUT will send 8 bits, not just the two.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com

    ·
  • basicstampedebasicstampede Posts: 214
    edited 2008-10-02 01:54
    Thanks Bean. In BS2, does it send out only 2 bits for %10?
  • ZootZoot Posts: 2,227
    edited 2008-10-02 02:24
    Yes. On the Stamp, to set the number of BITS in a Shiftout:

    SHIFTOUT DQ, Clock, LSBFirst, [noparse][[/noparse]%10\2] ' would only shift 2 bits
    SHIFTOUT DQ, Clock, LSBFirst, [noparse][[/noparse]%10\4] ' would only shift 4 bits (zeros padded)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • basicstampedebasicstampede Posts: 214
    edited 2008-10-02 12:04
    In BS2, then, what does
    SHIFTOUT DQ, Clock, LSBFirst, [noparse][[/noparse]WrCfg, %10] shift out?· (WrCfg is a Byte).

    Does it shift out 8 bits of WrCfg, followed by 2 bits %10?

    If it sends out 2 bits for BS2, how do I simulate this in SX/B?

    I am trying to convert Stampworks 28 which has the BS2 statement above and I cannot find in datasheet why the BS2 sends out %10 for the DS1620 chip.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-10-02 13:25
    SHIFTOUT in either language, PBASIC or SX/B, sends eight bits unless one specifies a bit count modifier; this is spelled out in both help files. Speaking of help files, there's a DS1620 program in the SX/B help file that should be helpful.

    Post Edited (JonnyMac) : 10/2/2008 2:41:56 PM GMT
  • ZootZoot Posts: 2,227
    edited 2008-10-02 13:48
    I.E., in your example, the second BYTE sent would be:

    %00000010

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.