This is a re-write of my previous trigger project. This time Tang Nano and Tang Nano 9k are the target hardware boards and the USB UART is used to configure and enable triggering (and drive the validation patterns). An internal clock frequency of 100MHz is used, which can result in triggering on very fast external pulses (subject to the performance of the FPGA and FPGA board).
Tang Nano connections:
Tang Nano 9k connections:
I included my pattern generator and block ram designs, which aid in validating the trigger functions. If you have an inexpensive logic analyzer you can view all the stimulus waveforms and the resulting triggers. The pins trigger_in and pat_gen_out[0] need to be connected.
I support all trigger types listed here: https://www.tiepie.com/en/fut/pulse-width-trigger
Type 0 Positive Edge (no count durations, just trigger on the edge)
Type 0 Negative Edge (no count durations, just trigger on the edge)
Type 1 Positive Edge (trigger on pulses shorter than count1)
Type 1 Negative Edge (trigger on pulses shorter than count1)
Type 2 Positive Edge (trigger on positive pulses larger than count1 on the falling edge)
Type 2 Positive No Edge (trigger on positive pulses larger than count1, immediately before the falling edge)
Type 2 Negative Edge (trigger on negative pulses larger than count1 on the rising edge)
Type 2 Negative No Edge (trigger on negative pulses larger than count1, immediately before the rising edge)
Type 3 Positive Edge (trigger on positive pulses larger than count1 AND less than count2, on the falling edge)
Type 3 Negative Edge (trigger on negative pulses larger than count1 AND less than count2, on the rising edge)
Type 4 Positive Edge (trigger on positive pulses larger than count1 OR less than count2, on the falling edge)
Type 4 Positive No Edge (trigger on positive pulses larger than count1 OR less than count2, immediately before falling edge)
Type 4 Negative Edge (trigger on negative pulses larger than count1 OR less than count2, on the rising edge)
Type 4 Negative No Edge (trigger on negative pulses larger than count1 OR less than count2, immediately before the rising edge)
That's it.