Triggers placement and precision

Hi,
I am trying to capture the following operation:

for (j = 0; j < 15; j++) {
    v->vec[0].coeffs[j] *= 1 - 2 * b;
    }

Here’s what I get when I put the trigger calls inside the loop:

for (j = 0; j < 15; j++) {
    trigger_high();
    v->vec[0].coeffs[j] *= 1 - 2 * b;
    trigger_low();
    }

And here’s what I get when I put them outside:

trigger_high();
for (j = 0; j < 15; j++) {
    v->vec[0].coeffs[j] *= 1 - 2 * b;
    }
trigger_low();

I still get 15 spikes, but with less points. Can someone explain me this phenomenon?
Thanks in advance for your help!


Here is the trace with the triggers outside, I couldn’t put it in my first messge.

You haven’t showed your capture code: how are scope.adc and scope.trigger set up?

If you’re doing a “normal” capture, then it’s only the first trigger_high() that will trigger a capture.

The scope must be re-armed (through Python) prior to each capture, unless you’re using segmented captures (which is only possible with Husky).

Thank you for your answer. I have a Husky, but I don’t use this option. I just use the generic settings:
scope.gain.gain changed from 0 to 22
scope.gain.db changed from 15.0 to 25.091743119266056
scope.adc.samples changed from 131124 to 5000
scope.clock.clkgen_freq changed from 0 to 7363636.363636363
scope.clock.adc_freq changed from 0 to 29454545.454545453
scope.io.tio1 changed from serial_tx to serial_rx
scope.io.tio2 changed from serial_rx to serial_tx
scope.io.hs2 changed from None to clkgen
scope.glitch.phase_shift_steps changed from 0 to 4592
scope.trace.capture.trigger_source changed from trace trigger, rule #0 to firmware trigger
I then just changed scope.adc.samples value.