Same here... I have a product using a 12C509, designed in 1999, still in pr= oduction=20 now. Likewise, it uses a single input to set a mode of operation (would you= believe=20 I'm also using GP3?), and in my case totally relying on internal pull up. P= CB track to=20 ground is cut or un-cut at assembly stage, covered with conformal coating t= o reduce=20 problems if (when) moisture is present. Program reads the input only at pow= er up to=20 decide what mode it's going to operate in. Nothing fancy... I only enforce = a 1ms=20 delay after power up to make sure the pull-up has had more than enough time= to=20 overcome capacitance on the input that might for example be exagerated by=20 moisture... could have done a proper debounce but in this case didn't bothe= r. Despite my example above, good debounce is essential where it matters and g= ood=20 practice everywhere else. Additonally I've sometimes used a schmitt-trigger= -like=20 software implementation: sample the input (or result of debounce routine) a= number=20 of times and keep a rolling tally of the number of 1's read. If 1's count >= 80% then=20 read as 1, less than 20% then read as 0. Any count in betweeen means no cha= nge,=20 and this dead-band gives a considerable amount of resilience to extreme=20 interference. Combined with appropriate pull-up resistor and hardware filte= ring of=20 course. AFAIR an internal pull up is somewhat im-precise but usually equates to 50k= or=20 more. So not suprising to get a 1 in a million false reading... depending o= n electrical=20 noise in the environment, the odd charged particle passing through, phase o= f the=20 moon, presence of dead fish being waved. I'm not sure if it I'd expect the = resistance=20 to change with age, though if the input was exposed to static then perhaps= =20 progressive damage might show up like this? On 25 Aug 2016 at 21:54, James Cameron wrote: > Hit an amusing one today; an aging 12C509 still in production, with > code from 2001, which reads GP3 to set reporting units, which had GP3 > floating by my soldering error, had begun reading a zero occasionally; > about one in a million reads. >=20 > So I added the missing strap. Let's see how it goes. >=20 > Hmm. But pull-ups are enabled. Either pull-ups are damaged, or the > circuit was picking up stray RF. The GP3 trace is about 2cm long. >=20 > Relevant code selective copy and paste; >=20 > ;; set option register to enable pull-ups and enable GP2 > MOVLW B'10011111' ; NOT_GPPU, T0CS > OPTION >=20 > ... >=20 > MOVLW B'00111011' > MOVWT >=20 > ... >=20 > ;; test for fahrenheit mode, gp3 low > ;; (if left open, it is pulled up to high) > BTFSS GPIO,3 >=20 > ... >=20 > --=20 > James Cameron > http://quozl.netrek.org/ > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist >=20 --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .