ADC sample rate

Hello Bence,

Thanks for your reply. This library indeeds seems to do the tric! I’m going to order a beagle and give it a try.
Did you noticed any delay’s/missing data during your experiments? I’m trying to figure out if the data is being buffered before it’s read out by the script.
Otherwise ADC-data can be lost if the beagle-OS is busy doing something else…

Best regards,
Helmich de Lange

Hi Helmich,

I think the only way to make sure that no ADC data is lost is to use the microprocessor directly. For this purpose you should not have an operating system. I used the library to read analog sensors like IR range finders or temperature sensors where breaking the continuity of the signal is no issue :slight_smile:

–Bence

2012/11/9 Helmich <helmichdelange@gmail.com>

Hi Bencer,

sounds logical! Those sound cards must have some embedded code to do the real time sampling.
thanks for your thoughts.

Regards helmich

Bence Magyar <mw.mzperx@gmail.com> writes:

Hi Helmich,

I think the only way to make sure that no ADC data is lost is to use the
microprocessor directly.

If you use the device's DMA controller to read out the ADC samples,
there should be no reason why you should lose any samples. That being
said, this would likely require some work in the kernel. Also, this
approach would incur greater latency.

Cheers,

- Ben

abd.halimeh88@gmail.com writes:

If you use the device's DMA controller to read out the ADC samples,
there should be no reason why you should lose any samples. That being
said, this would likely require some work in the kernel. Also, this
approach would incur greater latency.

Cheers,

- Ben

Hi Ben,
I want to use the device's DMA controller to transfer ADC's FIFO0 samples
to a pre-allocated region in memory,
Is there any chance to do that (without "some work in the kernel" as I'm
newbie to Linux :P).

Regards,
Abd

Unfortunately for a variety of reasons (both for security and
practicality) there is no interface exposing the DMA subsystem to
user-mode. Unless I'm mistaken, the recommended way to deal with DMA is
to write a kernel mode driver. That being said, this needn't be a large
amount of code; a well designed architecture would put just enough logic
in the kernel to pull the samples into a buffer and pass buffers to user
space.

If you really insist on avoiding kernel work (it really isn't that
painful, I promise), then you could try mapping the DMA peripheral
directly into a user-mode process. This would of course require root and
is not a recommended practice, but you might be able to hack something
together. Despit4e this, I sincerely think this would be just as hard
(if not harder) than working in kernel space directly (for one, you
don't enjoy the benefits of the kernel's existing DMA subsystem).

Cheers,

- Ben