Shop OBEX P1 Docs P2 Docs Learn Events
Probably a trivial problem — Parallax Forums

Probably a trivial problem

RocksRocks Posts: 1
edited 2010-01-06 16:34 in BASIC Stamp
This is probably a trivial issue.· I am in the initial stages of trying to teach myself to use Basic Stamps.· Currently I am using a PS2 40 on a development board and running through some canned experiments from a Parallax book.· I could not get one of the experiments·to work·so I tried to write a simple program to raise and lower the voltage on output pin x:

Start:
HIGH X
PAUSE 500
LOW X
PAUSE 500
GOTO Start:

where X varies from 0 to 15.

Looking at the outpins with a 'scope, I can get pins 0 to 7 to cycle high and low with a 1 second duty cycle.· I get nothing from pins 8 to 15.

What am I doing wrong?



·

Comments

  • davejamesdavejames Posts: 4,047
    edited 2010-01-05 19:58
    Rocks,

    What data type is the variable X? How are you setting its value?

    DJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • stamptrolstamptrol Posts: 1,731
    edited 2010-01-05 20:01
    The only thing that comes to mind is, are you adjusting for the pin numbering of the 40 pin chip compared to 24 - pin Stamp?

    I believe the BS2-40 is numbered p0 - p15 down the left side, px0 to px15 up the right side.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Alan BradfordAlan Bradford Posts: 172
    edited 2010-01-05 20:10
    You also have to use Mainio and Auxio to switch banks.

    When you say pins 0-7 are you using the main I/o on IC pins 5-12 on the left side of the Stamp?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Alan Bradford ·N1YMQ

    Plasma Technologies
    Canaan NH 03741
    www.plasmatechnologies.com
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2010-01-05 22:53
    Rocks--

    Maybe this will help . . .

    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}
    ' The Professional Development Board (PDB) I/O pins are located in two DIFFERENT places,
    ' the connector labeled X15 and the connector labeled SX28. Depending on the actual port
    ' (there are 8 pins·to a port). The little program below demonstrates the location of the
    ' individual pins.
    ' Pins· 0 -· 7 are on connector X15· (0 - 7).
    ' Pins· 8 - 23 are on connector SX28 (RB0 - RC7).
    ' Pins 24 - 31 are on connector X15· (8 - 15).
    X·· VAR·· Byte
    Start:
    · FOR X = 0 TO 31
    ··· IF X <= 15 THEN
    ····· MAINIO
    ····· ELSE
    ····· AUXIO
    ··· ENDIF
    ··· DEBUG "Blinking Pin: ", DEC X, CR
    ··· HIGH X
    ··· PAUSE 1000
    ··· LOW X
    ··· PAUSE 1000
    · NEXT
    GOTO Start:
    ' The program above could be written many ways. The following does the same thing
    ' and may be clearer . . .
    'Start:
    '· FOR X = 0 TO 31
    '··· IF X <= 15 THEN
    '····· MAINIO
    '··· ENDIF
    '··· IF X >= 16 THEN
    '····· AUXIO
    '··· ENDIF
    '··· DEBUG "Blinking Pin: ", DEC X, CR
    '··· HIGH X
    '··· PAUSE 1000
    '··· LOW X
    '··· PAUSE 1000
    '· NEXT
    'GOTO Start:

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-06 16:13
    I've heard, with the 40-pin module, that pins 9 through 15 for "MAINIO" aren't where you'd think they would be.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2010-01-06 16:34
    allanlane5--

    They sure aren't where I'd LIKE for them to be! [noparse]:)[/noparse]

    I hope I provided Rocks with the correct information. The program I posted above does exactly what I said it will do. Still, I did not take that information out of the PDB literature . . . I derived it empirically.

    If you or anyone else thinks I am wrong, please let Rocks and me BOTH know! [noparse]:)[/noparse]

    Thanks.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
Sign In or Register to comment.