I am running your code in Post #8. In the code RA0 is input Pin that receive analog signals. When I am running the same program I don't know why I am getting random values shown in post #20Can only guess, but maybe your code sets RA0 as output instead of input?
The wiper of the pot should be connected to PIN2 of the PIC. That is AN0. I don't know why you are referring to AN11 and AN12.I measured output voltage of pot 2.50 v but I get 50m volt at RA0 pin
@JohnInTX There are two pot on the board whose names are shown AN11 and AN12 on the board.o@hexreader 's previous post. I agree with his analysis.
I have attached picturePost a clear picture of your wiring?
Hi @JohnInTX, All credit goes to you to find the exact problem. Thank you very much for saving me from troubleEDIT: looking at the back of your board, I think you are hooked to PIC pin 3 not pin 2.
https://forum.allaboutcircuits.com/threads/pic-development-board-with-pk3.172494/post-1554057
ADC_VAL Voltage
-----------------
0 0.000 V
1 0.001 V
2 0.002 V
3 0.003 V
4 0.004 V
5 0.005 V
6 0.006 V
7 0.007 V
8 0.008 V
9 0.009 V
11 0.010 V
12 0.011 V
12 0.012 V
13 0.013 V
14 0.014 V
15 0.015 V
16 0.016 V
17 0.017 V
18 0.018 V
19 0.019 V
20 0.020 V
21 0.021 V
22 0.022 V
23 0.023 V
24 0.024 V
25 0.025 V
26 0.026 V
27 0.027 V
28 0.028 V
29 0.029 V
30 0.030 V
31 0.031 V
32 0.032 V
33 0.033 V
34 0.034 V
35 0.035 V
36 0.036 V
37 0.037 V
38 0.038 V
39 0.039 V
40 0.040 V
41 0.041 V
42 0.042 V
43 0.043 V
44 0.044 V
45 0.045 V
46 0.046 V
47 0.047 V
48 0.048 V
49 0.049 V
50 0.050 V
51 0.051 V
52 0.052 V
53 0.053 V
54 0.054 V
55 0.055 V
56 0.056 V
57 0.057 V
58 0.058 V
59 0.059 V
60 0.060 V
61 0.061 V
62 0.062 V
63 0.063 V
64 0.064 V
65 0.065 V
66 0.066 V
67 0.067 V
68 0.068 V
69 0.069 V
70 0.070 V
71 0.071 V
72 0.072 V
73 0.073 V
74 0.074 V
75 0.075 V
76 0.076 V
77 0.077 V
78 0.078 V
79 0.079 V
80 0.080 V
81 0.081 V
82 0.082 V
83 0.083 V
84 0.084 V
85 0.085 V
86 0.086 V
87 0.087 V
88 0.088 V
89 0.089 V
90 0.090 V
91 0.091 V
92 0.092 V
93 0.093 V
94 0.094 V
95 0.095 V
96 0.096 V
97 0.097 V
98 0.098 V
99 0.099 V
100 0.100 V
101 0.101 V
102 0.102 V
103 0.103 V
104 0.104 V
105 0.105 V
106 0.106 V
107 0.107 V
108 0.108 V
109 0.109 V
110 0.110 V
650 0.650
999 0.999 V
1000 1.000 V
...
4094 4.998 V
4095 4.999 V
A0 Pot at 0.03 V
0035
0036
0035
0036
0037
0023
0035
0036
0037
0028
0035
0035
0036
0037
0036
0036
0035
0036
0036
0035
0036
0039
0030
A0 Pot at 2.30 V
1877
1869
1883
1876
1876
1886
1886
1883
1878
1886
1869
1886
1869
1869
1904
1883
1877
1883
1869
1877
A0 Pot at 4.59 V
3693
3727
3717
3745
3739
3732
3732
3717
3738
3717
3709
3709
3717
3693
3717
3693
3738
3717
3745
3693
3709