How can I program the Analog Discovery 2 to continually record data, exclusively capturing information when a specific digital pin is in a high state? I'd like to set the sample rate to 1 MHz, and the total number of samples collected should be 64 Mi (64 million). I've been able to record data at 1 MHz with 64 Mi samples but when I hit record all of the data is continually captured. I'd like to only capture data when a pin goes high.
I know that for this to work the Analog Discovery 2 has to sample the digital pin at some sample rate as well. I've been able to accomplish this using a "DATAQ Model DI-4108-E" but the quickest I'm able to pulse the digital pin is at 10 kHz which in turn limits my frequency that I want to capture to <5 kHz (Nyquist).
The reason all of this is, I'd like to connect a 'zero-crossing' detector to some digital pin and capture a data point of some signal when the zero-crossing detector detects a zero. (sorry for the redundancy hopefully that made sense). I've attached an image to help show what I'd image my setup to look like.
I'd just like some help being pointed in the right direction and helping me to find out if this is even possible.
Question
wattsjacob
How can I program the Analog Discovery 2 to continually record data, exclusively capturing information when a specific digital pin is in a high state? I'd like to set the sample rate to 1 MHz, and the total number of samples collected should be 64 Mi (64 million). I've been able to record data at 1 MHz with 64 Mi samples but when I hit record all of the data is continually captured. I'd like to only capture data when a pin goes high.
I know that for this to work the Analog Discovery 2 has to sample the digital pin at some sample rate as well. I've been able to accomplish this using a "DATAQ Model DI-4108-E" but the quickest I'm able to pulse the digital pin is at 10 kHz which in turn limits my frequency that I want to capture to <5 kHz (Nyquist).
The reason all of this is, I'd like to connect a 'zero-crossing' detector to some digital pin and capture a data point of some signal when the zero-crossing detector detects a zero. (sorry for the redundancy hopefully that made sense). I've attached an image to help show what I'd image my setup to look like.
I'd just like some help being pointed in the right direction and helping me to find out if this is even possible.
Thanks for any advice/help in advance!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now