From: "Palmed GmbH" > Padu, > > give us a code snippet of your port init. This sounds, that your input isn't > an input... > > A simple test is, to connect a relative high resistor (let's say 100K) from > RA0 to GND, if RA0 is really an input the voltage should be 0V. Then connect > same R to +5V and RA0 must be +5V. > > Peter Ok, I didn't have an 100k around, so I did it with a 68k. When I measure it from RA0 to GND, it is zero allright, but when I connect it to +5V, measured voltage is 1.27V. If I connect RA0 directly to VCC then it goes to 5V, but I think that would happen no matter what right? I'm using mikroPascal, which sometimes simplifies lots of things because of their libraries, but sometimes it screws me up because I have to debug their libraries for them.... Here's a snippet of pascal: ////////select Vref and analog inputs, in order to use ADC_read /////////////// ADCON1 := 0; // all porta pins as analog, VDD as Vref TRISA := $FF; //////////////////////////////////////////////////////////////////////////// //// and to read I use this command: Ein := ADC_read(0); Do I need to do something other than TRISA := FF in order to set RA0 as input? I'm gonna try to examine the assembly code generate by mP to see what how they are initializing the ADC. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist