Ananhasaasneh77
Member level 2
hello ..
im trying to implement spi between 2 fpga boards on nexys3 the master in one fpga and the slave in another fpga and connecting the two boards by pmod connectors .. but i dont know how to set the ucf for the master and slave and how do i know that the data send from master and recived in slave?!
so can u help in the ucf for master and slave..? how can i set?! for those ports
thanks alot
im trying to implement spi between 2 fpga boards on nexys3 the master in one fpga and the slave in another fpga and connecting the two boards by pmod connectors .. but i dont know how to set the ucf for the master and slave and how do i know that the data send from master and recived in slave?!
so can u help in the ucf for master and slave..? how can i set?! for those ports
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 46 47 48 49 50 entity spi_loopback is Generic ( N : positive := 32; -- 32bit serial word length is default CPOL : std_logic := '0'; -- SPI mode selection (mode 0 default) CPHA : std_logic := '1'; -- CPOL = clock polarity, CPHA = clock phase. PREFETCH : positive := 2; -- prefetch lookahead cycles SPI_2X_CLK_DIV : positive := 5 -- for a 100MHz sclk_i, yields a 10MHz SCK ); Port( ----------------MASTER----------------------- m_clk_i : IN std_logic; m_rst_i : IN std_logic; m_spi_ssel_o : OUT std_logic; m_spi_sck_o : OUT std_logic; m_spi_mosi_o : OUT std_logic; m_spi_miso_i : IN std_logic; m_di_req_o : OUT std_logic; m_di_i : IN std_logic_vector(N-1 downto 0); m_wren_i : IN std_logic; m_do_valid_o : OUT std_logic; m_do_o : OUT std_logic_vector(N-1 downto 0); ----- debug ----- m_do_transfer_o : OUT std_logic; m_wren_o : OUT std_logic; m_wren_ack_o : OUT std_logic; m_rx_bit_reg_o : OUT std_logic; m_state_dbg_o : OUT std_logic_vector(3 downto 0); m_core_clk_o : OUT std_logic; m_core_n_clk_o : OUT std_logic; m_sh_reg_dbg_o : OUT std_logic_vector(N-1 downto 0); ----------------SLAVE----------------------- s_clk_i : IN std_logic; s_spi_ssel_i : IN std_logic; s_spi_sck_i : IN std_logic; s_spi_mosi_i : IN std_logic; s_spi_miso_o : OUT std_logic; s_di_req_o : OUT std_logic; -- preload lookahead data request line s_di_i : IN std_logic_vector (N-1 downto 0) := (others => 'X'); -- parallel load data in (clocked in on rising edge of clk_i) s_wren_i : IN std_logic := 'X'; -- user data write enable s_do_valid_o : OUT std_logic; -- do_o data valid strobe, valid during one clk_i rising edge. s_do_o : OUT std_logic_vector (N-1 downto 0); -- parallel output (clocked out on falling clk_i) ----- debug ----- s_do_transfer_o : OUT std_logic; -- debug: internal transfer driver s_wren_o : OUT std_logic; s_wren_ack_o : OUT std_logic; s_rx_bit_reg_o : OUT std_logic; s_state_dbg_o : OUT std_logic_vector (3 downto 0) -- debug: internal state register -- s_sh_reg_dbg_o : OUT std_logic_vector (N-1 downto 0) -- debug: internal shift register ); end spi_loopback;
thanks alot
Last edited by a moderator: