Forum Discussion
Altera_Forum
Honored Contributor
12 years agoActually, just tried this, since I thought it made more sense. It now compiles but it doesn't work. It's not reading the data correctly, but I believe I'm getting closer to what you mean.
Here's the code:
process (SPI_Clk) begin
if rising_edge(SPI_Clk) then
if SPI_Sel = '0' then
dff <= SPI_Data;
end if;
end if;
end process;
process (Clk, Reset, SPI_Clk) begin
if Reset = '1' then
shift_reg64 <= x"0000000000000000";
elsif rising_edge(Clk) then
shift_reg64(63 downto 0) <= shift_reg64(62 downto 0) & dff;
end if;
end process;
process (SPI_Sel) begin
if rising_edge(SPI_Sel) then
outA <= "000" & shift_reg64(60 downto 32);
outB <= "000" & shift_reg64(28 downto 0);
SEL_h <= shift_reg64(63 downto 61);--"000";
SEL_l <= shift_reg64(31 downto 29);--"000";
end if;
end process;