Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

to use altlvds,how I can use LVDS bit clock and LVDS frame clock of ADC at the same t

In my board, there are 5AGXFB3H4F40C5N and TI ADS5294.

The ADS5294 is a 80-MSPS 8-Channel ADC,The digital data from each channel ADC is output over two wires of LVDS output lines depending on the ADC sampling rate.The transmission signals between ADS5294 and FPGA are mainly LVDS bit clock ,LVDS frame clock and sampling data lines.

The ADC sampling rate is 80MSPS,

data rate of each data line is 560MSPS,

the frequency of LVDS bit clock is 280MHZ(DDR timing),

the frequency of LVDS frame clock is 40MHZ.

I want to receive sampling data with altlvds ip in FPGA, however,the altlvds ip only supply one clock input port.

My problem is ,to use altlvds,how I can use LVDS bit clock and LVDS frame clock of ADC at the same time ?

19 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi zhangfeng,

    For the rx_channel_data_align, you should pulse it then check for right data. If right, then stop pulsing. If wrong, then do another pulse. You might need to pulse it a few times until you get the right data.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi zhangfeng,

    For the rx_channel_data_align, you should pulse it then check for right data. If right, then stop pulsing. If wrong, then do another pulse. You might need to pulse it a few times until you get the right data.

    --- Quote End ---

    Thank you very much, tiny007.

    If the number of channels is 4, should I pulse the bits of rx_channel_data_align[3:0] separately, or set all the bits at the same time(for example, rx_channel_data_align[3:0] = 4'b1111, then set rx_channel_data_align[3:0] = 4'b0000)?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thank you very much, tiny007.

    If the number of channels is 4, should I pulse the bits of rx_channel_data_align[3:0] separately, or set all the bits at the same time(for example, rx_channel_data_align[3:0] = 4'b1111, then set rx_channel_data_align[3:0] = 4'b0000)?

    --- Quote End ---

    Hi zhangfeng (http://www.alteraforum.com/forum/member.php?u=55909).

    You should pulse the bits of rx_channel_data_align[3:0] separately. Different channels may have different shift.

    Regards,

    Andrei
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    If I don't use the frame clock as PLL input clock, but use FPGA's clock as the PLL input clock, can I get the correct data from the A/D converter?

    --- Quote End ---

    You must work with frame clock or bit clock of A/D converter. FPGA's clock and ADC's clock are asynchronous you will have wrong data reception.

    Regards,

    Andrei
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi zhangfeng (http://www.alteraforum.com/forum/member.php?u=55909).

    You should pulse the bits of rx_channel_data_align[3:0] separately. Different channels may have different shift.

    Regards,

    Andrei

    --- Quote End ---

    Thanks, Andrei.

    Yesterday, I tried pulsing all the bits of rx_channel_data_align[3:0] at the same time like following:

    In the test bench, I use a while loop to check the output of LVDS frame clock, if the result is 8'hf0, then stop pulsing; if the result is not 8'hf0, then pulsing all the bits of rx_channel_data_align[3:0] at the same time.

    And this method worked.

    Tomorrow, I'll try pulsing rx_channel_data_align[3:0] separately, and check the output is right or not.

    Regards,

    zhangfeng
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    You must work with frame clock or bit clock of A/D converter. FPGA's clock and ADC's clock are asynchronous you will have wrong data reception.

    Regards,

    Andrei

    --- Quote End ---

    Thanks again, Andrei.

    I'll use bit clock as the the input clock of ALTLVDS_RX's internal PLL, and use frame clock to decide whether to pulse rx_channel_data_align or not.

    Regards,

    zhangfeng
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Yesterday, I tried pulsing all the bits of rx_channel_data_align[3:0] at the same time like following:

    In the test bench, I use a while loop to check the output of LVDS frame clock, if the result is 8'hf0, then stop pulsing; if the result is not 8'hf0, then pulsing all the bits of rx_channel_data_align[3:0] at the same time.

    And this method worked.

    --- Quote End ---

    If phase difference between clock and data is same for all channels (ADC lines) this method works. This is true for ModelSim. In real may be situation when different shift is required for all channels. If you use this method you cannot align all channels correctly.

    Regards,

    Andrei
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    If phase difference between clock and data is same for all channels (ADC lines) this method works. This is true for ModelSim. In real may be situation when different shift is required for all channels. If you use this method you cannot align all channels correctly.

    Regards,

    Andrei

    --- Quote End ---

    Thank you so much, Andrei.

    Now I know I should pulse rx_channel_data_align[3:0] separately.

    Regards,

    zhangfeng
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    The frame line is just a 9th data line that sends a constant value. If you're doing x14 deserialization, then it sends "1111111_0000000." But it looks like x14 is not an option, so you're going to be doing x7. That means the frame data is going to alternate between "1111111" and "0000000".

    If you're already using an 8-channel altlvds megafunction, just change it to 9 channel. You also need to select options so that you have the rx_channel_data_align port on the altlvds. This port allows you at ask the altlvds block to change where the word boundary is in the serial stream. Every pulse on this port moves the word boundary by one stream.

    The final piece is to write a fairly simple state machine to pulse rx_channel_data_align until you see the frame channel coming out of the lvds block as "1111111" or "0000000." The bit-slip operation applies to all 9 data channels, so once you have the frame pattern aligned, your other 8 data lines are also word aligned.

    In summary, the frame "clock" is really just another data line with a known word being transmitted. You can use that knowledge to find the correct word boundary in the serial stream on the other 8 data lines.

    Also note, that the frame word also tells you whether you are getting the high 7-bits or low 7-bits. It is "1111111" for one and "0000000" for the other.

    --- Quote End ---

    Hello,

    This post is very useful for me.

    In my case, i want use a FPGA to receive several ADCs (octal channels), for example each side receive 3 ADCs by using EP4S230KF40C2. Question is that there are only 2 left-right-PLL for each side. So i need use external PLL mode for this application. It seems i should use "LVDS interface with Use External PLL Option Enabled" mode. Is there any issue by using one PLL for those 3 LVDS streaming?

    PS: The attached image is found in Linear Tech's AN paperhttp://www.alteraforum.com/forum/attachment.php?attachmentid=12277&stc=1 .

    Thanks