PIC18F Internal reference

adcpicreference

I am currently in the middle of migrating a project from PIC16LF1947 to a PIC18F87K22 as I am in need of extra GPIOS and the PIC18 part fits the bill. There is one thing that is nagging me right now is the internal ADC reference of the PIC. The PIC16LF has an internal bandgap reference. I tried to post a screen shot of the datasheet snipped but looks like I need more reputation to do that. REf- PIC16LF1946/47 page 4 Voltage reference module:.

It is nice in the sense that it lets you program the internal reference in increments of 1.024V. Now, the PIC18F has an internal bandgap reference too, but the datasheet is not divulging too much information. I spoke to the MCHP tech support and it was futile. At this point I would like to know how to set the internal BGR for my ADC conversions.

Best Answer

Your new PIC doesn't have the same set of voltage reference options which the old one does.
A quick scan through the ADC section of the new PIC's datasheet shows me that your reference options are:

REGISTER 23-2: ADCON1: A/D CONTROL REGISTER 1
VCFG<1:0>: A/D VREF+ Configuration bits
11 = Internal VREF+ (4.096V)
10 = Internal VREF+ (2.048V)
01 = External VREF+
00 = AVDD

So no 1.024V option.