Analog trigger problem

  • 2 Replies
  • 918 Views
Analog trigger problem
« on: April 20, 2020, 02:30:42 PM »
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?

*

Dejan

  • *****
  • 106
    • View Profile
Re: Analog trigger problem
« Reply #1 on: April 21, 2020, 07:56:45 AM »
I noticed that you are setting the trigger source from CH-1. Are you sure that signal on CH-1 is crossing the trigger level 300?
Other thing to check is what is the trigger LED indicator showing. Does the LED blink at first crossing of the trigger level or only at the second (this will show if the FPGA is detecting the trigger).

Re: Analog trigger problem
« Reply #2 on: May 07, 2020, 11:58:33 AM »
The trigger is a 3V3 square wave and I've set the trigger level to 204 now, but still the same results.
I'm performing around 10 captures per second and while capturing the LED between CH1 and CH2 is flashing at a constant rate (slightly faster than 1Hz).  When it fails to trigger it does not light up.
I'm currently looking at using other hardware test equipment to test this further.