cancel
Showing results for 
Search instead for 
Did you mean: 

Oversampling and Decimation - can it be used for timer instead of ADC?

mehmet.karakaya
Associate III
Posted on July 07, 2014 at 21:30

hello dear forum,

By using a method called ‘Oversampling and

Decimation’ higher resolution might be achieved, without using an external ADC.

I have read this above sentence in an application note for increasing the ADC resolution

for an 2 bit increase in ADC resolution for example it suggests 4*4 samples added together

and then the result is right shifted 2 bits and the ADC resolution is improved for example from 10 bit  to 12 bits 

my question is following 

I want capture the duty of a 100 KHz square wave 

for example if duty is 50%   the capture value with 72 Mhz F103 clock

is 360

if the duty is %40 the capture value becomes 288

you see the resolution is very poor ( only 72 count difference )

my question is if I use the above technic ( oversampling and decimation for ADC ) for the timer capture values ,

do I get the same resolution improvment ?

thank you 
3 REPLIES 3
Posted on July 07, 2014 at 21:49

Input Capture has a Prescaler (not the time base one), you can measure the duration of up to 8 cycles. Clearly won't help for odd duty cycles.

You can also make the time base more rapid, that would improved the granularity of the measurement.

You can also could pulses using an External Counter mode, and sample that periodically. Though it would tend to work better for higher frequencies, where interrupts would saturate the processor. ie 10 MHz should produce 10000 ticks every millisecond.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on July 08, 2014 at 02:38

my question is if I use the above technic ( oversampling and decimation for ADC ) for the timer capture values ,

 

 

do I get the same resolution improvment ?

Yes, but

the

16 analog samples can be accumulated in a shorter time using ADCs than taking 16 timer samples of a 100 KHz signal. You have to assess if the duty cycle is sufficiently constant during the sample time using any sampling method, be it oversampling or faster clock times.

Cheers, Hal

zzdz2
Associate II
Posted on July 08, 2014 at 09:40

I think you are talking about technique similar to equivalent time sampling used in digital scopes.

It's more tricky than oversampling but I think it might work.