thanks alot
another newbie question
can i use tmrcon istead of for loop
such as;
CalcTime var word
Define LCD_DREG PORTC
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 0
Define LCD_EREG PORTB
Define LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2

DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50

TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %00000000 ' Set PORTA analog

ADCINFO VAR BYTE


'================================================= =======================

T1CON.0=0
TMR1H = 0
TMR1L = 0
ADCON1 = 0


ADC_READ:
PAUSE 500

timeloop:
ADCIN 0, ADCINFO
IF ADCINFO => 511 THEN GOSUB STARTTIMER
IF ADCINFO == 980 THEN GOSUB STOPTIMER
PAUSE 100
GOTO timeloop

STARTTIMER:
T1CON.0=1
RETURN

STOPTIMER:
T1CON.0=0
RETURN

GOTO ADC_READ

CLEARWDT
CalcTime.Highbyte=TMR1H
CalcTime.Lowbyte=TMR1L

Loope:
LCDOUT $FE, 1
LCDOUT "t:", CalcTime
Pause 500
Goto loope

GOTO ADC_READ
END