|
|
View previous topic :: View next topic |
Author |
Message |
NicolasC
Joined: 14 Sep 2006 Posts: 27
|
18F2455 and ADC conversion with VREF on AN3 |
Posted: Wed Oct 18, 2006 3:32 am |
|
|
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
|
|
Posted: Wed Oct 18, 2006 5:04 am |
|
|
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 |
|
|
|
|
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
|