05-26-2016 04:52 PM - edited 05-26-2016 04:55 PM
I have a circuit that puts out a stream of bits along with a clock signal. Rather than sample however fast the MSO can sample, I would like to use the clock I have as a sample clock.
I tried to use the "MSO COnfigure State Mode" VI to select mso/clk0 as the clock (sample on rising edge). I also set input to true. But when I do this, I get data that says the dt is 4nsec and I only see one rising ege of the clock on the plot of the data. I will see if I can post my code.
Thanks in advance for any help,
Joe
05-27-2016 02:02 PM
I would look at this example and see if you can edit it for your application to see how you can clock externally.
VirtualBench: Acquire Analog and Digital Signals with the MSO
http://www.ni.com/example/52073/en/
05-27-2016 02:21 PM - edited 05-27-2016 02:24 PM
Mathew,
I appreciate the link. But the example you pointed me to is not all that different than what I posted. Of course, the UI is WAY more polished then mine. But nothing in that example (that I could find anyway) suggests a way to have the MSO sample with an external clock.
Let me see if I can give you an example of what I would like to do. As I mentioned before, I have two digital signals: a data stream and a clock. The rising edge of the clock means the data is stable and ready to be sampled. I want connect the clock signal to mso/clk0 and the data signal to mso/d0 (for example).
Now, it is fairly straight forward to configure the MSO to sample both signals at some frequency based on a clock internal to the Virtual Bench's MSO.
But I want to configure the MSO to use the mso/clk0 input as a sample clock such that the rising edge of my clock signal causes the MSO to sample (or latch if you prefer) the value on the mso/d0 line and to repeat this for every rising edge of mso/clk0 for some number of samples. Then give me just the values of mso/d0 that it captured.
It is basically the same thing as what the example you provided does. Except that the MSO should use the clock I provide and not the internal clock.
Basically, this is a function many logic analysers have. I understand that this is not exactly a logic analyzer: it is a mixed signal oscilloscope. But I am hopeful.
Thanks,
Joe
05-31-2016 10:46 AM - edited 05-31-2016 10:48 AM
Matthew,
I believe I understand what you are attempting to accomplish. This is indeed a common feature in logic analyzers. Sample mode in VirtualBench does differ from some logic analyzers in the way that this is implemented. Instead of clocking the internal logic using the clock you provide, it runs the frontend at 250MSample and uses the sampled values of the clock to determine when to keep data. This means that the underlying sample rate is 4ns. The fact that you're seeing the sample clock in your waveform as a constant '1' indicates to me that you have successfully configured this mode because it is always storing samples when the clock transitions high, though I understand that may not have been your expectation.
I think using the 'Either' option may better meet your expectations, as you'll be able to see your clock transitioning high and low in the waveform. Also, I wouldn't worry about the fact that it's reporting dt=4ns, because the compression used in the logic analyzer means that whatever rate 4you're sampling at, it only matters how many transitions are stored. Since you've configured it for state mode, you'll only see one transition per clock period (or 2 if you use the 'Either' option).
I hope I answered your question clearly. If not, please let me know.
--
Daniel Larsen
Staff Hardware Engineer, NI VirtualBench
05-31-2016 11:16 AM
Daniel,
Thank you for the information. I will try that and let you know if it works or not.
But I have a working solution at the moment. What I have done is just use the internal clock to sample my clock and my data signal. I then parse the data that comes back from the instrument to extract the value of the data line when the clock transitions from low to high. This should work for now. But it would be nice to find a way to use my clock as the actual sample clock.
Years ago, I did this exact thing using a 32HS card. But I don't have that card anymore.
Thanks again,
Joe