Forums

Re: Digest Number 3046

Started by Victor Suarez February 27, 2008
> > 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.
>
I dont need much processing, only need to execute serveral
instruction to store the values in an array for posterior delivering
to the PC. I want to do this "processing" in parallel with adquisition
to gain time.
To know if 200Khz is enough for me, I have to develop a prototype and
see results, I think it would be a little slow but have to experiment.
I you achieved 200Khz sampling with ADC interleaving and it was
somewhat tricky, Id really appreciate if you send me code or at least
pseudocode, in order to gain some time.

> 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.
>
I want to know if I can use the internal ADC(s). Id use external ADC
only if it is really needed, but dont know yet.

> 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.
>
if I have to use external ADC, Id use a parallel or SPI one with
known timings (no need to use interrupts).

> Just as a metter of interest, what type of signal is it?
>
Im measuring level of reflectance of a sample object at high speed. I
emit infrared radiation, and capture it with a phototransistor
connected to the ADC(s).
The system doesnt need regular interval measurement, I control when
to start the measurement, but need to do it at high speed.

Datasheet says ADC reference have to be between 3.0V and 3.3V. Ive
set it with lower voltages and worked. Do you know why datasheet
doesnt recommend using lower voltages?


An Engineer's Guide to the LPC2100 Series

--- In l..., "Victor Suarez"
wrote:
>
> > > 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.
> >
> I dont need much processing, only need to execute serveral
> instruction to store the values in an array for posterior delivering
> to the PC. I want to do this "processing" in parallel with
adquisition
> to gain time.
> To know if 200Khz is enough for me, I have to develop a prototype
and
> see results, I think it would be a little slow but have to
experiment.
> I you achieved 200Khz sampling with ADC interleaving and it was
> somewhat tricky, Id really appreciate if you send me code or at
least
> pseudocode, in order to gain some time.
>
> > 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.
> >
> I want to know if I can use the internal ADC(s). Id use external
ADC
> only if it is really needed, but dont know yet.
>
> > 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.
> >
> if I have to use external ADC, Id use a parallel or SPI one with
> known timings (no need to use interrupts).
>
> > Just as a metter of interest, what type of signal is it?
> >
> Im measuring level of reflectance of a sample object at high
speed. I
> emit infrared radiation, and capture it with a phototransistor
> connected to the ADC(s).
> The system doesnt need regular interval measurement, I control when
> to start the measurement, but need to do it at high speed.
>
> Datasheet says ADC reference have to be between 3.0V and 3.3V. Ive
> set it with lower voltages and worked. Do you know why datasheet
> doesnt recommend using lower voltages?
>
I am sampling both AD converters on an LPC2138/01 with 400K
samples/sec and it is not *that* difficult though you have to use
some (common) tricks to achive that. I'm using the FIQ interupt and
the total processing time of the ISR is app. 1.2 mySec (including
entrance and exit to the interupt), so I still have app. 50%
processing power left. I am not just storing the values away but are
actually processing them in the ISR with app. 40 instructions.
Do this:
Set the AD converter to burst mode and attach the FIQ interupt to it.
Place the FIQ ISR at the FIQ entry point (0x1c) so the interupt will
fall directly into it.
Preload the FIQ registers with whatever you will need like RAM
addreses - values ect.
You will have to program your ISR in assembler for the optimum result
and avoid using branches if possible.
The lowest conversion time (according to the UM) for the LPC21xx is
2.44 mySec but this is for 10 bits. If you can live with fewer bits
you can even lower that a little.
One word of caution. The longest instructions in terms of clocks are
the STM/LDM. If you can in any way control the use of these you
should avoid them while you are sampling.

Regards
Kell