Em 03/01/2013 07:47, Justin Richards escreveu: >> RA5 is an analog input. The behavior you describe is exactly what >> happens when you forget to change an analog pin to digital before using = it. > That was it, reading the manual again I (re-)realised it was a analog > pin, but was the only one that seems to behave this way. > > With the device the manual seems to imply there is a one to one > relationship between ANSEL settings and the corresponding Analog > input, I too thought it was grouped. > > Cheers Justin Are we speaking of the same chip? The PIC16F877 doesn't have an ANSEL SFR, it has the ADCON1 register to control analog pins with only four bits to control the mode of all analog inputs. The inputs are indeed grouped and you cannot have some ANx configured as digital if ANz is analog with x < z, except for AN2 and AN3. Isaac --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .