All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Matthias Klumpp <matthias@tenstral.net>
Cc: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Subject: Re: Using IIO for high-speed DAQ
Date: Mon, 16 Jan 2017 22:40:07 +0100	[thread overview]
Message-ID: <d5af1ec3-383f-9b2a-98d0-01ad421c2f83@metafoo.de> (raw)
In-Reply-To: <CAKNHny_9FCDfBdTC-=AL3LwdPyqQ0M58rYT22gxULFgB1hA1LA@mail.gmail.com>

On 01/16/2017 03:23 PM, Matthias Klumpp wrote:
> 2017-01-14 18:49 GMT+01:00 Lars-Peter Clausen <lars@metafoo.de>:
>> On 01/14/2017 06:18 PM, Matthias Klumpp wrote:
>>>> The IIO framework itself does not impose a limit on the maximum sampling
>>>> rate. It's all a matter of what the hardware is capable of handling. We have
>>>> systems where we do 3-digit MSPS continuous transfers and GSPS oneshot
>>>> transfers.
>>>
>>> Since this is the first time I touched this area: Is there a group of
>>> chips which you would recommend that samples with 200ksps, has a 16bit
>>> bit-depth and bipolar mode and is accessible at that speed via IIO?
>>> I'll look around a bit to find a solution for this issue.
>>
>> Unfortunately this is often as  much about the AP as it is about the
>> converter. In the setups we have we use a AP+FPGA combination where the AP
>> runs Linux with IIO and the FPGA is responsible for handling the SPI flow
>> control during the acquisition phase. For this we've developed the
>> SPI-Engine framework[1]. It is compatible with most ADI single-channel SAR
>> and Sigma-Delta ADCs[2].
>> [...]
> 
> Thanks!
> I was already looking into this, but also tried to access the BCM2835
> on my Raspberry Pi test device directly (someone wrote a nice helper
> library for that at [1]).
> Turns out that using this library, I can easily achieve my desired
> speed of 200ksps (it also turned out that with a few changes on the
> setup, 6ksps can be just enough...).

This is basically the dedicated CPU approach I described. Your application
is spinning on the SPI registers and not using interrupts. This means a lot
of CPU time is used for busy-waiting. If you are issuing one transfer after
another CPU utilization will go to 100%.

One issue with doing this in Linux userspace is that your application will
still get interrupted occasionally, either to run interrupts or potentially
schedule other applications for a short duration on the CPU. When this
happens there is a good chance that you'll loose a few sample and have a
discontinuity in your signal. Which will show itself in strange glitches
when you are processing the data.

  reply	other threads:[~2017-01-16 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 14:13 Using IIO for high-speed DAQ Matthias Klumpp
2017-01-14 16:12 ` Jonathan Cameron
2017-01-14 17:03   ` Lars-Peter Clausen
2017-01-14 17:18     ` Matthias Klumpp
2017-01-14 17:49       ` Lars-Peter Clausen
2017-01-16 14:23         ` Matthias Klumpp
2017-01-16 21:40           ` Lars-Peter Clausen [this message]
2017-01-14 17:25   ` Matthias Klumpp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5af1ec3-383f-9b2a-98d0-01ad421c2f83@metafoo.de \
    --to=lars@metafoo.de \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=matthias@tenstral.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.