Quote Originally Posted by ero View Post
I would like to use one touch button (or pad) with pic and I read the pdf file of Microchip AN1298 about that matter.
The document gives the following instructions to do the job;
* 1. Set 2nd channel to output, set high (VDD)
* 2. Select 2nd channel on ADC (charges CHOLD to VDD).
* 3. Set sensor line to output, set low (GND)
* 4. Select sensor line as input (TRISx = 1)
* 5. Select sensor channel on ADC (V-div sensor:CHOLD)
* 6. Begin ADC conversion
* 7. Reading is in ADRESH:ADRESL
I decided to write a program for 12F676 considering these explanations.
Here is the program . Could you pls someone check the program and let me know if there are some mistakes or missed points. Because the program does not work as I want.
See Microchip AN1298 - Capacitive Touch using only an ADC
I have been using this for years without any problems.
Warning: Other compiler

Norm