This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TSW1400EVB Source Code

Other Parts Discussed in Thread: ADS5400, ADS5474, DAC5681Z, AFE5805, AFE5809, AFE5808

Hello,

I am using a TSW1400EVB with ADS5400EVB to capture high-speed pulse data and need to modify the trigger algorithm on the TSW1400.  Would you be able to send the source code?  Thank you.

  • Hi David,

    Can you describe your trigger needs?  The firmware may already support it.  We also have a DLL that is accessible via C/matlab or labview that may meet your triggering needs.

    Ken

  • Like an oscilloscope, I need to have the acquisition running continuously and have it store a certain amount of data before and after the trigger.

  • Will I be getting an answer on this?

  • Hi David,

    Ken is currently traveling. The TSW1400 does support triggering. Currently the trigger must be armed before every trigger pulse.  When a trigger is detected the TSW1400 will capture the number of samples set by HSDCPro. HSDCPro can then retrieve the samples from the TSW1400. You then must arm the trigger again for the next capture. Also, the trigger is currently an external signal, it is not derived from the signal itself. We do have a DLL that can arm the trigger and retrieve the data, so you could write a program that arms the trigger, retrieves the data, and rearms the trigger. Then you would just need to create a circuit that creates the trigger from the analog signal which could be done with a simple comparator.

    If you need it to run continuously, then I don't think the TSW1400 firmware will be easily modified for this. You would need to be able to retrieve the samples at the same rate that you captured them. The current FPGA to USB interface is limited in that sense.

    Regards,
    Matt Guibord 

  • The trigger will be external.  We need to capture data from BEFORE the trigger.  Once triggered we would hold the current buffer and read it back at the USB rate.  I am capable of writing the code to do this, but would like to start with the current working code.

  • Hi,

    The ADC that you want to capture from is mine to support, but I was not the author of the TSW1400 firmware for this interface.  I will have to find the location of the source code for you.  It will be in the form of an archived Quartus file I believe. 

    I know a bit about the triggering capabilities of the TSW1400, so I have an idea of the place in the source code that you would have to go to.  The TSW1400 is set up for a capture and controlled through a small register space of control registers that is defined for the firmware.  One of these registers is the 'capture' register and writing a '1' to a bit (I think the lsb) in the register causes the capture to begin.  (after this bit is re-synchronized from the clock domain of the SPI port that is used to set the bit over to the clock domain of the sample clock from the ADC.) 

    For a 'triggered' capture, the capture register is set with a different bit set than the usual capture bit.  The fiirmware is written so that when there is a rising edge on the 'Trigger In' SMA, then the contents of the capture register are shifted down some positions.  So if the capture register is cleared and an external trigger comes along nothing happens because the zero contents of the register shifted down are still zero.  But if the capture register is 'armed' for a capture by writing a '1' to a bit position higher up in the register, then nothing happens until the external trigger even causes the register to shift down.  Now that '1' that was further up in the register is shifted down to the position that causes a capture to begin and so the externally triggered capture begins. 

    That's how the trigger works righ now.  There are some other bits available in that 8-bit register, so we have also written the code to use these few bits as a counter value.  Five of these bits set a counter value, so that after an external trigger, the counter value counts down to zero and *then* the shift of the register happens, so we can have a small programmable delay after the trigger event.    Still not what you want to see.

    It sounds like you want to have the capture card capturing continuously, and when the memory buffer is full then just wrap around to the beginning and overwrite the old data - until a trigger event causes the capture to stop and then the contents of that buffer up to that point are offloaded to the PC.  That would require a re-write of the code.

    If you can provide me with your email address then I can see about getting this Quartus project archive to you.  It may be a large enough file that I would have to put it on a download site and then email you the access information.

    Regards,

    Richard P.

  • Yes, you understand.  My email is <david.mcgaw@dartmouth.edu>.  Thanks for the explanation of the trigger state machine.  It may be possible to retain that and just modify the capture code to run as a circular buffer.  I can keep you apprised of our progress.  Thank you.

  • Have you been able to find the code yet?  I really need to get this going if we are to get any field data this summer.  Thanks.

  • Hi,

    I am still looking for the archived code.  I've not found it where I expected to see it, and have asked someone who has a copy to verify its completeness (that it can can compile to a working rbf)  so I can send it.

    Regards,

    Richard P.

  • Hi ,Richard,If you find the code,please send me a copy.Thanks

    My email  syunjiang@126.com

    Regards.

    yunjiang shi

  • Hi Richard,

    Could you please send what you have.  I must get going on this.

    Thank you,

    David McGaw

    Dartmouth College

  • Hi,

    For David McGaw, qar file sent to the address provided. 

    for yunjiang shi, what ADC are you interested in?  The TSW1400 has a different firmware for each different format of sample data from an EVM.  The original posting was for the firmware for interface with an ADS5400 EVM, but unless you are using the same EVM you would likely want a different setup of the firmware.

    Regards,

    Richard P.

  • Dear Richard,
    I am going to use the ADS5474 and DAC5681Z in my project and would like to kindly ask you to provide me the TSW1400 firmware codes for these devices to the following email address:

    brisk <at> onet (dot) pl

    Thank you much in advance.

    Marcinski

  • Hi Richard,

    Can you provide me the code please.

    My email ID: matlab_fft@yahoo.com

    Thanks.

    -BAS

  • Hi Richard,

    I would appreciate very much if you send me the code too. I'm developing a new firmware so there some modules that will help me a lot! 

    I'm using AFE5805 (I know there is no code for that board but you can send me to AFE5809, or another one, because I think that all boards send data to TSW1400 serial, LVDS, in both clock edges)

    My email is danilojcamara@gmail.com, or danilo_jcamara@yahoo.com.br

    Thank you

    Danilo

  • Danilo,

    The data format is identical with the AFE5805 and AFE5809.  For the TSW1400 there is FW called "AFE5808_09_1Xb". This will actually support the AFE5805 as well.

    Are you asking for the TSW1400 FW?  We can only provide this AS IS, with no support.

    Thanks,

    Chuck Smyth

  • Hi Chuck,

    I need the verilog or vhdl FPGA code. I will need to develop my own firmware because I will use CMOS port to control another emission board. I already use TSW1250 and you send me the verilog code for it. Could you send me the open code for Stratix IV too?  Having it I can just instantiate my module and make some changes to it work, without need to do all the code again...

    Thank you

    Danilo Camara

  • Hi:

    I have been reading this thread in parallel with a similar one for the older TSW1250 that uses a Xilinx FPGA.
    We could use the code for the TSW1400EVM as a starting point for a system redesign using ALtera FPGA's, I have managed to shift opinions here about our somewhat arbitrary Xilinx (vs Altera) project constraint.

    If the Altera Quartus project code for the TSW1400EVM was available, in a version that supported (or came close to) supporting the AFE5808 style LVDS connection requirements, there would be much rejoicing on this end.

    Is this Quartus project code available?

    Cheers,

    Curtis