BS2 Input Ports
crsahi
Posts: 4
I have a BS2 on a super carrier board. For an unknown reason to me, I am unable to use P6-P15 as Input ports. Using Parallax's Input_Output.BS2 program with one of these higher port with 5V at the port (and checked with a voltmeter on the chip) it debug only outputs a·0. Any recommended fixes?
·
·
Comments
Jeff T.
Thanks for you interest. I'm using the following routine and the 5 V is delivered through a micro switch with a 10K resistor. If I change the Input pin to one below P6 with the same set-up, the debug outputs a 1.
Carl
' {$STAMP BS2}
' {$PBASIC 2.5}
Main:
· INPUT 7······························ ' Make P7 an input
· DEBUG "State of P7: ",
······· BIN1 IN7, CR
· END
' {$STAMP BS2}
' {$PBASIC 2.5}
Main:
· INPUT 7······························ ' Make P7 an input
· DEBUG "State of P7: ",
······· BIN1 IN7, CR
PAUSE 500
GOTO main
your micro switch should have Vdd on one side , from the other side a 220 ohm resistor to the input pin
In addition you should have a 10K ohm pull·down resistor,·connect one end to·the juction of the 220 ohm resistor and the input pin and the other end to Vss
Jeff T.
I made the changes as you suggested. Unfortunately, the BS2 is still not picking up the change in the state at the port.
Carl
A couple of things first, are you using X1 or the prototype area to connect your components
Secondly try this to see if pressing the micro switch has any effect on the inputs
DIRS=%0000000000000000
Main:
DEBUG HOME,BIN16 INS
PAUSE 500
GOTO main
move the switch from P0 to P15 and run the test with each pin
Jeff T.
I ran your current suggestion. Pins 0,1,2,4,9,11,12 work. The rest don't. I think you are right, the chip is faulty. I have to get it replaced.
Thanks a lot for all of your help.
All the best,
Carl
Have you contacted Tech Support to have your module tested yet? You should know that each and every BASIC Stamp Module is fully tested before shipping. This includes all I/O lines. I would suspect there may be some damage here somewhere. Whether it is the BASIC Stamp Module or the Super Carrier Board is not clear at this time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support