I've developed a library to control the Scopefun V2 hardware based on libusb. Everything seems to be working OK (firmware upload, channel set-up, reading calibration from EEPROM, capture, etc.) except that I have a problem with analog triggering in Normal mode. I am using the latest FX3 and FPGA firmware.
I set up the SHardware2 structure to have trigger mode normal, rising edge detection, source CH-1, trigger level 300, hysterisis 0, pre-trigger 0, holdoff 0. ETS is off, adc interleaving is off and vgain/offset/att values all give the expected readings. The sample rate is 4ns/250 MSPS and the sample size follows the rules of >256 and a multiple of 4.
I then repeatedly start a process that triggers a rising edge when it starts and want to capture the analog output from this process on CH-2.
So the software flow is:
Send hardware control structure to set up triggering, channels, sample rate etc.
loop forever:
start external process - it generates a rising edge on start
capture data from scopefun CH-2 using libusb_bulk_transfer() on endpoint 6
What I am finding is that the capture only happens if I send the trigger two times by starting the external process two times - i.e. the Scopefun only seems to be triggering when it gets two rising edges and it ALWAYS misses the first one. Once it triggers, the data collected looks good and there is no problem with the transfer.
If I only start the external process 1 time, I get a timeout when trying to read the header over USB. When this then loops around again it collects data successfully the next time the external process happens.
Any ideas?