Shop OBEX P1 Docs P2 Docs Learn Events
Outs ?? — Parallax Forums

Outs ??

ArchiverArchiver Posts: 46,084
edited 2002-04-22 04:18 in General Discussion
I have been programming the BS2 for a while and cannot really find
much details on how to use OUTS. I am dividing the 16 I/O's into
two group 0-7 and 8-15. I want to manipulate these two groups of
pins separately, ie. send the send 0010001 (to turn pin 1, and pin
5 on), and send another command (don't know how) to turn on pin 10
and pin 14.

How can I do that? There is very little about this in Scott Eward's
book, and couldn't find anything nor examples in the manual. could
anyone explain and preferrably with an example?

Many thanks..


Al

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 02:56
    Writing a value to OUTL will set pins 0-7 and OUTH will set pins 8-15. OUTS
    will set all the pins at once.

    You can do this with a decimal, hex or binary value, but binary is easiest
    to understand. Here is an example in binary:

    OUTS = %0100100000100010

    This will turn on pins 1,5,11 and 14 as outputs. Just remember the numbering
    scheme goes from right to left and is 0-15 -- it does not start with 1.

    Keep in mind you can also address pins 0-7 and pins 8-15 separately. Its a
    bit confusing because you reference them to their relative position in
    control byte and not their actual pin value -- here is how it works:

    OUTS looks like this 15-14-13-12-11-10--9--8--7--6--5--4--3--2--1--0
    OUTL fits like this xx-xx-xx-xx-xx-xx-xx-xx-7--6--5--4--3--2--1--0
    OUTH fits like this 7--6--5--4--3--2--1--0-xx-xx-xx-xx-xx-xx-xx-xx.

    Here is how it works in your example

    OUTL = %00100010

    will do what you want for turning on pin 1 and 5, and

    OUTH = %01001000

    will turn on pins 11 and 14.

    Original Message


    > I have been programming the BS2 for a while and cannot really find
    > much details on how to use OUTS. I am dividing the 16 I/O's into
    > two group 0-7 and 8-15. I want to manipulate these two groups of
    > pins separately, ie. send the send 0010001 (to turn pin 1, and pin
    > 5 on), and send another command (don't know how) to turn on pin 10
    > and pin 14.
    >
    > How can I do that? There is very little about this in Scott Eward's
    > book, and couldn't find anything nor examples in the manual. could
    > anyone explain and preferrably with an example?
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 03:19
    Many many thanks, it is perfectly clear now.

    How come non of this is in the manual, and more surprisingly not in
    Scott Edward's book?


    Al


    --- In basicstamps@y..., Rodent <daweasel@s...> wrote:
    > Writing a value to OUTL will set pins 0-7 and OUTH will set pins 8-
    15. OUTS
    > will set all the pins at once.
    >
    > You can do this with a decimal, hex or binary value, but binary is
    easiest
    > to understand. Here is an example in binary:
    >
    > OUTS = %0100100000100010
    >
    > This will turn on pins 1,5,11 and 14 as outputs. Just remember the
    numbering
    > scheme goes from right to left and is 0-15 -- it does not start
    with 1.
    >
    > Keep in mind you can also address pins 0-7 and pins 8-15
    separately. Its a
    > bit confusing because you reference them to their relative
    position in
    > control byte and not their actual pin value -- here is how it
    works:
    >
    > OUTS looks like this 15-14-13-12-11-10--9--8--7--6--5--4--3--2--1--
    0
    > OUTL fits like this xx-xx-xx-xx-xx-xx-xx-xx-7--6--5--4--3--2--
    1--0
    > OUTH fits like this 7--6--5--4--3--2--1--0-xx-xx-xx-xx-xx-xx-xx-
    xx.
    >
    > Here is how it works in your example
    >
    > OUTL = %00100010
    >
    > will do what you want for turning on pin 1 and 5, and
    >
    > OUTH = %01001000
    >
    > will turn on pins 11 and 14.
    >
    >
    Original Message
    >
    >
    > > I have been programming the BS2 for a while and cannot really
    find
    > > much details on how to use OUTS. I am dividing the 16 I/O's into
    > > two group 0-7 and 8-15. I want to manipulate these two groups of
    > > pins separately, ie. send the send 0010001 (to turn pin 1, and
    pin
    > > 5 on), and send another command (don't know how) to turn on pin
    10
    > > and pin 14.
    > >
    > > How can I do that? There is very little about this in Scott
    Eward's
    > > book, and couldn't find anything nor examples in the manual.
    could
    > > anyone explain and preferrably with an example?
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 03:40
    Pages 46 - 48 of the Parallax BASIC Stamp manual (Ver 2.0) cover the details
    of input (INS) and output (OUTS) variables, and the various methods of access
    (bit, nibble, byte, word).

    Scott does an excellent job with his books and makes a deliberate choice not
    to repeat information from other manuals. That said, there is a detail
    discussion of the Stamps I/O structure and its mechanics on page 77.

    -- Jon Williams
    -- Applications Engineer, Parallax


    In a message dated 4/21/02 9:21:34 PM Central Daylight Time,
    brownstamp@y... writes:


    > How come non of this is in the manual, and more surprisingly not in
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 04:03
    Its in the Stamp manual in a round-about way, but its confusing if you don't
    have some basic microprocessor knowledge. I think I saw it explained in
    another manual and thats how I figured it out.


    Original Message


    > Many many thanks, it is perfectly clear now.
    >
    > How come non of this is in the manual, and more surprisingly not in
    > Scott Edward's book?

    > > Writing a value to OUTL will set pins 0-7 and OUTH will set pins 8-
    > 15. OUTS
    > > will set all the pins at once.
    > >
    > > You can do this with a decimal, hex or binary value, but binary is
    > easiest
    > > to understand. Here is an example in binary:
    > >
    > > OUTS = %0100100000100010
    > >
    > > This will turn on pins 1,5,11 and 14 as outputs. Just remember the
    > numbering
    > > scheme goes from right to left and is 0-15 -- it does not start
    > with 1.
    > >
    > > Keep in mind you can also address pins 0-7 and pins 8-15
    > separately. Its a
    > > bit confusing because you reference them to their relative
    > position in
    > > control byte and not their actual pin value -- here is how it
    > works:
    > >
    > > OUTS looks like this 15-14-13-12-11-10--9--8--7--6--5--4--3--2--1--
    > 0
    > > OUTL fits like this xx-xx-xx-xx-xx-xx-xx-xx-7--6--5--4--3--2--
    > 1--0
    > > OUTH fits like this 7--6--5--4--3--2--1--0-xx-xx-xx-xx-xx-xx-xx-
    > xx.
    > >
    > > Here is how it works in your example
    > >
    > > OUTL = %00100010
    > >
    > > will do what you want for turning on pin 1 and 5, and
    > >
    > > OUTH = %01001000
    > >
    > > will turn on pins 11 and 14.
    > >
    > >
    Original Message
    > >
    > >
    > > > I have been programming the BS2 for a while and cannot really
    > find
    > > > much details on how to use OUTS. I am dividing the 16 I/O's into
    > > > two group 0-7 and 8-15. I want to manipulate these two groups of
    > > > pins separately, ie. send the send 0010001 (to turn pin 1, and
    > pin
    > > > 5 on), and send another command (don't know how) to turn on pin
    > 10
    > > > and pin 14.
    > > >
    > > > How can I do that? There is very little about this in Scott
    > Eward's
    > > > book, and couldn't find anything nor examples in the manual.
    > could
    > > > anyone explain and preferrably with an example?
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 04:08
    Look at table 4.2 in the Stamp manual (pages around 46 or 47). Its also
    in chapters 2 and 3 of my book. I don't have a copy of the Edward's
    book, but I'd be very surprised if it wasn't in there...

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm



    >
    Original Message
    > From: brownstamp [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=z9sQYBsYjnPg2U51peMqFWBaRb-t_ag-4MY26zp0CRhfz3ZnLK0wEPp4vygqW9vmH0-h-FEb0KO6vsOh]brownstamp@y...[/url
    > Sent: Sunday, April 21, 2002 9:19 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: OUTS ??
    >
    >
    > Many many thanks, it is perfectly clear now.
    >
    > How come non of this is in the manual, and more surprisingly not in
    > Scott Edward's book?
    >
    >
    > Al
    >
    >
    > --- In basicstamps@y..., Rodent <daweasel@s...> wrote:
    > > Writing a value to OUTL will set pins 0-7 and OUTH will set pins 8-
    > 15. OUTS
    > > will set all the pins at once.
    > >
    > > You can do this with a decimal, hex or binary value, but binary is
    > easiest
    > > to understand. Here is an example in binary:
    > >
    > > OUTS = %0100100000100010
    > >
    > > This will turn on pins 1,5,11 and 14 as outputs. Just remember the
    > numbering
    > > scheme goes from right to left and is 0-15 -- it does not start
    > with 1.
    > >
    > > Keep in mind you can also address pins 0-7 and pins 8-15
    > separately. Its a
    > > bit confusing because you reference them to their relative
    > position in
    > > control byte and not their actual pin value -- here is how it
    > works:
    > >
    > > OUTS looks like this 15-14-13-12-11-10--9--8--7--6--5--4--3--2--1--
    > 0
    > > OUTL fits like this xx-xx-xx-xx-xx-xx-xx-xx-7--6--5--4--3--2--
    > 1--0
    > > OUTH fits like this 7--6--5--4--3--2--1--0-xx-xx-xx-xx-xx-xx-xx-
    > xx.
    > >
    > > Here is how it works in your example
    > >
    > > OUTL = %00100010
    > >
    > > will do what you want for turning on pin 1 and 5, and
    > >
    > > OUTH = %01001000
    > >
    > > will turn on pins 11 and 14.
    > >
    > >
    Original Message
    > >
    > >
    > > > I have been programming the BS2 for a while and cannot really
    > find
    > > > much details on how to use OUTS. I am dividing the 16 I/O's into
    > > > two group 0-7 and 8-15. I want to manipulate these two groups of
    > > > pins separately, ie. send the send 0010001 (to turn pin 1, and
    > pin
    > > > 5 on), and send another command (don't know how) to turn on pin
    > 10
    > > > and pin 14.
    > > >
    > > > How can I do that? There is very little about this in Scott
    > Eward's
    > > > book, and couldn't find anything nor examples in the manual.
    > could
    > > > anyone explain and preferrably with an example?
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-22 04:18
    What Al is referring to is on page 47 of the 2.0c Stamp manual. If you are
    viewing the electronic copy, jump to page 49 on your Acrobat reader.

    I think the problem was he did not understand how OUTL and OUTH were related
    to OUTS. This is not real obvious if your new to processors.

    Original Message

    > Look at table 4.2 in the Stamp manual (pages around 46 or 47). Its also
    > in chapters 2 and 3 of my book. I don't have a copy of the Edward's
    > book, but I'd be very surprised if it wasn't in there...

    > > Many many thanks, it is perfectly clear now.
    > >
    > > How come non of this is in the manual, and more surprisingly not in
    > > Scott Edward's book?
Sign In or Register to comment.