stever Posted March 25, 2019 Share Posted March 25, 2019 Hi, I need to generate a custom pattern on some pins and capture data on others at the same time. I need to capture the data synchronously with the generated pattern. Is this possible ? Thanks Link to comment Share on other sites More sharing options...
JColvin Posted March 25, 2019 Share Posted March 25, 2019 Hi @stever, Yes, this is possible to do; this is described a bit more in this thread where the oscilloscope, patterns, and waveform generator are synchronized with each other. Let me know if you have any questions about this. Thanks, JColvin Link to comment Share on other sites More sharing options...
stever Posted March 27, 2019 Author Share Posted March 27, 2019 Hi JColvin, Thanks for the link. My task is a little different (boundary scan chain testing). I want to output a digital pattern, once and only once. I don't find a way to stop it repeating except to set the time to match the number of samples in the sequence with the frequency. Not very convenient as I have multiple patterns of different length and may also need to experiment with the frequency. At the same time, I need to synchronously capture digital data using the LA (unless you think the scope would be a better choice) on different pins. I don't need to do any protocol analysis as I will send the pattern data from a file and export the captured data to another file for offline checking. Cheers stever Link to comment Share on other sites More sharing options...
attila Posted March 27, 2019 Share Posted March 27, 2019 Hi @stever Select Repeat 1 and check the "Auto Run" option in Patterns. This will adjust the Run length according the longest period from the configured signals. Like here to 20us for a custom patter of 20 samples at 1MHz. Configure the Logic Analyzer for Normal trigger on Patterns. Link to comment Share on other sites More sharing options...
stever Posted March 27, 2019 Author Share Posted March 27, 2019 Hi Attila, Thanks for the settings. I now get the correct single pattern. I have pattern frequency of 10MHz but not sure how that matches the LA sampling rate. The inputs selection seems to be at minimum 200MHz. How can I ensure the LA samples the data using the same clock as the PG ? Cheers stever Link to comment Share on other sites More sharing options...
stever Posted March 27, 2019 Author Share Posted March 27, 2019 OK, I found a Rate setting after unhiding advanced options so I now get the same number of samples in the LA. Thanks guys for the swift support Cheers stever Link to comment Share on other sites More sharing options...
stever Posted April 4, 2019 Author Share Posted April 4, 2019 Hi again, I am now trying to drive this with python scripting, referring the SDK and examples. I have managed to get my pattern output but I cannot control it to only send it once. I have run an example generating pulse and analog acquisition and can set the number of repetitions in that but cannot get it to work with my custom pattern for pin in range (0, 4): dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(1)) dwf.FDwfDigitalOutEnableSet(hdwf, c_int(pin_no), 1) dwf.FDwfDigitalOutEnableSet(hdwf, c_int(pin_no), 1) dwf.FDwfDigitalOutTypeSet(hdwf, c_int(pin_no), DwfDigitalOutTypeCustom) dwf.FDwfDigitalOutDividerSet(hdwf, c_int(pin_no), c_uint(100000000)) dwf.FDwfDigitalOutDataSet(hdwf, c_int(pin_no), pattern, c_int(8 * len(pattern))) dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) Link to comment Share on other sites More sharing options...
attila Posted April 5, 2019 Share Posted April 5, 2019 Hi @stever pattern = (4*c_byte)(*[0x10,0x32,0x54,0x76]) hzBase = c_double() dwf.FDwfDigitalOutInternalClockInfo(hdwf, byref(hzBase)) # 100MHz hzSampleRate = 1e8 divider = int(hzBase.value/hzSampleRate) for pin in range (0, 4): dwf.FDwfDigitalOutEnableSet(hdwf, c_int(pin), 1) dwf.FDwfDigitalOutIdleSet(hdwf, c_int(pin), DwfDigitalOutIdleLow) dwf.FDwfDigitalOutTypeSet(hdwf, c_int(pin), DwfDigitalOutTypeCustom) dwf.FDwfDigitalOutOutputSet(hdwf, c_int(pin), DwfDigitalOutOutputPushPull) dwf.FDwfDigitalOutDividerSet(hdwf, c_int(pin), c_uint(divider)) dwf.FDwfDigitalOutDataSet(hdwf, c_int(pin), pattern, c_int(8* len(pattern)))# same pattern for each pin # the following apply globally to each pin: dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(1)) dwf.FDwfDigitalOutRunSet(hdwf, c_double(8.0*len(pattern)*divider/hzBase.value)) dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) Link to comment Share on other sites More sharing options...
stever Posted April 5, 2019 Author Share Posted April 5, 2019 Hi Attila, Thanks for the swift response. So you used RunSet to limit the duration but repeat count still works This example works well for me. Great support Cheers stever Link to comment Share on other sites More sharing options...
stever Posted May 31, 2019 Author Share Posted May 31, 2019 Hi Attila, I am finding the daya capture difficult. I tried the DigitalIn_record and DigitalIn_Acquisition examples but I get a flat zero plot line. It seems the sampled data is all zeros. My understanding is that all the data lines are automatically sampled and there is no need to configure pins as inputs. I have connected two of the output (counter) signals to other inputs to try but still get all zeros. Thanks stever Link to comment Share on other sites More sharing options...
stever Posted May 31, 2019 Author Share Posted May 31, 2019 I connected four LSBs of the configured output pins to the high speed inputs pins [3:0] and now get a graph that looks a bit like a counter but not uniform staeps 0 to 15 as epected. Any comments ? Link to comment Share on other sites More sharing options...
stever Posted May 31, 2019 Author Share Posted May 31, 2019 More Information: I had changed the duty cycle settings so that may have caused some odd behaviour. I reset it to 50% and get a counter plot but with some glitches indicating the outputs do not all change at the same time. I tried changing the input divider (set to '4' and saw some improvement. How can I use the slower DIO pins to capture the data instead of the high speed pins and how can I synchronise the sampling clock with the output clock ? Thanks stever Link to comment Share on other sites More sharing options...
attila Posted June 3, 2019 Share Posted June 3, 2019 Hi @stever See the following example: DigitalOut_CustomBus.py Link to comment Share on other sites More sharing options...
stever Posted June 3, 2019 Author Share Posted June 3, 2019 OK, got it - many thanks. Note that pycharm complained of a non-ascii character is line 73. I deleted it (it is a comment) and retyped and it runs. Cheers stever Link to comment Share on other sites More sharing options...
Question
stever
Hi,
I need to generate a custom pattern on some pins and capture data on others at the same time.
I need to capture the data synchronously with the generated pattern.
Is this possible ?
Thanks
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.