I have a Spartan 6 LX100-3 board with an onboard 125MHz clock and I'm trying to get a 36.864MHz clock to drive an ADC.
Initially, I tried this:
DCM_CLKGEN #(
.CLKFX_DIVIDE (125),
.CLKFX_MULTIPLY (192),
.CLKIN_PERIOD(8)
) DCM0 (
.CLKFX(dcm0_clkfx), // 192MHz
.CLKFX180(),
.CLKFXDV(),
.LOCKED(dcm0_lckd),
.PROGCLK(),
.PROGDATA(),
.PROGDONE(),
.PROGEN(),
.STATUS(dcm0_status),
.CLKIN(osc_clk),
.FREEZEDCM(1'b0),
.RST(dcm0_status[2] && ~dcm0_lckd)
);
PLL_BASE # (
.BANDWIDTH("HIGH"),
.CLKIN_PERIOD(5.208),
.CLKFBOUT_MULT(24),
.CLKOUT0_DIVIDE(25),
.COMPENSATION("DCM2PLL"),
.DIVCLK_DIVIDE(5)
) PLL0 ( //921.6MHz
.CLKFBOUT(pll0_clkfb),
.CLKOUT0(sys_clk_36p8), //36.864MHz
.CLKOUT1(),
.CLKOUT2(),
.CLKOUT3(),
.CLKOUT4(),
.CLKOUT5(),
.LOCKED(pll0_lckd),
.CLKFBIN(pll0_clkfb),
.CLKIN(dcm0_clkfx),
.RST(~dcm0_lckd)
);
It worked but with a lot of phase noise according to my RTL-SDR. (RTL-SDR connected via a 100k resistor as an attenuator.)
The clocking wizard suggests this:
PLL_BASE # (
.BANDWIDTH("HIGH"),
.CLKIN_PERIOD(8),
.CLKFBOUT_MULT(23),
.CLKOUT0_DIVIDE(26),
.COMPENSATION("INTERNAL"),
.DIVCLK_DIVIDE(3)
) PLL0 (
.CLKFBOUT(pll0_clkfb),
.CLKOUT0(sys_clk_36p8),
.CLKOUT1(),
.CLKOUT2(),
.CLKOUT3(),
.CLKOUT4(),
.CLKOUT5(),
.LOCKED(pll0_lckd),
.CLKFBIN(pll0_clkfb),
.CLKIN(osc_clk),
.RST(1'b0)
);
Much less phase noise, but the frequency is not exact.
Am I correct that the DCM is inherently noisy or did I have it configured to use spread spectrum by mistake? Is there any way to get an exact 36.864MHz clock (to within the frequency accuracy as the 125MHz master clock) and have low phase noise using only the clocking resources on the FPGA?