Shop OBEX P1 Docs P2 Docs Learn Events
Can't get 3 pins to respond - seems like a simple thing ??? — Parallax Forums

Can't get 3 pins to respond - seems like a simple thing ???

Grumpy_SmurfGrumpy_Smurf Posts: 6
edited 2011-01-01 16:21 in BASIC Stamp
I was trying a new program and it wasn't working the way it was supposed to (direct driving 2 stepper motors through little step-u in remote mode, using analog joystick to adjust pulsout).

I thought that I would test the pins and found that pins 1, 7 and 14 were not changing from high to low as intended.

Went back to VERY basics and tested each pin one at a time.
Cleared the stamp first by simply running a blank program as below:

' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "All Clear"

No problem there
Then proceeded to check each pin, one at a time, using the below routine:

' {$STAMP BS2}
' {$PBASIC 2.5}

ledpin CON 14

delayTime CON 300

HIGH ledpin 'lights the LED for 2 seconds to start
PAUSE 2000

main:
TOGGLE ledpin ' IF it's on, turn it off
DEBUG HOME
DEBUG " Pin is ", ? IN14 'shows the current state of the pin

PAUSE delaytime ' pauses long enough to see it

GOTO main ' cycles back

END ' not really useful, but good practise to put it in every program

' ******************************************************************************
pins 1, 7, and 14 would not change, all the others are fine ????

checked with a meter and there is 5v between them and Vdd/Vcc constantly (even after clearing it again) additionally pin 2 has 3.45 volts across it?

Must be a very simple explanation, but it is escaping me at the moment, what do I need to do to reset these pins?
Thanks

Comments

  • Grumpy_SmurfGrumpy_Smurf Posts: 6
    edited 2010-12-28 04:40
    I have just doe some more testing with the meter and found that pin 2 is only operating between 3.5 volts (high) and 1.45 volts (low) using the above testing routine.
    Also when I lengthened the delaytime to 5 seconds ( so that I could read the meter) I noticed that the pin voltage on pins 1, 7 and 14 was changing, when given a 'high' it was moving to 0.03v, so something is happening when the toggle command is actioned, I just don't know what .
  • Mike GMike G Posts: 2,702
    edited 2010-12-28 08:46
    So you have the negative multimeter lead connected to ground and the positive connected to pin 2 and nothing else is connected to pin 2? Or are you measuring the voltage across a circuit?

    PINs could be blown?
  • Grumpy_SmurfGrumpy_Smurf Posts: 6
    edited 2010-12-28 13:33
    I have checked the pins in as may different was as I can think of:

    Red (+) lead on meter to Vdd, Black to Pin (direct - no circuit), gives 5.02v

    Same thing on Pin 2 gives 3.68 volts when Pin 2 is set to HIGH and 1.45(ish) when Pin 2 goes LOW.

    Set up a simple LED and 470 Ohm resistor to make a circuit to Vss and tested again, when Pin 14 goes HIGH it generates a tiny voltage (0.01v ~ 0.03v).

    I didn't think that it was possible to "blow a pin".
    I can understand if the whole micro has been blown or in some other way been wrecked, but to selectively blow pins while the rest of the micro is functioning (as far as I can tell) perfectly seems unusual.

    Does anybody know of a robust way to confirm if this is more of a physical problem (e.g. blown pins)?
    Thanks
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-12-28 14:04
    If I were checking this, I'd write a program that makes all pins an output, then manually toggle your outputs. HARD CODE, very basic instructions, nothing fancy:

    OUTPUT 0
    OUTPUT 1
    ..........all the way to......
    OUTPUT 14
    OUTPUT 15

    then,

    OUT0,1
    OUT1,1
    ..... all the way to.....
    OUT14,1
    OUT15,1

    then, pause:
    PAUSE 2000

    then all off:
    OUT0,0
    OUT1,0........

    PAUSE 2000

    GOTO the beginning

    Remove the BS entirely from the or any circuit and plug it into a fresh protoboard "naked" with absolutely nothing else..Run your 5V and ground in. Now go through pin by pin with a meter set to DC

    Yea it might be silly to hard code stuff like this, but it also eliminates overlooking a subtle mistake.


    The BS is pretty robust. One guy blew the internal V regulator, but it still worked on a 5V supply. Sure you can pop one pin, or two, or three while everything else works fine.
  • ercoerco Posts: 20,256
    edited 2010-12-28 19:17
    Blowing an output pin is very easy and very common. It may still function as an input.

    Somebody made an ingenious software-only BS2 test program that automatically tests each pin as an input and output. Search the forums... use the Force, Luke!
  • ercoerco Posts: 20,256
    edited 2010-12-28 19:45
    Found that BS2 test program. Tracy Allen is, as ever, the Man with the Plan.

    Check out his code partway down this thread: http://forums.parallax.com/showthread.php?124744
  • Mike GMike G Posts: 2,702
    edited 2010-12-29 08:55
    I messed up pin 7 on a BS2p once because I placed it backwards in a USB BOE socket.

    How about connecting the negative lead to Vss and the positive lead on the PIN you're testing. Kinda sounds like a blown pin though.
  • Grumpy_SmurfGrumpy_Smurf Posts: 6
    edited 2010-12-30 00:24
    Thanks for the help everyone, yes I can confirm that I have blown the Pins (still interesting about Pin 2 being 'sort-of' blown).
    This at least gives me a good excuse to upgrade to the BS2px as a main chip and leave the now very old BS2 as a sort of slave processor when I want to have a secondary task running.
  • Grumpy_SmurfGrumpy_Smurf Posts: 6
    edited 2010-12-30 00:27
    In reply to Spiral_72 (post#5)
    Yes this is a very 'robust' way and hard to fault.
    I now testing using the program that Erco (post#7) listed and confirmed using this technique, all confirm that I have blown the pins, ah well BS2px 'come to Daddy little chip'.
  • ercoerco Posts: 20,256
    edited 2010-12-30 08:55
    Once again, it's possible to blow a pin's output circuitry, yet it may function properly as an input. Seen that a few times. Double check those test results (throw in a DEBUG statement or two) and don't give up on a particular pin unless it fails both the output AND input tests.

    Everybody needs a little input. You may be able to use the half-damaged Stamp by swapping some I/O pins.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-12-31 07:15
    Chris also has a test program and circuit for BASIC Stamps at his website.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-12-31 07:18
    Check out Savage Circuits for the Basic Stamp Tester.
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-12-31 07:21
    Even if you have three blown BS2 pins, it will still have five more pins than a BS1's eight. It's still very usable.
  • NewGuy2NewGuy2 Posts: 4
    edited 2011-01-01 12:56
    Yes, you can blow a pin. And connecting it directly to a stepping motor coil is one way to do it -- typically you need the kinds of 'driver' circuits on the Parallax web-site between the I/O pin and the stepping motor.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-01-01 16:21
    On Your next Stamp use 200-250ohm series resisters on each I/O pin.
    '
    I have been using the BS2's since 04'. Never burnt out a pin,I always use an in line resister.(220 ohm)
    Check out the BASIC Stamp Ref. manual on how to connect to an I/O pin.
Sign In or Register to comment.