BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – AUXIO
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 129
AUXIO
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
AUXIO
Function
Switch from control of main I/O pins to auxiliary I/O pins (on the BS2p40
only).
Quick Facts
Table 5.2: AUXIO Quick Facts.
BS2p, BS2pe, and BS2px
I/O pin IDs
0 – 15 (just like main I/O, but after AUXIO command, all references affect
physical pins 21 – 36).
Special Notes
The BS2p, BS2pe, and BS2px 24-pin modules accept this command,
however, only the BS2p40 gives access to the auxiliary I/O pins.
Related
Commands
MAINIO and IOTERM
Explanation
The BS2p, BS2pe, and BS2px are available as 24-pin modules that are pin
compatible with the BS2, BS2e and BS2sx. Also available 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 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 command is
reached, or the BASIC Stamp is reset or power-cycled. AUXIO is also used
when setting the DIRS register for auxiliary I/O pins on the BS2p40.
When the BASIC Stamp module is reset, all RAM variables including DIRS
and OUTS are cleared to zero. This affects both main and auxiliary I/O
pins. On the BS2p24, BS2pe, and BS2px, the auxiliary I/O pins from the
interpreter chip are not connected to physical I/O pins on the BASIC
Stamp module. While not connected to anything, these pins do have
internal pull-up resistors activated, effectively connecting them to Vdd.
After reset, reading the auxiliary I/O from a BS2p24, BS2pe24, or BS2px24
will return all 1s.