Shop OBEX P1 Docs P2 Docs Learn Events
grouping pins? — Parallax Forums

grouping pins?

ArchiverArchiver Posts: 46,084
edited 2000-07-31 19:24 in General Discussion
Is there an easy to group a set of pins such that they can be referred to as
a single byte?

I'm specifically interested in getting a 9 bit word into and out of a device
via a parallel interface. I'd really like to be able to refer to the word by
a single moniker like 'data_in' for the sake of the operations I'm
performing on it.

help?

-dave

Dave Paton Motorola Advanced Technology Center
voice 847.538.7575 pager 888.773.6802
A13593@e...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-07-31 19:24
    Hey Dave. Gee, did you used to work for Moto SPS Microprocessors in Austin?
    Your name sure sounds familiar.

    On the Stamp2, you can refer to the 16-bit I/O as INS or OUTS. Or you can
    refer to one of the 8 bit banks: INH, INL, OUTH, OUTL. Or you can refer to
    one of 4, 4-bit banks: INA, INB, INC, IND, OUTA, OUTB, OUTC, OUTD. Or you
    can go bit by bit (in0, in1... etc.)

    There isn't a real handy way to group 9 bits, that I know of. I'd probably
    punt and use a gosub:


    input_bits var word

    gosub read_9bits
    if input_bits = $100 then blah
    yadda
    yadda
    yadda



    read_9bits:
    input_bits = INS & $1FF
    return



    Regards,

    Al Williams
    AWC
    * 8 channels of PWM: http://www.al-williams.com/awce/pak5.htm


    >
    Original Message
    > From: Paton Dave-A13593 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=M9oM24XH7--bwHn9NaOcZgtPE0rrurzo9-o7CTiBNRGweTtw5TjiGrfdfCZgl7aX3G942TJOnwVaa_FEWGTdohJM06uj]a13593@l...[/url
    > Sent: Monday, July 31, 2000 1:16 PM
    > To: 'stamp list'
    > Subject: [noparse][[/noparse]basicstamps] grouping pins?
    >
    >
    > Is there an easy to group a set of pins such that they can be
    > referred to as
    > a single byte?
    >
    > I'm specifically interested in getting a 9 bit word into and out
    > of a device
    > via a parallel interface. I'd really like to be able to refer to
    > the word by
    > a single moniker like 'data_in' for the sake of the operations I'm
    > performing on it.
    >
    > help?
    >
    > -dave
    >
    > Dave Paton Motorola Advanced Technology Center
    > voice 847.538.7575 pager 888.773.6802
    > A13593@e...
    >
    >
Sign In or Register to comment.