Shop OBEX P1 Docs P2 Docs Learn Events
I/O Problem — Parallax Forums

I/O Problem

TomSTomS Posts: 128
edited 2005-11-28 02:44 in BASIC Stamp
I'm trying to use SHIFTOUT and PULSOUT. When I use pins 0 - 7 for output everything works fine. But when I try to use pins 8 - 15 nothing comes out. What gives?

Tom

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-11-28 00:52
    We can't tell without your COMPLETE code, including pin assignments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-11-28 00:56
    Well, you didn't included your programming, so I'll guess that you aren't setting up pins 8-15 as outputs beforehand.· I'm figuring that using SHIFTOUT and PULSOUT aren't the same as OUTPUT (which makes the pin associated an output regardless.)· Maybe you're declaing P0-7 as outputs, but not P8-15.
  • TomSTomS Posts: 128
    edited 2005-11-28 01:20
    I've reduced the program to the following:

    ' {$STAMP BS2P}
    ' {$PBASIC 2.5}
    Main:
    PULSOUT 15, 10
    PAUSE 20
    GOTO Main

    It works as long as the first argument of PULSOUT is <= 7.
    I've tried setting the pin to OUTPUT but it doesn't do any good.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-28 01:22
    How do you know it's not working? Have you looked at the output with a 'scope. BTW, there is no need to use OUTPUT ahead of PULSOUT, but you will want to use LOW or HIGH -- PULSOUT inverts the state of the selected pin for the duration. If you want a high-going pulse on one of the pins, initialize that pin with LOW.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TomSTomS Posts: 128
    edited 2005-11-28 01:24
    I'm using an oscilloscope to view the output.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-28 01:37
    How is the BS2 mounted? I.e., is it on one of the Parallax development boards, or in a custom circuit? Anything attached to the pin? How about if you use simple HIGH and LOW commands?

    ' {$STAMP BS2P}
    ' {$PBASIC 2.5}
    DO
    HIGH 15
    INPUT 15 : DEBUG BIN1 IN15
    LOW 15
    INPUT 15 : DEBUG BIN1 IN15
    LOOP

    What do you see on the 'scope, and what do you see on the debug screen (without the 'scope probe attached)?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TomSTomS Posts: 128
    edited 2005-11-28 01:42
    The BS2 is on a Parallax board, two days old.

    Your code yields alternating 1's and 0's on the Debug screen. Still nothing on the output. I've also tried using an alternate connector but get the same results.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-28 01:49
    Try placing the 'scope probe directly on the pin on the 24-pin Stamp module. That is physical pin 20, logical pin p15. The fact that you are getting alternating 0s and ones indicates that the BS2 is working, but maybe there is an open circuit somewhere else.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • TomSTomS Posts: 128
    edited 2005-11-28 02:03
    There are some problems with the BS2p. On pin 20 I had a pulse with normal rise time and a RC decay for the return to low. I measure an open ciruit between pin 20 on the chip and pin 20 on the board (bs2p demo board) I removed the bs2p but couldn't see any obvious problems. Looks like a bad board/and/or bs2p. When I put the bs2p back in I lost all on one of the connectors. Even pin 1 looks lousy. I guess I'll have to return it.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-28 02:17
    If you have the 'scope probe on p15 while running the program that goes HIGH 15 : INPUT 15 : LOW 15, you will in fact see an RC decay from high to low, as the small capacitance of the pin discharges through the input resistance of the 'scope.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-28 02:23
    If you're using a BS2p24 on the BS2p24/40 demo board then the P8..P15 pins are actually connected to the A8..A15 sockets -- there's a note about this on the last page of the documentation.

    Docs: http://www.parallax.com/dl/docs/prod/boards/BS2p2440DBrd.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TomSTomS Posts: 128
    edited 2005-11-28 02:39
    You are, of course, correct. I had the documentaion dated 10/2002 and it didn't say anything about it. The file you pointed me to is dated 10/2004.

    Thanks
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-28 02:44
    Sorry for the confusion -- back in 2002 we had separate demo boards for the -24 and the -40; it ultimately made sense just to sell one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.