VHDL High Impediance
So I have a follow up question... I have some VHDL code with a couple of pins that are shared with a uC. I set the pins to in std_logic and they work as inputs but they seem to drive the uC pins. When the CPLD chip is blank the uC inputs work fine... huh...
entity msac002_lcd is
Port ( osc: in std_logic;
button1 : in std_logic;
button2 : in std_logic;
led0 : out std_logic;
led1 : out std_logic;
spi_cs : in std_logic;
spi_sclk : in std_logic;
spi_mosi : in std_logic;
lcd_register : out std_logic_vector(23 downto 0));
end msac002_lcd;
architecture Behavioral of msac002_lcd is
signal clkdiv : std_logic_vector(10 downto 0);
signal display_reg : std_logic_vector(23 downto 0);
--component spi_24bit_data_in
-- Port ( cs_cpld, sclk, mosi : in std_logic;
-- display_reg : inout std_logic_vector(23 downto 0)
-- );
--end component;
begin
-- Divide the master clock (1.832Mhz) down to a lower frequency,
-- and drive xc2led with a slower clock signal from the counter.
-- The xc2btn resets the counter; when pressed, the LED is off.
-- This clock divider and xc2btn assignment are all that is needed
-- for a basic XC2 board check.
process (osc, button1) begin
if button1 = '1' then
clkdiv <= "00000000000";
elsif osc = '1' and osc'Event then
clkdiv <= clkdiv + 1;
end if;
end process;
led0 <= not clkdiv(10);
led1 <= button2;
--SPI: spi_24bit_data_in
-- port map ( spi_cs, spi_sclk, spi_mosi, display_reg(23 downto 0));
--shift mosi in to display_reg
process (spi_sclk, spi_cs) begin
if spi_cs = '0' then
if spi_sclk = '1' and spi_sclk'Event then
display_reg <= display_reg(22 downto 0) & spi_mosi; --shift left
end if;
else
lcd_register(23 downto 0) <= display_reg(23 downto 0);
end if;
end process;
end Behavioral;
Jacob