Shop OBEX P1 Docs P2 Docs Learn Events
pin assignment — Parallax Forums

pin assignment

the_0utsider1the_0utsider1 Posts: 13
edited 2011-10-03 22:07 in BASIC Stamp
Trivial question for all in the forum.
I just got a BASIC Stamp 2p 40-Pin chip and downloaded the program 2.5.2.

The diagram shows pins x0-x19 and p0-p19

All the samples (few at that) of code show "PIN1 con 1" then " INPUT PIN1"
with my chip, do i do this from 0-39 win p0 being 0 or else, how do i define the x pins from the p pins?

TIA,
-Lee

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-03 22:07
    The p pins are the default ones. When you refer to I/O pins, you get one of the two sets, p or x. You can select the alternative set with the AUXIO statement and re-select the default ones with the MAINIO statement. After an AUXIO statement is executed, all I/O pin references will affect the x pins. After a MAINIO statement is executed, all I/O pin references will affect the p pins. The unselected group of I/O pins will retain their state until they're changed (or the Stamp is reset).

    There's only 16 I/O pins in a set ... x0-x15 and p0-p15.
Sign In or Register to comment.