0

my device is 'raspberry pi 3' I am using 'PmodAD1', a 12bit ADC with 1Msps sampling rate https://digilent.com/reference/pmod/pmodad1/start

Due to linux's 'spidev' system, my sample rate is compressed to only 20KSPS left

I have tried using 'DMA' to increase my sample rate

https://iosoft.blog/2020/06/11/fast-data-capture-raspberry-pi/?fbclid=IwAR0AeF4JEyElcKPMW4rq75ZabadZEdUk8Zn4uNAxvMl9EPunsPYmVRTNeiw

But due to lack of expertise, I can't understand how to modify

So I used the method of modifying bcm2835 to increase my sampling rate

Using mcp3008 to test successfully pulled the sampling rate to 130KSPS but still not enough for the sampling rate I need

I refer to this article to modify PmodAD1

How to achieve a high sampling speed using an ADC with Raspberry Pi?

But don't know how to modify the following CODE so it ends in failure

       bcm2835_spi_transfernb(buf_0, readBuf_0, 2);
        fprintf(f_0, "%d\n", (readBuf_0[0]<<6) + (readBuf_0[1]>>2));

Next I try to use pigpio to receive my ADC

But the baud rate he sends is not enough to get the sample rate I want

So I would like to ask how to modify the code below 'bcm2835' so that my ADC can work normally?

       bcm2835_spi_transfernb(buf_0, readBuf_0, 2);
        fprintf(f_0, "%d\n", (readBuf_0[0]<<6) + (readBuf_0[1]>>2));

Or does anyone sell a sound card with a sample rate of 300-400 KSPS

Thanks guys, I really want to get this done quickly

6
  • Ask the author of that blog if he thinks what you want is doable. In particular will it capture the number of samples you need to capture.
    – joan
    May 22 at 17:41
  • Does this answer your question? How can I modify my sampling rate using methods other than DMA?
    – joan
    May 22 at 17:58
  • This may not solve my problem That article was posted by me Still haven't been able to solve my problem As for the DMA problem, because I still don't understand how to modify it I have asked the author a question But I can't send my message May 22 at 18:55
  • Why are you using bcm2835? This is very old and the "documentation" leaves a lot to be desired and seems little used. See Controlling Raspberry Pi GPIO with c and Python for comments about libraries.
    – Milliways
    May 23 at 0:56
  • You haven't responded to earlier questions about OS & model. You should tag the Question, not bury in the text.
    – Milliways
    May 23 at 0:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.