View previous topic :: View next topic |
Author |
Message |
pr83
Joined: 20 Jul 2006 Posts: 15
|
Thank you |
Posted: Thu Jul 20, 2006 9:41 pm |
|
|
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
|
|
Posted: Thu Jul 20, 2006 10:36 pm |
|
|
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
|
|
Posted: Fri Jul 21, 2006 3:28 am |
|
|
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
|
|
Posted: Fri Jul 21, 2006 7:00 am |
|
|
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
|
|
Posted: Fri Jul 21, 2006 7:30 am |
|
|
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
|
|
Posted: Fri Jul 21, 2006 3:12 pm |
|
|
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. |
|
|
|