At 08:01 PM 8/6/02 -0400, you wrote: >By the way, I don't have a spare pin to implement hardware solution. All the >detection and mitigation must be done in software. > >My question is, how to do it? If you set the input pin to output, drive it low and then read it, you can tell if it is *really* stuck to Vdd, as the PIC reads the actual pin state rather than the output latch. You might have to beef up your external drive circuit to guarantee it has more drive than the internal n-channel transistor. Connecting a small capacitor on the pin might allow you to get an idea that is more accurate (drive it low, then wait- with a time-out- for the pin to come high with your external pullup (open-drain or collector drive). If the pin fails to come high, or comes high TOO fast, then you have a problem. Don't make the time constants more fussy than you have to, the thresholds vary on the inputs etc. Homework. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com 9/11 United we Stand -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics