Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert for streaming with the ADS7884 #6

Open
BryceDrechselSmith opened this issue Jun 25, 2021 · 1 comment
Open

Convert for streaming with the ADS7884 #6

BryceDrechselSmith opened this issue Jun 25, 2021 · 1 comment

Comments

@BryceDrechselSmith
Copy link

BryceDrechselSmith commented Jun 25, 2021

Hello,
I commented in your streaming code, but i realize that this is the more appropriate folder to comment in. I have successfully gotten this code (rpi_adc_dma_test.c) to capture at 2.5Msamples/sec and store into a .csv file. I am now trying to make this continuously stream the data into a FiFo, similar to your other code in "streaming." I am trying to accomplish this by implementing a ping-pong buffer in the function "adc_dma_samples_ads7884" (line 325), but have had no real luck thus far. This is my first experience with DMA, and as such I am not really familiar with what must be done to set this up. My assumption is that I will need to double the number of control blocks and add another buffer (B), so that while A is being written, B can be read and visa-versa.
In looking at your streaming code (rpi_adc_stream.c) for the MCP3008 as a guide, it looks like this is what you are doing in "adc_dma_init" (lines 403+); using several control blocks to write to rxd1, and then several more to write to rxd2, with a few other control blocks used for timing. Since the ADS7884 doesn't take input and is controlled purely by clock cycles, I believe that the timing blocks are unnecessary (that I don't need a third channel for triggering PWM?) though I do need a way to switch between the two. Currently it looks like it is continuously reading from the buffer until it is empty (dma_wait(DMA_CHAN_A)). But I don't think that this method will work for continuous streaming...

I guess my questions are; are my above assumptions correct? what would you recommend in terms of timing/coordinating for the ping-pong buffer?

Once again, thank you so much for your time. I really appreciate the time you have taken already to write this code and its corresponding guide, as well as the time to respond to my previous questions.

Cheers,
Bryce

@jbentham
Copy link
Owner

jbentham commented Jun 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants