Reply by profdc9 February 24, 20082008-02-24
Oversampling is often done because the analog anti-aliasing filter
before the A/D does not suppress the frequencies outside of the
desired downsampled bandwidth well enough.

For example, lets say you want to sample a signal with 100 kHz maximum
frequency (200 kHz sampling rate), and reject all frequencies above
this. A regular single pole RC anti-aliasing filter only suppresses
high frequencies at 20 dB/decade, so if there is, for example, some
unwanted signal at 150 kHz it will be aliased to 50 kHz in your
downsampled signal and only attenuated by 1 dB or so. But if one
samples at 2 MHz (10 times oversampling), and then applied a "perfect"
digital filter to filter out everything above 100 kHz, then mostly
signal between 1.9 MHz to 2.1 MHz can affect your signal, and this
will be attenuated by 26 dB = 20 log (2 MHz / 100 kHz).

Because designing good analog filters might require high tolerance
(and expensive) components, often a simple 2-pole filter is good
enough to roughly attenuate the high frequencies and then a more
accurate digital FIR or IIR filter can be used to more precisely
eliminate frequencies near the passband. For something like the LPC
ARM7TDMI chip with its limited processing power probably some hybrid
technique is best, especially if one can employ simple IIR filters
with power-of-2 coefficients (binary shifts).

Dan

An Engineer's Guide to the LPC2100 Series

Reply by Victor Suarez February 24, 20082008-02-24
> How many gadgets do you intend to build? If chip cost is not an issue,
>why not use a 12 bit A/D with parallel interface and couple it to a 500
>MHz Blackfin processor with a DMA channel?

I cannot afford for the costs of a blackfin processor. My platform is
based on LPC. I need to know the possibilities of that processor in
order to take the inal decision. What I need to know in this phase of
developent, is whats de maximum frequency of sampling achievable with
LPC2138. Information needs NOT to be regulary sampled, I can sample as
fast as I can or mix a variable count of instruccions between samples.

>With this approach you can meet the sampling requirements and still
>have a lot of compute cycles for processing.

Nlakfin processors seems very attractive but not for my current
project. Im considering them for future projects. An interesting ADC
I plan to use is
http://focus.ti.com/docs/prod/folders/print/ths1215.html

Now I want to know capabilitises of LPC chips. Any further information?

>A/D: http://www.analog.com/en/prod/0,,AD7854,00.html
>Blackfin: http://www.analog.com/processors/blackfin/
>Oh, and the Blackfin has DSP capability if you want to manipulate the
>incoming A/D samples.

Nice chips, Ill consider it. Thanks.
DSP is not needed, Ill send samples to a PC for further processing.
Reply by Brendan Murphy February 24, 20082008-02-24
--- In l..., "Victor Suarez"
wrote:
>
> I need to achieve 400Khz sampling (one channel) with an LPC2138. I can
> do pooling and any sort of tricks, but I need the time between samples
> to do some processing.
> Can it be done? 5us per sample as proposed is too much for my
> application. Any recommendations?
> Anyone knows if I can operate the two ADC interlevaded or in parallel
> to achieve 800KHz sampling?
>

We use a LPC213x with 200 KHz sampling for a DAC interleved with 2
channels of ADC, each at 100KHz. It's pusing it to its limits, though:
getting the samples in and out of the device at those rates is quite a
challenge if any time is to be left for processing.

For a start, I assume you're talking about using external ADCs? 400 KHz
would not be possible with the internal ones, AFAIK, due to the
conversion period.

If I were you I'd look at something like:

- tie the "conversion done" bit into the an external interrupt i/p pin
on the LPC21xx configured as an FIQ
- preset all the banked FIQ registers to something useful values, so
you don't have to save/restore them
- clock the ADCs from a timer o/p configured as a PWM.

I'm not sure you'd get 800 KHz sampling, though, even doing that.

Just as a metter of interest, what type of signal is it?

Brendan
Reply by rtstofer February 23, 20082008-02-23
--- In l..., "Victor Suarez"
wrote:
>
> I need to achieve 400Khz sampling (one channel) with an LPC2138. I can
> do pooling and any sort of tricks, but I need the time between samples
> to do some processing.
> Can it be done? 5us per sample as proposed is too much for my
> application. Any recommendations?
> Anyone knows if I can operate the two ADC interlevaded or in parallel
> to achieve 800KHz sampling?
>

How many gadgets do you intend to build? If chip cost is not an issue,
why not use a 12 bit A/D with parallel interface and couple it to a 500
MHz Blackfin processor with a DMA channel?

With this approach you can meet the sampling requirements and still
have a lot of compute cycles for processing.

A/D: http://www.analog.com/en/prod/0,,AD7854,00.html
Blackfin: http://www.analog.com/processors/blackfin/

Oh, and the Blackfin has DSP capability if you want to manipulate the
incoming A/D samples.

You MIGHT be able to use an SPI interface as well. I didn't check for
A/D's with fast SPI.

