Max Power,

I need to make a correction. 12F675 having 10 bit ADC channels but I was using them as 8 bit. Because in that job I do not need 10 bit conversation.

I made a system which is working without any problem. But it was not so easy to do that. Because as I told on my first message the system does not work with stability. Let say if you touch the touch point it is not coming the same result all the time. There is like a loop and after that loop you obtain again the same result.
For instance the ADC value is depend on what you use as touch point (cable , cupper plate etc) The capacity of that equipments are changing the ADC value.
I was using one short (about 25 cm) thick cable (single line inside). With that cable I was getting $85 value without touching to the cable. If I touch the ADC value was going down as zero ("0") This was the trick for me to catch the touch moment. BUt as I told you it was not stabil. Finally I decided to use also one loop to eliminate the false signals. Finally my siystem is working very well without any problem. I made both TOGGLE system and also NON-TOGGLE system.
Here is the codes for Toggle system;
* : TOGGLE *
'************************************************* ***************
@ DEVICE pic12F675
@ DEVICE pic12F675, WDT_ON
@ DEVICE pic12F675, PWRT_ON
@ DEVICE pic12F675, PROTECT_OFF
@ DEVICE pic12F675, MCLR_off
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT

DEFINE OSCCAL_1K 1

DEFINE OSC 4

DEFINE ADC_BITS 8
'DEFINE ADC_CLOCK 1
DEFINE ADC_SAMPLEUS 10
CMCON = 7
RAW VAR byte 56
TOP VAR WORD
SINIR VAR BYTE
I VAR BYTE
BUYUK var byte
KUCUK VAR BYTE
poz var bit
OPTION_REG=%01001111
GPIO=0
TRISIO=0
ANSEL = %01011111
ADCON0=%00001001
WPU=0
GPIO.2=1
SINIR=132 'This is the sensibility value can reach up to 136 according to my touching cable and it can be changed for the different material.
BUYUK=0
KUCUK=255

START:
GOSUB TUSBAK
'------------------------do not use these lines I was used them to see the ADC values-------------------------------
IF RAW>BUYUK THEN BUYUK=RAW
IF RAW>0 and RAW<KUCUK THEN KUCUK=RAW
WRITE $10,BUYUK
WRITE $11,KUCUK
'-------------------------------------------------------------------------------------------------------------------
IF RAW<SINIR and POZ=0 THEN 'this is the lines to eliminate the false loop
TOGGLE GPIO.5
I=0oz=1
BIR: gosub tusbak
IF RAW<SINIR then
I=0
GOTO BIR
ELSE
I=I+1
IF I<SINIR then BIR
ENDIF
pause 50
I=0
goto start
endif

pause 10
poz=0
GOTO START
TUSBAK: 'means check if there is a touch
GPIO.2=0
ANSEL.2=0
HIGH GPIO.2
ADCON0=%00001001 ' The direction of ADC channel is now GPIO.2 and C_hold is charging by the signal coming from AN2.
ANSEL.0=0 'sensor pin is digital
TRISIO.0=0 'sensor pin is now output pin
GPIO.0=0 'sensor pin is LOW and it was discharged
TRISIO.0=1 'Sensor pin is again input
ANSEL.0=1 'sensor pin is analog input now
ADCIN 0,RAW
BAK:
TRISIO.0=0
ANSEL.0=0
GPIO.0=0
RETURN
I hope everything is clear now.

Ero