Hello Filipe,

I had to look this up since the library adc_channels.jal does not exist anymore 
since Jallib release 1.5.0. It was there in 1.4.0 and currently we are at 1.7.0.

The problem was that the library was not maintainable anymore so it was removed 
and the configuration of the channels was moved to the program of the user. 
Also the use of JANSEL was removed from all device files because of the same 
reason.

So I suggest you download the latest Jallib release and look at one of the adc 
sample files. They are all updated to incorporate this change.

For example, a typical adc set-up in your main program will then look something 
like this but this is PIC dependent.

-- Step 1: ADC analog input pin setup
const byte ADC_CHANNEL = 3                      -- potmeter connected to pin_AN3
ANSEL_ANS3 = TRUE                               -- port 3 is analog input 
(default)
pin_AN3_direction = input
-- Step 2: Set VDD and VSS as Vref
ADCON0_VCFG = FALSE
-- Step 3: Use Frc as ADC clock
ANSEL_ADCS = 0b011
const ADC_RSOURCE = 4_700                       -- Input resistance: 4.7K 
potmeter
-- Now we can include the library
include adc
-- And initialize the whole with our parameters
adc_init()

Kind regards,

Rob

________________________________
Van: jallib@googlegroups.com <jallib@googlegroups.com> namens flyway38 
<fsfon...@gmail.com>
Verzonden: dinsdag 16 augustus 2022 17:58
Aan: jallib <jallib@googlegroups.com>
Onderwerp: [jallib] PIC18F2580 ADC CHANNELS

Hello to all,

Am coding for this PIC (18F2580) now.
Need to use ADC and compiling fails with this log;

LOG:
jal jalv25r6 (compiled Oct 29 2021)
generating p-code
992 tokens, 700421 chars; 14125 lines; 19 files
generating PIC code pass 1
generating PIC code pass 2
1293 data accesses checked, 0 errors
87 skips checked, 0 errors
writing result
C:\JALLIB~1\lib/adc_channels.jal:3315: "
Unable to configure ADC channels.
    Configuration is supposed to be done using ANS bits
but it seems there's no ANS bits for this PIC.
    Maybe your PIC isn't supported, please report !"
1 errors, 0 warnings

Any help will be appreciated.
Thank you.

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 
jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/ab00461c-c965-43b7-8ef4-c8d726515d85n%40googlegroups.com<https://groups.google.com/d/msgid/jallib/ab00461c-c965-43b7-8ef4-c8d726515d85n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 jallib+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/GVXP195MB16371EDD0B65F72A265D8852E66B9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.

Reply via email to