Hello,

Cannot make my PIC18F2580 make ADC conversions at 10bits (High Resolution).
It is converting at 8bit (Low Resolution).
Here's my code.
Any help would be great.

-- Measure using high resolution
const bit ADC_HIGH_RESOLUTION = ON
-- Step 1: ADC analog input pin setup
const byte ADC_CHANNEL = 0                       -- port 0 is analog input 
(default)
const byte ANSEL_ANS0 = TRUE                     -- potmeter connected to 
pin_AN0
pin_AN0_direction = input
-- Step 2: Set VDD and VSS as Vref
const byte ADCON0_VCFG = FALSE
-- Step 3: Use Frc as ADC clock
const byte ANSEL_ADCS = 0b011
const ADC_RSOURCE = 500                          -- Input Resistance
const ADC_TEMP = 20                              -- PIC Temperature
-- We want the fastest possible ADC timing, so we specify here the
--const ADC_MIN_TAD = 1
const ADC_MAX_TAD = 10
-- Now we can include the library
include adc
-- And initialize the whole with our parameters
adc_init()
--
var byte AdcChnn = 0

Inside Forever Loop

AdcData = adc_read_high_res(AdcChnn)

Using latest (I think) compiler;
jal jalv25r6 (compiled Oct 29 2021)

Thankyou.

Kind regards,
Filipe Santos.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/beb04e53-0d62-43bc-95dc-9680c4ef175an%40googlegroups.com.

Reply via email to