> Secondly, in the btfss loop, if the RA0 voltage never makes it to > logic 1, say if the > pin is disconnected for some unknown reason, you get an infinite loop. > That's a Bad Thing. > > Any thoughts, ideas etc? > > Ian Have a count limit based on a good battery/connection. If you know that the pin should change state within X number of loops then that's what you'd use. Temperature of the R may have some small effect on the count so a small margin might be needed. I think you'll need to bring a time factor into this, perhaps couple the test with a timer or WDT IRQ to limit the time spent waiting for something that possibly may never happen -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body