Shop OBEX P1 Docs P2 Docs Learn Events
problem with bs2p40 pins — Parallax Forums

problem with bs2p40 pins

ciguacigua Posts: 3
edited 2009-06-13 21:36 in BASIC Stamp
hi to all, problem is that we bought 6 new 28138 professional dev boards with bs2p40 for our micro class in school in replace of the nx-1000 bs2, but we are unable to use pins p8-p15, only first byte p0-p7 of mainio, if me run same program on the nx1000 we can use p0-p15 no problem, is there an additional directive? the boarsd are brand new and all of them behave the same, the program is just a basic test of all leds, nothing fancy just to teach in our very first class how to manipulate i/o ports using high low commands to all p0-p15, note: when switching code to bs2 we change directive to bs2, so problem is not there.

thanks to all for any help regarding this issue.

Comments

  • Dave-WDave-W Posts: 94
    edited 2009-06-13 18:46
    Cigui,
    Please see all the help on the Parallax site before you post a question. Parallax is your one site for all the help you need when it pertains to their great products. There is also help in the Parallax editor.smhair.gif

    Wow freaked.gif·I hope this helps..

    Go here:

    http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf

    Page 129 shows the directives to access the aux I/O pins. But from the HELP tab you can·Look at this page:


    Function
    Switch from control of main I/O pins to auxiliary I/O pins (on the BS2p40 only).

    Quick Facts
    attachment.php?attachmentid=73795

    Explanation
    The BS2p, BS2pe, and BS2px is available as a 24-pin module that is pin-compatible with the BS2, BS2e, and BS2sx. Also availabe is a 40-pin module called the BS2p40 with an additional 16 I/O pins (for a total of 32). The BS2p40's extra, or auxiliary, I/O pins can be accessed in the same manner as the main I/O pins (by using the IDs 0 to 15) but only after issuing an AUXIO or IOTERM 1 command. . The AUXIO command causes the BASIC Stamp to affect the auxiliary I/O pins instead of the main I/O pins in all further code until the MAINIO or IOTERM 0 command is reached, or the BASIC Stamp is reset or power-cycled. AUXIO is also used when setting the DIRS register for auxiliary IO pins on the BS2p40.

    The following example illustrates this:
    Main: HIGH 0 AUXIO LOW 0The first line of the above example will set I/O pin 0 of the main I/O pins (physical pin 5) high. Afterward, the AUXIO command tells the BASIC Stamp that all commands following it should affect the auxiliary I/O pins. The following LOW command will set I/O pin 0 of the auxiliary I/O pins (physical pin 21) low.

    Note that the main I/O and auxiliary I/O pins are independent of each other; the states of the main I/O pins remain unchanged while the program affects the auxiliary I/O pins, and vice versa.

    Note on reducing power consumption.

    When the BASIC Stamp is reset all RAM variables, including DIRS and OUTS are cleared to zero. This goes for main and auxiliary pins. On the BS2p24, BS2pe, and BS2px the auxiliary pins from the interpreter chip are not connected to physical IO pins on the BASIC Stamp. While not connected to anything, these pins do have pull-ups activated, effectively connecting them to Vdd. After reset, reading the auxiliary pins from a BS2p24, BS2pe, or BS2px will return all 1s. For lowest possible current consumption where required, you may set the BS2p24, BS2pe, and BS2px auxiliary pins as output low. Setup: AUXIO ' select AUXIO pins OUTS = $0000 ' force outputs low DIRS = $FFFF ' make (unconnected) pins outputs MAINIO ' back to MAINIO group --- Do not forget this directive ! It did cause me some time

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave W.
    780 x 114 - 8K
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-06-13 18:47
    Look at this thread, same issue. The problem is that the PDB can accommodate either the 24-pin Stamps or the 40 pin BS2p40, but when the BS2p40 is in the socket, the terminals on main connector next to the chip end up with p0 to p7 and x8 to x15, rather than all the MAINIO from p0 to p15. The missing connections to p8 to p15 and x0 to x7 can be found on the connector up at the end of the board next to the SX socket and labeled (I think) "auxio".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • ciguacigua Posts: 3
    edited 2009-06-13 21:36
    thanks a lot Tracy Allen, solved the problem handling those main aux i/o, didnt know the layout for the bs2p40 on the pdb, thanks thanks
    cigua
Sign In or Register to comment.