Perhaps the equipment is at Ground potential and when the switch closes, the PIC input does not like to be connected to this ground. Try an isolated switch. Tony Just when I thought I knew it all, I learned that I didn't.