Hello.I used PIC18F8722 that has 10-bit ADC, but I want a more higher resolution of 12-bit
or even more with a good speed.
I want to use oversampling technique in mikroC PRO for PIC18F8722 to higher its resolution;
Would somebody give me some code examples?
Sould I use a special hardware for it?
Thanks,
Code examples for oversampling technique using mikroC PRO ?
-
- Posts: 715
- Joined: 27 Dec 2006 14:33
- Location: Le Tréport , FRANCE
Re: Code examples for oversampling technique using mikroC PR
Hi,
Oversampling is a pure view of mind when very little change in signal :
the trick is to take, say, 10 samples and take the mean value.
if your signal stays between 998.5 and 999.5 ... you will have 999 as a mean value ( you get 10 times 999 from the ADC ): NO resolution enhancements ...
if your signal grows linearly from 998.5 to 1000.5 ... you will get 5 times 999 and 5 times 1000 ... mean value will be 999.5 Ok then !
if your signal grows linearly from 998.5 to 1000 ... you will get 6 times 999 and 4 times 1000 ... mean value will be 999.4 instead of 999.25
So, take care ... It doesn't improve resolution in any way if the signal is ~ steady ...
Alain
Alain
Oversampling is a pure view of mind when very little change in signal :
the trick is to take, say, 10 samples and take the mean value.
if your signal stays between 998.5 and 999.5 ... you will have 999 as a mean value ( you get 10 times 999 from the ADC ): NO resolution enhancements ...
if your signal grows linearly from 998.5 to 1000.5 ... you will get 5 times 999 and 5 times 1000 ... mean value will be 999.5 Ok then !
if your signal grows linearly from 998.5 to 1000 ... you will get 6 times 999 and 4 times 1000 ... mean value will be 999.4 instead of 999.25
So, take care ... It doesn't improve resolution in any way if the signal is ~ steady ...
Alain
Alain
Re: Code examples for oversampling technique using mikroC PR
Hello,Acetronics.Thanks for your message.But " oversampling " technique is not the calculation
of a simple mean value as you wrote.You can get know more about oversampling at the following;
1] Microchip's application note; AN1152.
2] Atmel's application note; AVR121.
Thanks,
of a simple mean value as you wrote.You can get know more about oversampling at the following;
1] Microchip's application note; AN1152.
2] Atmel's application note; AVR121.
Thanks,