Can't get 3 pins to respond - seems like a simple thing ???
Grumpy_Smurf
Posts: 6
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
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
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 .
PINs could be blown?
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
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.
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!
Check out his code partway down this thread: http://forums.parallax.com/showthread.php?124744
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.
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.
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'.
Everybody needs a little input. You may be able to use the half-damaged Stamp by swapping some I/O pins.
'
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.