View Full Version : A/D-conversion noisy - how to filter it?
oldtoddler
- 19th April 2006, 08:21
Got any easy way to get A/D conversion filtered?
Problem: I got filtered, noiseless 2.5V in ANx and ADCIN gives result which keeps jumping randomly betveen 496..527, which is way too much for me..
I'm affraid I got no time in my code to make multible measurements to average the value.. Does anyone got fast way (for 18F458@20MHz) to make filtered A/D conversion, using other than (slow) ADCIN-command?
Thnx adv!
Marko
Melanie
- 19th April 2006, 10:27
If you truely have filtered, noisless input on your ADC pin like you say, it won't be jumping about they way it does. Movement by one or two counts is possibly expected - but not by twenty or thirty.
As a start, increase your Sample Time and/or change your Clock Source. It's a good possibility that you are not letting the sampling Capacitor enough time to charge properly before you take your reading.
It's also a possibility you have set the wrong Justification for a WORD variable. Double-check this also.
Acetronics2
- 19th April 2006, 10:31
Hi, Toddler
Do not forget to have a good filtring on your Vref ( may be Vdd ??? ) ... as the Adc always compares the Vref and Vin ...
Alain
Bruce
- 19th April 2006, 15:32
Another thing you can do is put the PIC to sleep while taking the A/D sample. This reduces noise due to internal switching.
oldtoddler
- 20th April 2006, 18:28
If you truely have filtered, noisless input on your ADC pin like you say...
As a start, increase your Sample Time and/or change your Clock Source. It's a good possibility that you are not letting the sampling Capacitor enough time to charge properly before you take your reading.
It's also a possibility you have set the wrong Justification for a WORD variable. Double-check this also.
Vdd is filtered by 4700uF and I got 12V/7.2Ah battery to feed +5V regulator -> power supply should be ok.
The input voltage should be stable since there are 10k resistor + 4700uF + 220nF capasitors in parallel (connected ANx -> Gnd) and there is 10-turn 10k potentiometer from Anx -> +5V, should make it steady enough - at least it looks that way in my scope.. I dunno..
ADCS is 010 (Fosc/32) - should be ok?
Increasing sampling time has unwanted, negative influence into responce time.. ok, I did increase sampling time up to 300uS and it did help quite a lot - still the measurement is jumpy, 508..516... that is best I can get out of it?
I will rewire all ground lines and let's see if that helps.
Thnx, if u have any ideas, please let me know!
sayzer
- 21st April 2006, 06:50
Since you are using 20 MHz OSC; Fosc/32 could be the solution as it helped me solve a similar problem I had (with 50uS sampling time).
Since you had good result with 300uS sampling time, with Fosc/32 you should be having much better result.
Could you also post the filter schematic? I would like to get some ideas how others design a filter in these types of issues.
---------------------
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.