ChristofAbt
New Contributor
5 days agoShift Register triggers occassionally on both clock edges
Good morning community, in my project a MAX10 M08 FPGA serves as an interface between a microcontroller and an ADC board with 32 channels. In order to parallelize the serial data from the board I developed a shift register. This register shall only read the first 512 bits of a data stream. Therefore a counter is included.
-- serial-parallel converter synchronous to falling edge of DCLK
p_ser_par_dclk : process (DCLK,nRES) is
begin
if (nRES = '0') then
dout0_shr_dclk <= (others => '0');
dout1_shr_dclk <= (others => '0');
mod1023_count_i <= 0;
elsif (falling_edge(DCLK)) then
-- resets counter when nDRDY active
if (nDRDY = '1') then
mod1023_count_i <= 0;
elsif (mod1023_count_i < 512) then
mod1023_count_i <= mod1023_count_i + 1;
end if;
-- counter masks the 512 DCLK clock edges without data
if (mod1023_count_i < 512) then
-- shift-registers, alert bit, address bits, CRC bits shifted, maybe later omitted
dout0_shr_dclk(0) <= DOUT0;
dout1_shr_dclk(0) <= DOUT1;
dout0_shr_dclk((snr_length - 1) downto 1) <= dout0_shr_dclk((snr_length - 2) downto 0);
dout1_shr_dclk((snr_length - 1) downto 1) <= dout1_shr_dclk((snr_length - 2) downto 0);
-- no shifting
else
dout1_shr_dclk <= dout1_shr_dclk;
dout0_shr_dclk <= dout0_shr_dclk;
end if;
end if;
end process p_ser_par_dclk;
The data from the AD converters contains the channel number. Therefore there must be regular data patterns in the 512 bit wide vector when a complete set of 16*32bit have been written into the FIFO. I could never see this pattern when I visualized the internal data with the signal tap analyzer. What I can occassionally see is that the shift registers and the counter triggers at the wrong edge. This is a severe error. What could be the reason?
Best regards
Christof Abt