A
alan
Guest
Hello all,
I'm constructing an FPGA-based system to perform a serial transmission
test on an IC, and currently one problem I have with the prototype is
noise (because I didn't have the foresight to consider proper
layout). There's a bit of design tradeoff between noise on the FPGA-
to-IC path and the IC-to-FPGA path, so I chose to put the noise more
on the IC-to-FPGA path on the logic that I could probably add
something to filter out the noise coming into the FPGA but not on the
IC.
Currently my design is to transmit at the required frequency (about
20MHz max), but receive at the FPGA system clock frequency, 100MHz, so
that I can add some noise filtering on the FPGA receiver. So far the
best noise filter I've thought of is a best-of-three filter:
module filter3(
input in,
output out,
input clk,
input reset_n
);
reg [1:0] r;
always @(posedge clk, negedge reset_n) if(!reset_n) r <= 0; else begin
r <= {r[0], in}; end
wire filtered =
(in && r[0]) ||
(r[0] && r[1]) ||
(in && r[1]);
reg d_filtered;
always @(posedge clk, negedge reset_n) if(!reset_n) d_filtered <= 0;
else begin
d_filtered <= filtered; end
assign out = d_filtered;
endmodule
Because I fully expect delays on the FPGA-to-IC and IC-to-FPGA paths
(to be specific, level shifters on both paths) I decided to also
include the serial clock signal in the FPGA's inputs from the test IC
(also following the same delay paths), so I expect the serial clock
input to be in-phase with the serial data input; the receiver and the
transmitter thus have "independent" clocks.
The problem I'm facing with a best-of-three filter is that with the
clock signal just 1/5th the system clock, the sampled clock may very
well be something like:
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
Assuming a noise-free system the best-of-three filter will simply add
two system clock cycles delay (which is okay since the serial clock of
the receiver and transmitter are independent). However if noise flips
one of the "1" bits the best-of-three filter will simply skip an
entire serial clock cycle.
I'm currently wondering if some algorithm, say a DPLL, may be more
useful for clock recovery (with the caveat that the first clock pulse
clocks in the first data bit, so I need something that can recover at
the first clock.)
I'm constructing an FPGA-based system to perform a serial transmission
test on an IC, and currently one problem I have with the prototype is
noise (because I didn't have the foresight to consider proper
layout). There's a bit of design tradeoff between noise on the FPGA-
to-IC path and the IC-to-FPGA path, so I chose to put the noise more
on the IC-to-FPGA path on the logic that I could probably add
something to filter out the noise coming into the FPGA but not on the
IC.
Currently my design is to transmit at the required frequency (about
20MHz max), but receive at the FPGA system clock frequency, 100MHz, so
that I can add some noise filtering on the FPGA receiver. So far the
best noise filter I've thought of is a best-of-three filter:
module filter3(
input in,
output out,
input clk,
input reset_n
);
reg [1:0] r;
always @(posedge clk, negedge reset_n) if(!reset_n) r <= 0; else begin
r <= {r[0], in}; end
wire filtered =
(in && r[0]) ||
(r[0] && r[1]) ||
(in && r[1]);
reg d_filtered;
always @(posedge clk, negedge reset_n) if(!reset_n) d_filtered <= 0;
else begin
d_filtered <= filtered; end
assign out = d_filtered;
endmodule
Because I fully expect delays on the FPGA-to-IC and IC-to-FPGA paths
(to be specific, level shifters on both paths) I decided to also
include the serial clock signal in the FPGA's inputs from the test IC
(also following the same delay paths), so I expect the serial clock
input to be in-phase with the serial data input; the receiver and the
transmitter thus have "independent" clocks.
The problem I'm facing with a best-of-three filter is that with the
clock signal just 1/5th the system clock, the sampled clock may very
well be something like:
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
Assuming a noise-free system the best-of-three filter will simply add
two system clock cycles delay (which is okay since the serial clock of
the receiver and transmitter are independent). However if noise flips
one of the "1" bits the best-of-three filter will simply skip an
entire serial clock cycle.
I'm currently wondering if some algorithm, say a DPLL, may be more
useful for clock recovery (with the caveat that the first clock pulse
clocks in the first data bit, so I need something that can recover at
the first clock.)