Products > FMC Products

FMC168 External Trigger

(1/4) > >>

roengrut:
Dear 4DSP,

I currently have an FMC168 and would like to implement external trigger capability of the FMC board. After taking a look into the software part (main.cpp) of this board and also into the VHDL part (fmc168_ctrl.vhd) I found the software trigger function, called FMC16x_ctrl_sw_trigger. In the fmc168_ctrl.vhd file line 346 there is the trigger source selection part of the code. There are 3 conditions for trigger selection, sw_trigger, trigger_sel_reg = EXT_TRIGGER_RISE, and  trigger_sel_reg = EXT_TRIGGER_FALL. I would like to apply external trigger (will be supplied through External Trigger pin) and I think that the latter 2 conditions of trigger selection part would be used. I really do not know how to implement or call which function in the software part (in the main.cpp file) in order to use with the External Trigger. I could not find any hardware-related function (in C). Please correct me or suggest me if I am wrong or miss anything related to this.

Could you please suggest me how to do this ? I would be really appreciated. Thank you very much for your time and I look forward to receiving your suggestions soon.

Regards,
Roengrut

arnaudNL:
Dear Roengrut,


In a RTL point of view you have an OR between software and external trigger. It is actually pretty straightforward. FMC16x_ctrl_sw_trigger() actually writes to FMC168.CTRL in the RTL, it writes 4 to the first register of the control module in the FMC168 star.


If you look at the star documentation (SD192) chapter 6, you will see that FMC168_CTRL_COMMAND definition has bit2 called 'TRIG' and this is exactly what writing 4 at BAR CTRL does in FMC16x_ctrl_sw_trigger.


What you want to do is write a FMC16x_ctrl_set_trigger_source() and write there the value you want in FMC168_CTRL_CONTROL bits 8 and 9. Looking at chapter 5 you see that FMC168_CTRL_CONTROL is located at the address where FMC168 star is located + 1.


Just to make sure, I would anyway remove the software trigger call from the software and not expect that to be really disabled by ETC, I believe there is a OR operation between the two trigger source.


I hope that helps!


Best Regards,
Arnaud



roengrut:
Dear Arnaud,

Thank you for your recommendation very much. My colleague who develops the application just tried to apply the function  FMC16x_ctrl_set_trigger_source()  to set the ETC bits (bit 8 and/or bit 9) of the FMC168_CTRL_CONTROL. He checked that the software does what we want and hoped that it would enable the hardware trigger . As I and he double-checked with the VHDL code in fmc168_ctrl.vhd lines 346 - 355, we hoped that the conditions 2 or 3 will be true ( by knowing that ext_trigger_re = '1' or ext_trigger_fe = '1'). After trying, we found that this does not work.  He did try with disabling (removing) the software trigger call from the software, and he confirmed that ETC bits changed to what he wanted but still hardware trigger does not work. We think that there is no OR operation between two trigger sources. You can see the pictures I attached here.

Up to this point we still do not know what to do next. Is there anything we should do with the FMC168_CTRL_COMMAND's bit "TRIG" in relation to the FMC16x_ctrl_set_trigger_source() function in the software ? We now just know that the hardware trigger does not do anything witht the TRIG bit of the register FMC168_CTRL_COMMAND . Is there anything else that we should do to get it to work?

iklink:
Dear Roengrut,


In your main function C file, I see that you arm the trigger before configuring the external trigger as a trigger source. I recommend you to first enable the external trigger and then arm the trigger block.
Secondly; to verify your external trigger is present on the input of the FPGA, you could perform a quick test by providing a 10MHz trigger. You should see a trigger frequency of 10MHz in the Log of the reference application (in the frequency measurement section).


Best regards,
Ingmar van Klink
4DSP

lmunoz:
Hi,

I have verified this works. You first should verify you are applying the correct type of signal to the external trigger as Ingmar recommended you should see the output like this:

 --- Measuring on-board frequencies ---
Stellar IP Clock : 125.00 MHz
ADC PHY0 Clock   : 250.00 MHz (Fvco = 1250.00)
ADC PHY1 Clock   : 250.00 MHz (Fvco = 1250.00)
External Trigger :  10.01 MHz
Clock to FPGA    : 250.00 MHz
 

 Next I modified the function FMC16x_ctrl_enable_channel to write 0x301. Instead of the usual 0x1. That will enable both rising and falling edge external trigger.
  Then I comment out the line that does the software trigger ….
  // send a software trigger to the ADC block
// if(FMC16x_ctrl_sw_trigger(AddrSipFMC16xCtrl)!=FMC16x_CTRL_ERR_OK) {

 Then i was able to read data that was a result of an external trigger.

Regards,
Luis

Navigation

[0] Message Index

[#] Next page

Go to full version