Hello,
I was made one simple test program with ADC. I have problem with MCS compiled. I don't understand what is wrong with ANSEL = 1 command? Into status line write syntax error!! When disable this ANSEL command compiled finished ok. I was trying compile with PBP2.50b and MPASM and result is equal.
Who is problem here?
@ Device PIC12F675,WDT_ON,PWRT_ON,PROTECT_OFF,MCLR_OFF,BOD_ OFF
ANSEL = 1
ADCON0 = 3
CMCON = 7
DEFINE OSCALL_2K 1
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
w0 VAR WORD
w1 VAR WORD
w2 VAR WORD
w3 VAR WORD
w4 VAR WORD
w5 VAR WORD
w6 VAR WORD
w7 VAR WORD
out VAR GPIO.2
meritev: ADCIN 0, w0
w1= 1023-w0/2
high out
pause w1
low out
pause w1
goto meritev
Bookmarks