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

converting for ADS7884 #3

Open
BryceDrechselSmith opened this issue May 26, 2021 · 3 comments
Open

converting for ADS7884 #3

BryceDrechselSmith opened this issue May 26, 2021 · 3 comments

Comments

@BryceDrechselSmith
Copy link

First I want to say thank you for your tutorials, they are very clear and well written.
I am trying to adapt this code to work with the ADS7884 following your streaming guide and the guide you wrote on fast data capture, but I am having trouble getting it right. I need to get ~2.5Msamples/sec
some assumptions im making:

  • In the streaming code it appears that you are using the PWM to control the chip select, so i need to change this to SPI
  • i need to change the adc_dma_init() func to match adc_dma_samples_ads7884()

Is there anything else that needs to be done to stream dma from the ads7884? Any insights you may have are greatly appreciated.

@jbentham
Copy link
Owner

jbentham commented May 26, 2021 via email

@BryceDrechselSmith
Copy link
Author

so in the rpi_adc_stream I've changed the max sample rate to 2.5Msamples/sec, pwm_freq = 2.5M, max_spi_freq=4M, and SPI_frew = 2.5M. In this configuration running: sudo ./rpi_adc_stream -n 10 -r 200000 -s /tmp/adc.fifo and then monitoring the output in another window with: cat /tmp/adc.fifo shows that ~50% of the readings are good, and the others show 0V. I know that the RPi Zero has a 400Mhz clock, so theoretically i could push those numbers higher, but experimentation shows that doing so gives bad results.
Is it possible that this is a result of the way the information is taken from the ADS7884 vs the MCP3008? In your paper you mentioned that the number of bits is different and that you were using 3 dummy bits as padding for the ADS7884.
I appreciate you taking the time to respond, and any insights into what sections of the code might need changing to make the code run at ~2.6Msamples/sec like in your fast capture article would be very helpful

@jbentham
Copy link
Owner

jbentham commented May 27, 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