Picit
Newbie level 5

PIC16F88 ADC returns half the values expected. Expecting 1024 and getting much less?
Hi, I've been using a PIC16F88 to control 7 segment displays, LCD controllers and a BCD all without problem, but I'm struggling to understand the ADC.
The setup:
I have setup the PIC to read a value from a 10k trim pot linked to the 5v supply that feeds the PIC.
The PIC is using the internal clock and setup to run at 4Mhz.
The ADC is setup to use the internal voltage reference e.g. Avdd and Avss.
The ADCON register is setup for 10bit right justified.
The binary output from the registers ADRESH and ADRESL are fed to the LCD
The problem:
At startup, with the trim pot set to minimum the LCD reads 0 as expected.
As I wind up the Trim pot the values increase as expected.
With the trim pot at maximum the registers read 00000001:11001101 (461)
Even taking a direct wire from +5V I get the same values
I'm expecting something like 00000011:11001101 (972) e.g. close to the max ADC value 1024.
I'm not sure if i'm doing something wrong or I have misunderstood how the ADC works. Please help. Thank you. Any ideas welcome.
Hi, I've been using a PIC16F88 to control 7 segment displays, LCD controllers and a BCD all without problem, but I'm struggling to understand the ADC.
The setup:
I have setup the PIC to read a value from a 10k trim pot linked to the 5v supply that feeds the PIC.
The PIC is using the internal clock and setup to run at 4Mhz.
The ADC is setup to use the internal voltage reference e.g. Avdd and Avss.
The ADCON register is setup for 10bit right justified.
The binary output from the registers ADRESH and ADRESL are fed to the LCD
The problem:
At startup, with the trim pot set to minimum the LCD reads 0 as expected.
As I wind up the Trim pot the values increase as expected.
With the trim pot at maximum the registers read 00000001:11001101 (461)
Even taking a direct wire from +5V I get the same values
I'm expecting something like 00000011:11001101 (972) e.g. close to the max ADC value 1024.
I'm not sure if i'm doing something wrong or I have misunderstood how the ADC works. Please help. Thank you. Any ideas welcome.