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

Triggered, Synchronized Acquisition Strategy #1

Open
bhclowers opened this issue Nov 17, 2020 · 1 comment
Open

Triggered, Synchronized Acquisition Strategy #1

bhclowers opened this issue Nov 17, 2020 · 1 comment

Comments

@bhclowers
Copy link

Thanks for your contribution. This is one of the most complete micropython projects I've seen that focuses on higher speed data acquisition and streaming. While my application is ultimately different, I am very interested in acquiring data into a buffer followed by wireless transfer as we'd like to make some measurements with a detector at high voltage. A key component of our experiment is that the data acquisition needs to be synchronized with a trigger pulse (i.e. similar to a scope).

After looking through the main.py code, it is unclear to me whether there is any sort of external triggering occuring or whether you are simply streaming data. Based upon your experience can you envision a way to synchronize the data stream with an external trigger? More specifically, might it be possible capture the state change of a pin and "mark" that event as part of the streamed buffer? This might allow post-processing realignment of the data?t

Finally, did you of a way to determine the maximum buffer size for ADC collection? I simply ask as the micropython forum is not entirely clear. If the synchronized streaming strategy is not feasible perhaps one could simply use a trigger to start the ADC. Granted, not as efficient but workable.

I appreciate your help and hope to extend this project into a more generalizable, wireless, scope type application. Any advice is surely welcome.

@ryanmgriffiths
Copy link
Owner

Hi, glad to be of help. It sounds like there is a good amount of overlap between our projects, you are correct in stating that there is no trigger in main.py. As far as I remember, the lag time between python level external interrupts and peak sampling was too long for us to acquire data at the high speeds we required.

A summary of the method we used and a little more information about the project and DAQ speeds we achieved can be found at: https://cds.cern.ch/record/2688617/files/report.pdf

In the end we had to write some custom micropython code which can be found in the adc.c custom file. The custom functions are adc_read_dma, DWT_config and SendDataPeak. It also utilises DMA callbacks in HAL_ADC_ConvCpltCallback. You may also find the wifi function useful which are also in the extension folder. I don't exactly remember how everything works as this was a summer project I worked on a year ago but we are essentially polling through DMA data and detecting peaks rather than sampling peaks from an interrupt. I'll get back to you soon with any thoughts on your ideas

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