Ummmm. I do no think the 18F13k22 chip as has AN19... that looks like an error in the DAT non-functional information.
If my version here: Build 12899. I see ADCConstants AN{0..12} USAGE:AN0..AN12 These constants are the valid ADC constants which should be ADCConstants AN{0..12} USAGE:AN0..AN11
Where, portc.7 is AN9
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm attempting to read ADC channel AN19 (via portc.7) on a 18F13k22 chip without success.
Here is a sample of the code
dim my_variable as word
dir portc.7 in
my_variable = readAD10(AN19)
readAD(AN19) does not work either
The same code works fine with ADC channel AN2 via portA.2
After reading through the 18F13k22 datasheet I tried adding /modifying these lines in the 18f13k22.dat file without success:
ADC=19
ADCConstants=AN{0..19} USAGE:AN0..AN19
added CHS4,ADCON0,6
While these changes didn't appear to break anything they didn't make ADC channel AN19 work.
Any help would be appreciated thanks
Is 18F13k22 correct ?
Ummmm. I do no think the 18F13k22 chip as has AN19... that looks like an error in the DAT non-functional information.
If my version here: Build 12899. I see
ADCConstants AN{0..12} USAGE:AN0..AN12
These constants are the valid ADC constants which should beADCConstants AN{0..12} USAGE:AN0..AN11
Where, portc.7 is AN9
Apologies, I downloaded the wrong datasheet (18f2x)
Tested AN9 via portc.7 and it's working. Apologies for taking up your valuable time.
Last edit: Rikki 2023-10-26
No problem.
I recommend always to use PICINFO to open the correct datasheet.
:-)