Hi Bob. This is how I use the 818 & 819. I prefer the easier 255 step ADC but used the 1024 in the past with no problem.
OSCCON = $60 'set int osc to 4mhz
'USE OSCCON = $70 for 8mhz
adcon1 = 7 ' set inputs to digital. adcin command will convert to analog
MYVAR VAR BYTE
'uncomment & use the following 4 lines for 1024 step conversion INSTEAD of 'var byte
'MYVAR VAR WORD
'DEFINE ADC_BITS 10 ' Set number of bits in result
'DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
'ADCON1.7 = 1 'RIGHT JUSTIFY RESULT
@ DEVICE MCLR_ON, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
Bookmarks