can any one tell me if there is any way to change the ADC conversion time? and what is the acquisition time calculated?
it is default 40 cycles , i am using a 16f716 internale clock with RC OSC and i used to test the conversion complete flag "BTFSS "before i record the converted value to a register
i check the flowcode uses lot of lines to do the ADC so i tried to use my old asm code that works and enter the below code in the c block and got error
Code: Select all
asm
{
;adcon=================================================
BCF STATUS,Z
MOVLW 0XC1
MOVWF ADCON ;SELET CHO/IN CLK
BSF ADCON,2 ;start conversion
;===========enter sensor dig====================
ADLOOP
BTFSC ADCON,2 ;check convertion is done
GOTO ADLOOP ;wait
MOVF ADRES,0 ;PLACE RESULT IN W
BCF ADCON,0 ;turn off adcon
MOVWF data1 ;record to data1
;targetLo===========enter ref signel=============================
BCF STATUS,Z
MOVLW 0XC9
MOVWF ADCON ;SELET CH1/IN CLK
BSF ADCON,2 ;start conversion
ADLOOP2
BTFSC ADCON,2 ;check convertion is done
GOTO ADLOOP2 ;wait
MOVF ADRES,0 ;PLACE IN W
BCF ADCON,0 ;turn off adcon
MOVWF data2 ;record to data2
;targethi========================================
BCF STATUS,Z
MOVLW 0XD1
MOVWF ADCON ;SELET CH2/IN CLK
BSF ADCON,2 ;start conversion
ADLOOP3
BTFSC ADCON,2 ;check convertion is done
GOTO ADLOOP3 ;wait
MOVF ADRES,0 ;PLACE IN W
BCF ADCON,0 ;turn off adcon
MOVWF data3 ;record to data3
;throttle=================================================
MOVLW 0XD9
MOVWF ADCON ;SELET CH2/IN CLK
BSF ADCON,2 ;start conversion
ADLOOP4
BTFSC ADCON,2 ;check convertion is done
GOTO ADLOOP4 ;wait
MOVF ADRES,0 ;PLACE IN W
MOVWF data4 ;record to data5
BCF ADCON,0 ;turn off adcon
}