Altera_Forum
Honored Contributor
16 years agogating the output of a clocked register onto pins
I have a simple process in a max 2 that writes and is supposed to read a register array and put the data onto device pins- the same pins I use to write data to the register.
It is really simple: register_process: process(localclk, reset_pulse, reset_flash, Dcsn) begin if localclk'event and localclk = '1' then if Dwrn = '0' and Dcsn = '0' and Drdn = '1' then case Daddr(3 downto 0) is when "0000" => reg0 <= Data(2 downto 0); when "0010" => reg2(7 downto 0) <= Data(7 downto 0); when "0011" => reg2(15 downto 8) <= Data(7 downto 0); when "0100" => reg2(23 downto 16) <= Data(7 downto 0); when "0101" => reg3 <= Data(7 downto 0); when "0110" => reg4 <= Data(7 downto 0); when "0111" => reg5(7 downto 0) <= Data(7 downto 0); when "1000" => reg5(15 downto 8) <= Data(7 downto 0); when "1001" => reg5(23 downto 16) <= Data(7 downto 0); flash_load <= '1'; when "1010" => reg6(7 downto 0) <= Data(7 downto 0); when "1011" => reg6(15 downto 8) <= Data(7 downto 0); when "1100" => reg6(23 downto 16) <= Data(7 downto 0); pulse_flag <= '1'; when others => null; end case; elsif Drdn = '0' and Dcsn = '0' and Dwrn = '1' then case Daddr(3 downto 0) is when "0000" => Data(2 downto 0) <= reg0; when "0001" => Data(7 downto 0) <= quad_count; quad_reset <= '1'; when "0010" => Data <= reg2(7 downto 0); when "0011" => Data <= reg2(15 downto 8); when "0100" => Data <= reg2(23 downto 16); when "1101" => Data <= keys(7 downto 0); when "1110" => Data(2 downto 0) <= keys(10 downto 8); when others => null; end case; elsif reset_pulse = '1' then reg6 <= "000000000000000000000000"; elsif reset_flash = '1' then flash_load <= '0'; else Data <= "ZZZZZZZZ"; quad_reset <= '0'; end if; end if; end process register_process; The problem is that data is correctly written and I can see it on the Q pins of the ffs but I can't seem to get it back on the device pins. I know I am forgetting something and I hope someone will just put me out of my misery and tell me what it is. Thank you,