I'm having trouble with an I/O function. I have a capacitor, connected through three resistors, to three I/O pins. The Capsense pin connects to the cap through a 1k resistor. The other two pins are varying resistance. If I set them as inputs, then the resistances don't matter. If I set either one as output, then it charges or discharges the cap at a rate determined by it's resistor. The basic idea is to read the cap RC time constant, as a form of A/D converter. Everything's fine, till I get to the point where I want to watch the cap discharge, until it's low, before taking one of the other pins to output high. Read_Function: btfsc PORTB,Capsense ;loop here till low on cap sense pin goto Read_Function ; The Capsense pin is set as an input, as is one of the other two pins The third is an output, and I can see that it is low, and that the voltage on the capsense pin is also low, but the code loops here forever, indicating that it's seeing a high input. I've walked through all the banking, and I believe that I'm in the right banks when I'm talking to PORTB and TRISB. I've disabled all peripherals that would otherwise use portb pins. So, how could I get stuck here, given a low on the Capsense pin of portb? -- Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body