I'm having a problem coding up a pulse width trigger and can't find an example of one in the sdk. Just wondering if you could check the code snippet below or point me to an example.
Basically I want to code up chan A, positive pulse, threshold of 100mv and pulse width less than 100ns and 1.5% hysteresis. This works fine for me in the PicoScope trigger settings window. But code below is not triggering for me.
Regards,
Patrick
...
short triggerVoltage = mv_to_adc(100, range);
short triggerHysteresis = mv_to_adc(150, range); //?? For 1.5% what should this value be?
But not sure why you put FALLING as the trigger direction and pulse width direction of RISING_LOWER. Are these because I said it was a positive pulse? What about the POSITIVE_RUNT value?
How to set the triggerHysteresis in TRIGGER_CHANNEL_PROPERTIES structure? For 1.5% what should this value be? what is the mean of 256*10 in the API demo?
The hysteresis is the similar to the trigger ADC if you want 1.5% you will need to calculate what is is in ADC counts.
So you could take the trigger ADC count and times it by 0.0015 and use that for you hysteresis ADC count.
The 256*10 we provide in the example is just something an arbitrary value.