Richard
Reply by martin_schoenegg February 23, 20082008-02-23
> > 3. You can use ARM7/9 controllers that have 8 or 10-bit A/D converters
> > and oversampling if the resulting sampling rate is not too low for your
> > application.
> Thanks a lot for the good explanation of over sampling.

... but unfortunately that is only half the truth.
Yes, you get more resolution with oversampling, but
No, you don't get more accuracy.

And the last one is most of the time that what you really will need.
It may be, that you get more accuracy, too - from art to part, when
the real given accuracy of the ADC is much lower than 1 LSB, but not
in general. Neverstheless for a one time hobby project this may be
OK.

Martin
Reply by Victor Suarez February 23, 20082008-02-23
I need to achieve 400Khz sampling (one channel) with an LPC2138. I can
do pooling and any sort of tricks, but I need the time between samples
to do some processing.
Can it be done? 5us per sample as proposed is too much for my
application. Any recommendations?
Anyone knows if I can operate the two ADC interlevaded or in parallel
to achieve 800KHz sampling?
Reply by Mukund Deshmukh February 23, 20082008-02-23
> 3. You can use ARM7/9 controllers that have 8 or 10-bit A/D converters
> and oversampling if the resulting sampling rate is not too low for your
> application.
>
> Oversampling represents the process of acquiring data faster followed by
> averaging the samples. Usually, the oversampling factor N is a power of 2
> (e.g. 4:1, 16:1, etc) because the averaging can be done by summing N
> samples
> and shifting to right the result to divide. ADD and SHIFT are very simple
> and fast, so the overhead added by oversampling is minimal.
>

Dear Stefan,
Thanks a lot for the good explanation of over sampling.
Warm Regards,

Mukund Deshmukh,
Beta Computronics Pvt Ltd.
10/1 IT Park, Parsodi,
Nagpur -440022 India.
Web site - http://betacomp.com
Reply by Alexander Whiplash February 23, 20082008-02-23
> Analog Devices offers some ARM7TDMI-based controllers with 12-bit ADC and up to 16 channels.
>
>Have a look at this site:
>
> http://www.analog.com/static/imported-files/data_sheets/ADuC7019_20_21_22_24_25_26_27_28_29.pdf

These parts are pretty light on RAM - the biggest ones have only 8K. Not exactly the same as the more general purpose NXP and Atmel parts. Nice ADCs though.

AW
Reply by spoli58 February 22, 20082008-02-22
Ravi,

There are many ways to convert analogue data with 12-bit resolution
depending on the application.

1. You can use any ARM7/9 controller that has a 12-bit A/D converter
(as some members suggested)
2. You can use an external 12-bit A/D converter connected to a SPI port
if adding extra components is not a problem (TI, AD, Maxim have 12-bit ADC
with SPI)
3. You can use ARM7/9 controllers that have 8 or 10-bit A/D converters
and oversampling if the resulting sampling rate is not too low for your
application.

Oversampling represents the process of acquiring data faster followed by
averaging the samples. Usually, the oversampling factor N is a power of 2
(e.g. 4:1, 16:1, etc) because the averaging can be done by summing N samples
and shifting to right the result to divide. ADD and SHIFT are very simple
and fast, so the overhead added by oversampling is minimal.

For example, in your case, using NXP LPC213x (10-bit A/D converter with 400
KHz sampling rate) and oversampling 4:1 you can obtain 12-bit samples at 100
KHz sampling rate for one channel. Make sure you use the "burst" mode for
the A/D converter or use a timer as a trigger if you want to control the
sampling process programmatically.

Another important thing is the data representation - using fixed point
fractional representation (i.e. numbers between 0 and 1 only) can greatly
simplify the oversampling and implementing various digital signal processing
algorithms. Not to mention that the LPC213x ADC will produce numbers in this
representation (i.e. a binary fraction representing the voltage on analog
input pin).

In practice 400 KHz might be a little bit difficult to achieve because:

* The maximum sampling rate depends on the number of signals
(channels) you need to acquire. If you need 8 signals then your maximum
sampling frequency would be 400 KHz / 8 = 50 KHz
* LPC213x ADC does not buffer the samples in any way - it has no FIFO
and there is no DMA to help you store the samples. As consequence, you will
have to do this in the ADC interrupt service routine. At 400 KHz the
interval between interrupts is 2.5 us - very short. Depending on the code
you write to handle the ADC interrupts you may not be able to get better
than 200 KHz (5 us).

In conclusion, if sampling frequency is low, higher resolutions can be
achieved through oversampling. I would recommend you this method if you
don't need sampling frequencies higher than 10.20 KHz and you need all the
channels.

Good luck!

Stefan
Reply by martin_schoenegg February 22, 20082008-02-22
> Analog Devices offers some ARM7TDMI-based controllers with 12-bit ADC

they call them "Analog Microcontroller". Very nice chips, we use them
here too. The support from analog for non commercial users like
universities is like nonexistent :-( Not one email we asked something
was answered. And the documentation is very small and partwise not
really exact written. But with enough trial&error we got it.
Crossworks supports them fine. Now we got it with yagarto too (not
me, but a coworker;-).

Martin