Der Portpin muss als digitaler Eingang konfiguriert werden (-> ANSG-Register).
10.2 Configuring Analog Port Pins (ANSEL)
The ANSx and TRISx registers control the operation of the pins with analog function. Each port pin with analog function is associated with one of the ANS bits (see Register 10-1 through Register 10-7), which decides if the pin function should be analog or digital. Refer to Table 10-1 for detailed behavior of the pin for different ANSx and TRISx bit settings.
When reading the PORT register, all pins configured as analog input channels will read as cleared (a low level).
Viele Grüße
Bernd