Maker Pro
Maker Pro

Pic 16f877a anlog input error

saneeshforu

Feb 23, 2014
5
Joined
Feb 23, 2014
Messages
5
Haii all ..
I have a doubt with analog inputs in pic16f877a....I have designed a temperature indicator using lm35 and pic 16f877a(AN0 pin used) it is working well also.
I found a scenario that when we connect any of other analog inputs (AN1 to AN7) to VCC then the temperature reading increasing by 15 degree(ie 150 mv).
I measured the voltage at AN0 pin and it not have an increase of 150mv.So the error may be an internal...? How this type of interference occurs. May be this
is a simple question for professional...but i am a beginner ...help me
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
Check page 114 of the datasheet with regards to Tacq (acquisition time). How much time do you allow between the time you select an ANx pin to read and the time you start an A/D conversion?

If you switch inputs "too fast" (well, switch inputs and start the A/D "too fast"), the hold capacitor may not have finished charging or discharging to the new pin's voltage before you begin the conversion.

Also, how do you have the LM35 connected to the PIC? Any series resistor? Capacitor? Those will affect the acquisition time as well. The recommended impedance of an analog signal is under 10K ohms. Higher than that and pin leakage becomes a factor, which could also be what's causing your issue.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
What VRef voltage are you using? Are you feeding signals into the ADC that are higher than VRef?

Have you disabled analogue input functions on the other I/O pins? You should definitely do that if you're using the other ADC-capable pins as digital I/O.
 

saneeshforu

Feb 23, 2014
5
Joined
Feb 23, 2014
Messages
5
Check page 114 of the datasheet with regards to Tacq (acquisition time). How much time do you allow between the time you select an ANx pin to read and the time you start an A/D conversion?

If you switch inputs "too fast" (well, switch inputs and start the A/D "too fast"), the hold capacitor may not have finished charging or discharging to the new pin's voltage before you begin the conversion.

Also, how do you have the LM35 connected to the PIC? Any series resistor? Capacitor? Those will affect the acquisition time as well. The recommended impedance of an analog signal is under 10K ohms. Higher than that and pin leakage becomes a factor, which could also be what's causing your issue.

okkk sir Its now working,,
 

saneeshforu

Feb 23, 2014
5
Joined
Feb 23, 2014
Messages
5
What VRef voltage are you using? Are you feeding signals into the ADC that are higher than VRef?

Have you disabled analogue input functions on the other I/O pins? You should definitely do that if you're using the other ADC-capable pins as digital I/O.

Thanks for your consideration ..and time ..Now it is working well
 
Top