TommiRouvali
Junior Member level 1
Hi,
I am trying to make IO extension board for microcontroller. Any port of XC95108 can be input or output. I had some issues getting design to fit inside XC95108 and so finally ended up design below. Pins work outputs as planned, but they don't seem to go Hi Z mode. Is it valid to scolling 'Z' in std_logic_vector like I do?
I am trying to make IO extension board for microcontroller. Any port of XC95108 can be input or output. I had some issues getting design to fit inside XC95108 and so finally ended up design below. Pins work outputs as planned, but they don't seem to go Hi Z mode. Is it valid to scolling 'Z' in std_logic_vector like I do?
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity main is Port ( DIN : in STD_LOGIC; CLK : in STD_LOGIC; WRD : in STD_LOGIC; RDD : in STD_LOGIC; TRIS : in STD_LOGIC; DOUT : out STD_LOGIC; PORTS : inout std_logic_vector(57 downto 0)); end main; architecture Behavioral of main is signal InData : std_logic_vector(51 downto 0); begin process (CLK) begin if (CLK='1' and CLK'EVENT) then if (RDD='1') then InData(51 downto 0)<=PORTS(51 downto 0); else if(TRIS='1') then InData(51 downto 0)<=InData(50 downto 0) & 'Z'; else InData(51 downto 0)<=InData(50 downto 0) & DIN; end if; DOUT<=InData(51); end if; end if; end process; process (WRD) begin if (WRD='1' and WRD'EVENT) then PORTS(51 downto 0)<=InData(51 downto 0); end if; end process; end Behavioral;
Last edited by a moderator: