Hi I have a question about the trigger value of triggerout. As far as I understand, triggerout’s trigger is set to 1 when a rising edge is detected, and that rising edge is cleared when UpdateTriggerOuts() is called. So right now I have the following setup:
VHDL
inLight ok1, ok2 => ok2,
ep_addr => x"60", ep_clk => clk1, ep_trigger => TrigOut60);
and
C#
public long doDetect(Stopwatch sw)
{
long timeInNanoSeconds;
while (true)
{
m_dev.UpdateTriggerOuts();
if (m_dev.IsTriggered((short)0x60, (short)1))
{
sw.Stop();
timeInNanoSeconds = sw.ElapsedTicks * nanosecPerTick;
break;
}
}
return timeInNanoSeconds;
}
so basically what happens is that a button (active low) is connected to the triggerout, and when I call doDetect(), it will hang and wait for the button press to call a rising_edge on the tirggerout’s trigger. So the expected behavior is that when I press the button, the doDetect() gets out of the infinite while loop, otherwise, it stays there indefinitely.
However, what’s happening now is that I call doDetect(), I press the button once, and I call doDetect() again, without pressing the button on the second time. However, I have debug statements to show that it still get out of the second infinite while loop, and I am not sure how this can be happening if I didn’t press the button again. Can some1 please let me know?
Thanks,
Larry Chen