01-13-2021 03:14 AM
I am generating an internal 25MHz clock to drive an external OV7670 camera module that I connect via PMODs. I encountered some issues so I was attempting to debug. When observing the 25MHz output on the PMOD I do not observe a square wave but rather something closer to a triangular wave as shown below. The observed signal is 25MHz, however, it is causing problems with the other camera outputs I assume since it is not a square wave. I am observing the signal using the analog discovery 2 with the 1+ input hooked up to the PMOD output pin and the 1- input hooked up to the PMOD GND. Below is also an excerpt from the constraint file that configures the pin. I have tried changing the slew rate and also tried generating the 25MHz clock using the PLL instead through the clock wizard but I get the same result. Any insights would be appreciated.
set_property -dict { PACKAGE_PIN H14 IOSTANDARD LVCMOS33 } [get_ports { XCLK_JB }]; #IO_L15P_T2_DQS_15 Sch=jb[4]
01-13-2021 03:24 AM
First, you are only sampling the 25MHz square wave at 100MHz. You will only see the fundamental tone (25MHz) and the first odd harmonic (75MHz). You also need to take into account the bandwidth of your probe or connection to the PMOD. PMOD connectors aren't great for high frequency signals, but I would expect something better for 25MHz. Get your hands on a good scope and probe and repeat the measurement.
Other questions. Is this clock terminated at the receiving end? Is your measurement made with the receiving device in place?
01-13-2021 03:27 AM
@omh1982 ,
How are you outputting your clock signal to the FPGA pin is the big question.
It is recommended to do it via the ODDR primitive. Are you doing it this way?
MMCM -> ODDR -> OBUFDS.
See this post for details: https://forums.xilinx.com/t5/Other-FPGA-Architecture/drive-clock-out-from-FPGA/td-p/838391
------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem
01-13-2021 03:27 AM
So , you need to look at the circuit diagram of the bits you are using.
Square wave, to get a good waveform, you need at least the 5th harmonic , ( Fourier theory of a square wave )
https://en.wikipedia.org/wiki/Square_wave
at 25 MHz, the 5th harmonic is 125 MHz,
Which is not a problem for the FPGA,
but to transmit 125 MHz, you need a fairly good balanced trace,
P-Mod typicaly have series resistors on IO pins, are routed all over the place, so have high capacitance.
QED, an RC low pass filter.
So what you are seeing is the curve of a low pass filter charging and discharging.
Try probing much closer to the FPGA , and use a short earth clip direct to the probe tip, not the long wire on the scope probe,
Up the sample rate of the scope, and zoom in more,
I'd also suggest you have a look with the scope set not to interpolate between points, just to get an idea just what the real samples look like.
01-13-2021 04:51 AM
Thank you all, I tried some of the suggestions but still see something similar at 25MHz. I did reduce the frequency to 5MHz and got a much better waveform. However, I yet have to get access to a better scope and remeasure at 25 MHz.
01-13-2021 06:27 AM
Why do you think its the scope ?
Whats the scopes sample rate and bandwidth ?
Are you using the 10X probe that came with the scope ?
if not you are loading the output of the board even more .
When you lower the output frequency , did you look at the rise / fall times of the signal ?
if not do so, I'm betting they are the same sort of time as you see at 25 Mhz.
01-13-2021 12:08 PM
@drjohnsmith You have to squint to see it, but the scope display is showing "8192 samples at 100MHz". I took this to mean a 100MHz sampling scope.
01-13-2021 12:37 PM
you have better eyes than me,
01-13-2021 12:56 PM
Probably just a bigger screen.