Advertisement
solegstar

Sd card decoder

Dec 8th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.96 KB | Source Code | 0 0
  1. -- Z-controller spi
  2. zc_spi_start <= '1' when cpu_a_bus(7 downto 0)=X"57" and cpu_iorq_n='0' and cpu_m1_n='1' and loader_act='0' and is_flash_not_sd='0' else '0';
  3. zc_wr_en <= '1' when cpu_a_bus(7 downto 0)=X"57" and cpu_iorq_n='0' and cpu_m1_n='1' and cpu_wr_n='0' and loader_act='0' and is_flash_not_sd='0' else '0';
  4. port77_wr <= '1' when cpu_a_bus(7 downto 0)=X"77" and cpu_iorq_n='0' and cpu_m1_n='1' and cpu_wr_n='0' and loader_act='0' and is_flash_not_sd='0' else '0';
  5.  
  6. process (port77_wr, loader_act, reset, clk_bus)
  7.     begin
  8.         if loader_act='1' or reset='1' then
  9.             zc_cs_n <= '1';
  10.         elsif clk_bus'event and clk_bus='1' then
  11.             if port77_wr='1' then
  12.                 zc_cs_n <= cpu_do_bus(1);
  13.             end if;
  14.         end if;
  15. end process;
  16.  
  17. U_ZC_SPI: entity work.zc_spi     -- SD
  18. port map(
  19.     DI              => cpu_do_bus,
  20.     START           => zc_spi_start,
  21.     WR_EN           => zc_wr_en,
  22.     CLC             => clk_bus, --clk_cpu,
  23.     MISO            => DATA0,
  24.     DO              => zc_do_bus,
  25.     SCK             => zc_sclk,
  26.     MOSI            => zc_mosi
  27. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement