View previous topic :: View next topic |
Author |
Message |
stefsun
Joined: 23 May 2007 Posts: 22
|
how to improve the accuracy of AD Acquisition |
Posted: Tue Aug 19, 2008 4:05 am |
|
|
I use the pic's AD, but the precision seems not very good. I do not know if there are better way to improve it ? Before acquire the value I give much delay(2ms). I'm using the PIC4523 (12bit AD).
The code is
Code: |
set_adc_channel(2);
delay_ms(2);
value = read_adc();
|
|
|
|
Ttelmah Guest
|
|
Posted: Tue Aug 19, 2008 5:00 am |
|
|
The delay does nothing, once the voltage on the internal capacitor has charged to within a fraction of a bit of the 'real' voltage, extra doesn't help at all.
Lots of things:
What ADC clock are you using?. What frequency?.
What are you using as the Vref source?.
What is the impedance of the source feeding the ADC input?.
How is your PIC grounded?.
How is it's supply generated?.
What else is going 'on' on the board while you are waiting/reading?.
These cover the most likely problem areas (but not all...).
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Aug 19, 2008 6:43 am |
|
|
I would also ask what is happening on the other inputs to the A/D. If you leave one input floating, even if it is not ever selected, it can cause noise on the other channels. It is best to ground unused A/D inputs. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Aug 19, 2008 8:31 am |
|
|
Ground planes!
Always keeps analog grounds separate from digital grounds. Never have them tied into the same plane. Your grounds will, of course, come from the same source but always have your digital traces separate from your analog traces. They'll always go back to your main power input source but have that as the only place where the two planes connect. Even if they need to be on the same side of the board, keep them separate.
Digital signals, things going high & low & high, can inject a lot of noise into your analog lines.
If you're creating your circuit on something like a solderless bread board (I call it a proto-board) then that's not possible. When using a proto-board I will place external caps on the input to help filter out noise. Then, when I make the board I'll have the ground planes do the rest.
Ronald |
|
|
stefsun
Joined: 23 May 2007 Posts: 22
|
|
Posted: Wed Aug 20, 2008 2:26 am |
|
|
I used the internal voltage reference,I use 2 AD,2 AD pin are empty.if I use the external voltage reference,is that better? |
|
|
Ttelmah Guest
|
|
Posted: Wed Aug 20, 2008 2:47 am |
|
|
Er.....
There is not an 'internal voltage reference'...
The only choices for the ADC, are to use the supply rail (which will always be noisy), or an external voltage reference.
There is an internal reference for the _comparator_, but _not_ for the ADC.
I'd say this is your problem.
Best Wishes |
|
|
|