Shop OBEX P1 Docs P2 Docs Learn Events
BS2P40 with OUTL OUTH? — Parallax Forums

BS2P40 with OUTL OUTH?

ZelZel Posts: 5
edited 2007-12-12 17:07 in BASIC Stamp
Hi guys, I am new in basic stamp. My teacher gave me a BS2p40 for project, I understand for BS, OUTL and OUTH controls p0-p7 and p8-p15 individually. I would like to know if there is any command to fully control Mainio or Auxio sides, using the binary form(1010111etc) just like how the OUTL control the physical left side and OUTH controls the physical·right side of normally 24 pins Basic stamp?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-12-12 12:13
    Zel -

    This is a most elementry question which can be answered by referring to the PBASIC Reference Manual. This reference manual can be downloaded from the Parallax web site for free. It is suggested that you have a copy nearby when you are writing or debugging your program. A wealth of information is contained therein.

    The second source of this information is the PBASIC Help File which is an integral part of the PBASIC IDE.

    The I/O pins can be put in the output state in a number of different ways. They can also be set in groups as you have seen. Here is the grouping break down:

    OUTS

    Pins 0-15 affected

    OUTL or OUTH

    Pins 0-7 or 8-15 affected

    OUTA, OUTB, OUTC, or OUTD

    Pins 0-3, 4-7, 8-11, or 12-15 affected


    Regards,

    Bruce Bates
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-12-12 14:45
    The short answer is no.

    The BS2 architecture was originally designed with 16 I/O pins, numbered zero to 15. When the BS2p40 came out, now they had 32 I/O pins. To adapt the architecture, they used the "MAINIO ... AUXIO..." keywords. These keywords 'redirect' pin references to the "Main" 16 pins, or the "Aux" 16 pins. But it does mean the programmer must keep track himself which 'set' of pins is currently 'active'.

    As a result, to write the low 8 'main' pins, you do "MAINIO: OUTL = MyByte". To write the low 8 'aux' pins, you do "AUXIO: OUTL = Mybyte". There really is no way to read the entire 32 pins all at the same time.
  • ZelZel Posts: 5
    edited 2007-12-12 17:04
    Dear Bruce and Allan,

    Thank you so much for the explanations [noparse]:D[/noparse]
  • David H.David H. Posts: 78
    edited 2007-12-12 17:07
    Well, it looks like you can control 16 pins at one time using the OUTS command.
    You just have to determine which 16pins, either MAINIO or AUXIO.
    Good luck.
    David

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    David


    There are 10 types of people in this world,...
    Those that understand binary numbers, and those that don't!!!
Sign In or Register to comment.