PDA

View Full Version : Stamp lags in detecting IN6 being 0



Matthew
02-16-2005, 12:39 PM
Hello.

I have a 'break wire' trigger system set up on my stamp so that if IN6 = 0, the program will continue.

Pretty much the loop looks like this:

DO
LOOP UNTIL IN6 = 0

I have pin 6 conntect to a 220 resistor, which is connected to a wire, which is then connected to Vdd. Everything starts connected, and supposedly if I remove the wire, IN6 is supposed to = 0. In my case, sometimes it reads it right away, sometimes it takes up to 4 seconds. I know it's not a refreshing issue because I tested this:

DO
counter = counter + 1
DEBUG HOME, DEC5 counter
DEBUG, CR, DEC1 IN6
LOOP UNTIL IN6=0

'Counter' increases it's value very very very very rapidly, yet sometimes it won't detect IN6 being 0 if the wire is broken.

Any ideas?

steve_b
02-16-2005, 12:50 PM
Then whatever is in your DO loop is slowing you down.

You posted some do/loop code...is that what you actually use? and does THAT too take 4 seconds?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

jas
02-16-2005, 01:06 PM
Remember stamps dont have pull up or pull downs. When you dissconnect the wire the state of the pin is floating. Install a 10K resistor between ground and pin 6.

To see how a floating pins effect your progect run your program and rub your finger accross the pin. I am sure it will change state.

Matthew
02-16-2005, 01:34 PM
Jas,

Thanks a bunch man! It works now. The pull up and downs and floating pins makes lots of sense!

Matthew