Jump to content
  • 0

Analog Discovery 2 Continually Record Data ONLY when Digital Pin High


wattsjacob

Question

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!

PXL_20230719_024831292.jpg

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @attila

I was able to use trigger 1 to record data, but once the trigger goes HIGH the data is continually captured. I ONLY want to capture data when the trigger goes HIGH. Once the trigger goes LOW again I don't want any data captured until the trigger goes HIGH again.

Here are my settings for reference...

Mode: 'Record' and 'Normal'

'Trigger 1'

'Rising'

Samples: 64 Mi

Rate: 1 MHz

*What I really think I need is more like a Record Enable pin. When the pin is HIGH data is recorded and vise versa. (When pin is LOW no data is recorded) I believe I may need to write a script for this function. Is this something the Analog Discovery 2 can even do? 

 

 

image.png

Edited by wattsjacob
added more information
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...