Forum Discussion

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

SDR SDRAM controller problem

Hi,

I have developed my own SDR SDRAM controller in VHDL to integrate it with the rest of a design inside a Cyclone IV for image processing.

By testing the controller I write in the SDRAM 307200 consecutive bytes using a known pattern.

When I read the SDRAM most of the bytes are read correctly but there are small areas in the RAM that corresponding bytes are read with errors. When I read again the RAM some of the previous error locations are read correctly and some other locations that have been read without errors the first time now are read with errors.

By reading again and again, error locations change randomly (at least randomly it seems to me).

Does this problem look familiar to anyone?

Any idea where should I look for a solution?

Thanks in advance.

Regards,

John

13 Replies

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

    Hi John,

    --- Quote Start ---

    Problem solved

    --- Quote End ---

    Great!

    --- Quote Start ---

    The second issue was concerning the clock signal I lead to the SDRAM. It seems it had ringing or some kind of a noise by causing malfunction to the communication between controller and SDRAM. By placing a small capacitor (15pF) between the clock line and the GND signal all errors disappeared. As you realize hardware is custom too.

    --- Quote End ---

    Depending on the FPGA, some devices have the option to enable a series resistor on outputs. Check the handbook for your device, or just try enabling a series termination and see if Quartus allows it.

    Using a series termination will result in a cleaner clock, since it will have faster edge-rates (ideally) without ringing. Using a capacitor is simply slowing down the edge-rates (its an RC filter, where the R is the output impedance of the driver).

    Cheers,

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

    The FPGA device is EP4CE22E22C7 and supports OCT but it didn't work with the OCT resistance.

    Only when I reduce the slew rate to the slowest it works better but not as good as when I use the capacitor.

    Regards,

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

    Hi John,

    --- Quote Start ---

    The FPGA device is EP4CE22E22C7 and supports OCT but it didn't work with the OCT resistance.

    Only when I reduce the slew rate to the slowest it works better but not as good as when I use the capacitor.

    --- Quote End ---

    Thanks for the feedback.

    If you're involved with the design of a new board, its always a good idea to place an external source termination on any point-to-point clock-like signal. If you have a clock-like signal going multiple places, then you can use dual-source terminations, or add buffers, and source terminate the buffers.

    Ringing clock edges can ruin your day :)

    Cheers,

    Dave