Forum Discussion

ohide's avatar
ohide
Icon for New Member rankNew Member
17 hours ago

Cyclone V HPS SPI Master: Formula for calculating Tsu(min)/Th(min) from rx_sample_dly and spi_m_clk

Hello,

For the HPS SPI Master on the Cyclone V SoC, verify that the SPI read waveform and register settings are correct.

To do this, calculate the MISO setup time and hold time under the operating conditions.

Current settings: rx_sample_dly = 1, spi_m_clk = 200 MHz

 

[Background]

The Cyclone V Device Datasheet and the Hard Processor System Technical Reference Manual do not contain a formula for determining Tsu (min) from rx_sample_dly and spi_m_clk.

In the datasheet, Tsu = 8.35 ns (min) is only shown as a characteristic value under the condition "rx_sample_dly = 1, spi_m_clk = 120 MHz" (Note 69).

Also, Th = 1 ns (min) has no note indicating its relationship with rx_sample_dly and spi_m_clk.

• [Reference] Cyclone V Device Datasheet → "SPI Timing Characteristics"

 

On the other hand, the datasheet for a newer generation device (such as the Agilex 3) equipped with the same SPI controller has the following expression:

• Tsu(min) = 5.0 − (rx_sample_dly × Tspi_ref_clk) [ns]

• Th(min) = 1.3 + (rx_sample_dly × Tspi_ref_clk) [ns]

• [Reference] Agilex 3 FPGAs and SoCs Device Data Sheet → "HPS SPI Timing Characteristics"

 

[What I want to know]

1. For the HPS SPI Master of the Cyclone V SoC, is there a formula to calculate Tsu (min) from rx_sample_dly and spi_m_clk periods like Agilex 3? If so, please tell me the formula and constant term.

2. Similarly, is there a formula to calculate Th (min) from rx_sample_dly and spi_m_clk periods? Also, please tell me under which condition (rx_sample_dly, spi_m_clk) Th = 1 ns (min) in the data sheet is the value.

3. If there is no official formula, is it correct to apply the same shape as Agilex3 (constant ̇ rx_sample_dly × T) to Cyclone V? If so, please tell me the constant to use. Also, I would like to know if the constant is based on rx_sample_dly = 0, and if 8.35 ns in the data sheet already includes 1 stage of rx_sample_dly.

4. Please tell me Tsu (min) and Th (min) under the current condition (rx_sample_dly = 1, spi_m_clk = 200 MHz).

 

Thank you for your support.

2 Replies

  • ai_responder's avatar
    ai_responder
    Icon for Community Manager rankCommunity Manager

    Thank you for your inquiry. To ensure an accurate response, your request has been routed to an Altera application engineer for further review and assistance.


    Note: To continue using AI Responder, please start your next inquiry with ai_responder

    Disclaimer (Beta): The AI Responder is currently provided as a beta feature. AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.

    Thank you very much.

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi


    Q1 & Q2 — Does the Cyclone V datasheet provide a Tsu/Th formula?

    No — the Cyclone V datasheet does not publish a general formula analogous to Agilex 3's expressions.

    Base on the foot note the operating point are (rx_sample_dly = 1, spi_m_clk = 120 MHz) for the Cyclone V.


    Q3 — Can the Agilex 3 formula be applied to Cyclone V?

    No - The formula used in the Agilex3 is not applicable to the Cyclone V. The formula is device specific.


    Q4 — Tsu(min) and Th(min) at rx_sample_dly = 1, spi_m_clk = 200 MHz?

    Since there is no formula in calculating the TSU min and Th min, the way moving forward is to "train" the bus with a coding loop.

    By setting the rx_sample_dly as 1, check if there are any data errors in the bus, and increasing the value at a increment of 1 until there are no error seen.