yes found many examples of the 12F, 16F arrangements , and since the they dont have a CTMU like the 18F , the register setup and approche are not close at all ,

the point after a valid reading is done maybe simular in that they can take multi readings to establish a base line for " not touched " , a touched reading value " and a " variance value " between the 2 values
or from the apnote a debounce approch

for this requirement , i am just looking for a simple on / off touch switch from the 18F ad ch17 ( spare ad channel)

i have tested the ad channel to see if it reading a known other ad input value and its working fine , so it purely how the CTMU is setup and used.



the examples in the ap note read clear enough , just not geting a result that looks right or is usable

since the code manually sets the " edge" and read of the AD channel , the edge1 or 2 status should be always read 0 ???????????????????

the setting for the triggers in the ADCON1 - TRIGSEL ( bit 7,6) 01 - Trigger from CTMU is not used as the start for the A/D conversion ,which then does not require CTTRIG on reg CTMUCONH.0 to output the trigger from what i think it normally would be

i dont have any external pin ( CTED1, CTED2) for external triggers , or the ECCP1 or ECCP2 for timed input triggers ,although i have tried them with no " edge trigger seen so far"

the subroutine is called every 10ms by ISR to get touch reading value at the moment.

when 20 reads are done the results are averaged via DT''s modified running average routine to establish base line for touched / not touched trigger point


been playing with this a day , and cannot get the answer as yet


regards

Sheldon