Shop OBEX P1 Docs P2 Docs Learn Events
Simultaneous pin errors — Parallax Forums

Simultaneous pin errors

Greg CGreg C Posts: 9
edited 2005-07-17 22:39 in BASIC Stamp
Hi, yes I'm a noob to BS2 but not to programming or electronics.

I've been working with my BS2 using Discovery kit with USB communication.· I'm able to enable one pin at a time for output but unable to enable two or more pins without having an erroneous errors.· Even a simple program to turn on two leds using pins 14 and 15 simultaneously creates erroneous flashing with no apparent pattern.· The program loops even without a loop statement.· Any help is appreciated.

I've unplugged the device to try to reset and pressed the reset button.· Same results each time.· I'm hoping I didn't recieve a bad BS2.· If you need further information I will post as needed.

Thanks in advance.

Greg

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-07-17 21:22
    Are you using a current limiting resistor on the LED? Can you post your program?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Greg CGreg C Posts: 9
    edited 2005-07-17 21:32
    Currently I have the 7 segement arrangement using this program to display "0" then "1" I'm getting a flashing "0" as the output. Using 1K ohm pulldown resistors.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    OUTH = %00000000
    DIRH = %11111111
    
    OUTH = %11100111
    PAUSE 1000
    OUTH = %10000100
    PAUSE 1000
    
    DIRH = %00000000
    
    END
    
    
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-17 21:39
    Are your resistors in series with the outputs? -- they should be. Pulling the outputs down doesn't protect the pins and you could damage your display and/or Stamp.

    Stamp Pin >----[noparse][[/noparse] 1K]
    |>|---- Vss

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Greg CGreg C Posts: 9
    edited 2005-07-17 21:42
    Yes, I've referred to pg 173 figure 6-11 of the "What's a Microcotroller" book to correctly wire the circuit. That is the way that it is connected.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-07-17 21:47
    Greg C,

    For a sanity check try swapping the "0" and "1" in code to see if you get a flashing "1" instead.

    What is the rate of flash? (approx)

    Are you using a fresh battery?


    
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    OUTH = %00000000
    DIRH = %11111111
    
    OUTH = %10000100
    PAUSE 1000
    OUTH = %11100111
    
    PAUSE 1000
    
    DIRH = %00000000
    
    END
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Greg CGreg C Posts: 9
    edited 2005-07-17 21:51
    With that program it seems I have a solid "1" that flashes to "0" momentarily approximately for 25 ms.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-17 21:52
    I'm betting the Stamp is browning out and reseting, hence the flash.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Greg CGreg C Posts: 9
    edited 2005-07-17 21:53
    Its connected to a 400ma 9 volt supply adapter.
  • kb2hapkb2hap Posts: 218
    edited 2005-07-17 22:00
    I tried your sample program myself copied and pasted it, downloaded it, and had absolutely no issues. again I would check the battery also is the programming port connected after you download the program? try disconnecting it after download.
    it sounds like the stamp keeps reseting for whatever reason.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • Greg CGreg C Posts: 9
    edited 2005-07-17 22:04
    kb2hap said...
    I tried your sample program myself copied and pasted it, downloaded it, and had absolutely no issues. again I would check the battery also is the programming port connected after you download the program? try disconnecting it after download.
    it sounds like the stamp keeps reseting for whatever reason.

    I'm not using a battery, I have a 400ma 9 volt supply connected with correct polarity.· Disconnecting the USB port has no effect.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-07-17 22:06
    Is your power supply clean? Some power supplies can have lot's of noise, that may require
    additional filter capacitors.

    Do you have a battery that you can temporarily try instead of the power supply?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Greg CGreg C Posts: 9
    edited 2005-07-17 22:09
    I initially used a new 9v battery. Unfortunately, the same results.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-07-17 22:32
    Try this test code and see if loops. The test here is to determine if you have a current issue that may be
    causing the BS2 to go into brownout. At each interval you are increasing the current demand by about 5mA.
    This program should find a make or break situation if there is a problem here.


    Another thing you could try is an external regulated 5 volt supply connected to pin 21. This will determine
    if the on-board regulator has been damaged or not.



    
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    OUTH = %00000000
    DIRH = %11111111
    
    
    TestLoop:
    
    DEBUG CLS
    OUTH = %10000000
    DEBUG "1",CR
    PAUSE 1000
    OUTH = %11000000
    DEBUG "2",CR
    PAUSE 1000
    OUTH = %11100000
    DEBUG "3",CR
    PAUSE 1000
    OUTH = %11110000
    DEBUG "4",CR
    PAUSE 1000
    OUTH = %11111000
    DEBUG "5",CR
    PAUSE 1000
    OUTH = %11111100
    DEBUG "6",CR
    PAUSE 1000
    OUTH = %11111110
    DEBUG "7",CR
    PAUSE 1000
    OUTH = %11111111
    DEBUG "8",CR
    PAUSE 1000
    
    GOTO TestLoop
    
    DIRH = %00000000
    
    END
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Greg CGreg C Posts: 9
    edited 2005-07-17 22:39
    Using a different regulated supply out of my lab, I've been able to get it to work. Apparently, the "new" 9V battery (recently bought at Radio Shack) was the initial culprit and the other power supply didn't help troubleshooting methods. Thanks for the help.
Sign In or Register to comment.