J
John_H
Guest
An example in Verilog:
always @(posedge Clk_36MHz)
begin // counting 0-24, inclusive
count <= count + (enable ? -5'd24 : +5'd1);
enable <= (count==5'd24);
out_clk <= enable | (count<5'd12);
if( enable )
begin
// do everything here at
// 1.44 MHz, no gated clock
end
end
A gated clock would be:
wire ClkGated = Clk36MHz | ~enable;
always @(posedge ClkGated)
begin
// do everything at 1.44 MHz with severe clock skew
end
Which - it appears you know - isn't a great way to go.
"Marco" <marcotoschi_no_spam@email.it> wrote in message
news:d6plfi$o79$1@news.ngi.it...
<snip>
always @(posedge Clk_36MHz)
begin // counting 0-24, inclusive
count <= count + (enable ? -5'd24 : +5'd1);
enable <= (count==5'd24);
out_clk <= enable | (count<5'd12);
if( enable )
begin
// do everything here at
// 1.44 MHz, no gated clock
end
end
A gated clock would be:
wire ClkGated = Clk36MHz | ~enable;
always @(posedge ClkGated)
begin
// do everything at 1.44 MHz with severe clock skew
end
Which - it appears you know - isn't a great way to go.
"Marco" <marcotoschi_no_spam@email.it> wrote in message
news:d6plfi$o79$1@news.ngi.it...
<snip>
<snip>What I could do?
<snip>Since the ratio of 1.44 MHz / 50 MHz is 18/625, you could use one DCM in
frequency synthesis mode to get an 18/25 multiplier (36 MHz). Use that
for your internal clock WITH a clock-enable for the whole thing once
every 25 cycles. Also use that clock enable to drive an IOB register
high which you then deassert 12 or 13 36 MHz clocks later for 48%/52%
duty cycle.
Clean, workable.