View previous topic :: View next topic |
Author |
Message |
mindstorm88
Joined: 06 Dec 2006 Posts: 102 Location: Montreal , Canada
|
ADC problem with 16F877A |
Posted: Wed Jan 06, 2010 2:48 pm |
|
|
Hi guys, I don't think that I have a code problem, so here is the question :why adjacent channels affect each others ?? Right now if I have a change on AN1 it affects my reading on AN0. Why ? They are 2 voltages measurement. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 06, 2010 3:36 pm |
|
|
Do you have a 20us delay after changing the ADC channel ?
You need one. Example:
Code: |
set_adc_channel(0);
delay_us(20);
.
.
.
set_adc_channel(1);
delay_us(20);
|
Is the output impedance of the device that is supplying the analog voltage
to pins AN0 and AN1 equal to 10K ohms or less? That's the maximum
allowed by the 16F877 data sheet. |
|
|
mindstorm88
Joined: 06 Dec 2006 Posts: 102 Location: Montreal , Canada
|
|
Posted: Fri Jan 08, 2010 10:44 pm |
|
|
Thanks PCM , you were right , forgot the 20uS delay and one of the inputs was at 500 kOhms !!!! now down to 8 k , reading are stable now !!! |
|
|
|