CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ADC problem with 16F877A

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

ADC problem with 16F877A
PostPosted: Wed Jan 06, 2010 2:48 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 06, 2010 3:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 08, 2010 10:44 pm     Reply with quote

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 !!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group