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

Thank you

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



Joined: 20 Jul 2006
Posts: 15

View user's profile Send private message

Thank you
PostPosted: Thu Jul 20, 2006 9:41 pm     Reply with quote

Thank You

Last edited by pr83 on Fri Jul 21, 2006 8:46 am; edited 1 time in total
epideath



Joined: 07 Jun 2006
Posts: 47

View user's profile Send private message

PostPosted: Thu Jul 20, 2006 10:36 pm     Reply with quote

Is it possible that the code is set to this:

#device adc=8

?

If so try changing it to

#device adc=10

Hope this helps
Guest
Guest







PostPosted: Fri Jul 21, 2006 3:28 am     Reply with quote

I had trouble with the ADC not too long ago. Try setting the ADC_Clock to DIV 2 to 32, see if that effects anything.

Another thing that (oddly) seemed to stablize my reading was
Code:

adc_set_channel(0);
read_adc(adc_start_only);
delay_us(10);

adcval = read_adc(adc_start_and_read);


...I have NO IDEA why this helped me, but I know I was getting really strange results between three separate channels, did this and it has been rock solid since. I have to keep it on DIV_BY_2 but thats fine for me.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Jul 21, 2006 7:00 am     Reply with quote

Guest wrote:
I had trouble with the ADC not too long ago. Try setting the ADC_Clock to DIV 2 to 32, see if that effects anything.

Another thing that (oddly) seemed to stablize my reading was
Code:

adc_set_channel(0);
read_adc(adc_start_only);
delay_us(10);

adcval = read_adc(adc_start_and_read);


...I have NO IDEA why this helped me, but I know I was getting really strange results between three separate channels, did this and it has been rock solid since. I have to keep it on DIV_BY_2 but thats fine for me.


That code will effectivly read the input twice. It is important to pause after changing channels before reading the ADC.
pr83



Joined: 20 Jul 2006
Posts: 15

View user's profile Send private message

PostPosted: Fri Jul 21, 2006 7:30 am     Reply with quote

Thanks for the reply.

I did try your suggestions, but it didnt change the output.
I have posted one more message. But this time it has my code in it.
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Fri Jul 21, 2006 3:12 pm     Reply with quote

pr83: If you are going back and editting your post because you think your code is valuable to other people you can stop. Cause with questions like the ones you asked, its not worth the time of changing the posts.

By the way, if you just edit the body and not the subject I think it won't go back to top.
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