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 CCS Technical Support

18F2455 and ADC conversion with VREF on AN3

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



Joined: 14 Sep 2006
Posts: 27

View user's profile Send private message

18F2455 and ADC conversion with VREF on AN3
PostPosted: Wed Oct 18, 2006 3:32 am     Reply with quote

I'm using AN0-AN2 on 18F2455 with a 10 bits conversion.
As my input will be 0V-0.6V, I use setup_adc_ports(AN0-AN2|VSS_VREF) and input a trimmer midpoint on AN3.
The AN0-AN1 conversion is fine, but on AN2, I suspect the conversion is still done with a 0V-5V scale because on the port I can reach only 10% of the full scale value.
Does this have something to do with the fact that AN2 may be configured as VREF- ?

Regards
Ttelmah
Guest







PostPosted: Wed Oct 18, 2006 5:04 am     Reply with quote

First comment, if you intend to drop Vref to 0.6v, it won't work for anything approaching the accuracy you want. (Vref Min, for 3.3v operation, is 1.8v, and for 5v operation, 3v). Beware also, that the Vref source, needs quite a low output impedance (<2.5KR). Using a direct potentiometer, is not a formula for good accuracy.
Now, the same ADC, is used whatever pin is being read. There is only an input 'multiplexer' on the front. So, you need to check what voltage is actually present on your AN2 pin. I'd suspect that the problem is that you haven't disabled the comparator module, so the comparator Vref is being drawn on this pin, loading it down significantly.
setup_comparator(NC_NC_NC_NC);

Best Wishes
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