If I remove the DEFINEs usually associated with the ADCIN function:
and use Fosc/8 as the timer:Code:'DEFINE ADC_BITS 10 ; Set number of bits in result 'DEFINE ADC_SAMPLEUS 50 ; Set sampling time in uS (was 5) 'DEFINE ADC_CLOCK 3 ; Set clock source (3=rc)
Then I get 0-255. If I do the same for 10-bit resolution, though, I now get 1-1023.Code:ADCON1 = %00010000 ; Left-justified results in 8-bits; Fosc/8 as timer




Bookmarks