Hi Melanie. 1 - I have always set ANSEL=0 at the beginning of the program. The ADCIN command always converts the digital inputs back to analog as long as you use the command ADCIN 1,B1 and NOT use ADCIN PORTA.1,B1 or ADCIN GPIO.1,B1. It works for me every time. This is what is so confusing to me when I download sample programs - people have all sorts of header files for ADCON0, ADCON1, etc. They are not needed for 256 & 1024 bit results, ADCIN does it automatically. I have more examples if you want to see the header files.
2 - Your right, I typed the wrong port pin. AN0 is on GP0, AN1 is on GP1, AN2 is on GP2 and AN3 is on GP4. I tried ADCIN 3 and still no response from AN3 on GP4.
3 - Turns on again immediately? Yes possibly. I will delay the off and repeat the experiment. However, again the 16LF818 works every time.
4 - Regardless of how I set the trisio ports (all input or all output), it seems PBP automatically reconfigures the pin on demand in the program. GPIO.4 does indeed become an output when called on in my program. Thank you for such a quick response.
Bookmarks