Jump to content
  • 0

Waveforms - Digital Discovery - Detect falling edge of DIO. Drive another DIO low for Y cycles, X clock cycles later


Mike4354

Question

Detect falling edge of DIO.  Drive another DIO low for Y cycles, X clock cycles later.

For reference I am using the Waveforms software in conjunction with the Digital Discovery.

I would like to perform the following using the digital pattern generator.  Set up a DIO as an input and detect a falling edge on this signal.  Once this falling edge is detected, I would like to drive another DIO low for Y clock cycles, X clock cycles later.  This is depicted below.

image.png.df208e0234e9d2c092ea9e37a3ffd04b.png

I couldn't figure out a way to set this up in hardware using the settings in the Waveforms software.  Started going down the path of setting this up on the ROM logic, basically making a truth table to enter into the state machine when DIO 1 goes low and create X states using a binary counter that would result in still holding DIO 2 HIGH, followed by Y states using a binary counter that would result in holding DIO 2 LOW, then set it HIGH again until the next falling edge of DIO 1.

I did use the SDK to try to achieve the same result, but running this logic through software seems much too slow.  Would like a response within 100 to 200 ns if possible.  Is this realistic?

I'm hoping there is a simpler solution to this, so wanted to ask if there was an easier way to achieve this goal before heading down this path.

Edited by Mike4354
Clarification of HW/SW Used
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Hi @Mike4354

Here the Logic Analyzer detector is set to trigger on DIO 24 falling edge and Pattern Generator outputs a 100ns low pulse on DIO 25 with 200ns (20 cycles @ 100MHz) + Wait time delay.

image.png

 

You could adjust the system frequency to change the delay, 250ns (20 @ 80MHz) +

image.png

 

With ROM logic the delay is lower, 80ns at 100MHz (DIO 26 is used as state bit)

image.png

image.png

 

Reducing the ROM frequency will result in delay uncertainty, but delay could be achieved with further state bits.

 

Link to comment
Share on other sites

  • 0
Posted (edited)

Hi @attila, thank you for the reply.  This is a great start.  I now understand that we can use the "Run" period of the pattern generator to control the period of time the pattern generator will generate a pattern for i.e. the Y clock cycles in the original question.

It doesn't really seem like controlling the frequency of the logic analyzer is a reliable way to control the delay before the pattern starts.  There's also very little granularity in terms of what delay can be specified.  Based on what you're saying, running the logic analyzer at 100 MHz and adding multiple state variables to add the delay seems like the best option.

Is adding a configurable delay between a trigger event and an action on a pin realistic for a future improvement?

And just to be clear with the request, can you confirm if there is any way to add an arbitrary delay on the signal in the current Waveforms software without needing to add an additional row in the ROM Logic table for every delay step that needs to be added.

 

Edited by Mike4354
Further clarification on my request
Link to comment
Share on other sites

  • 0

@attila What ended up working really well for me in terms of being able to control the delay for when the pattern started is actually the "Wait" parameter in the pattern generator, whereas using the "Run" parameter as you mentioned above worked really well for controlling the width.

Thanks for all of your help, it is greatly appreciated!

image.thumb.png.4afe11f20a44c92b5f4466e1725b4a28.png

Link to comment
Share on other sites

  • 0

Hi @Mike4354

Currently the Pattern output delay from Logic Detector trigger is 200ns + the specified Wait time.
The next version, hopefully tomorrow, will allow any DIN/DIO to be used directly as trigger source, reducing the minimum delay to 120ns

image.png

Link to comment
Share on other sites

  • 0

@attila Would it be in the realm of possibility to be able to run more than 1 pattern generator at a time?  If not, is there any way to make different signals in a single pattern generator have different durations.  The screenshot below shows 2 different patterns that I would like to run for different durations.  Both are triggered off the falling edge of the same signal, but there "Run" time needs to be different.

If there is not a direct way to achieve this result, is there some sort of workaround or alternative method that you can think of?

image.thumb.png.fccb242b41129a28e3fc58bd72a33084.png

Link to comment
Share on other sites

  • 0

@attila Wanted to sneak in one more question closely related to the above.  Are the selections for the run period and wait period arbitrarily limited to specific dropdown menu items below, and if so, can this possibly be expanded?  For example, I need the binary counter to run for a few different periods between 1 and 2 microseconds and then go back into Hi-Z state, as I am operating on a multiplexed bus.  It would be nice to be able to run at 1 us, 1.1 us, 1.2 us, 1.5 us, etc.  Even more granularity would be nice.

I'm sure more expensive logic analyzers could do this, but if the Digital Discovery can achieve this, that would be huge.

image.png.c71b062a7e330d4690485126555b90a7.png

Edited by Mike4354
Clarifying Question
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...