mmprestine
Newbie level 4
Serial Shift Register Network --> SPI Network
I am researching methods for transferring data between two different networks. As a simple test I have a MCU configured in SPI DMA 16-bit mode to transmit/receive 64 16-bit words each respectively. The following VHLD listing proves the transfer works and data is good. Now the issue, when the array data is accessed from the other network I get un expected results on the SPI side.
What are some techniques used to a shared ram variable?
Do I need to use a dual port RAM for such access?
I am researching methods for transferring data between two different networks. As a simple test I have a MCU configured in SPI DMA 16-bit mode to transmit/receive 64 16-bit words each respectively. The following VHLD listing proves the transfer works and data is good. Now the issue, when the array data is accessed from the other network I get un expected results on the SPI side.
What are some techniques used to a shared ram variable?
Do I need to use a dual port RAM for such access?
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 51 52 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use IEEE.NUMERIC_STD.ALL; entity clock is port ( SPI2_CLK : in STD_LOGIC; SPI2_MISO : out STD_LOGIC; SPI2_MOSI : in STD_LOGIC; SPI2_CS : in STD_LOGIC; ); end clock; architecture arch of clock is type sio_size is array(integer range 0 to 63) of STD_LOGIC_VECTOR(15 downto 0); signal sio_in : sio_size; signal sio_out : sio_size; signal count_spi2_bit : integer range 0 to 15 := 0; signal count_spi2_word : integer range 0 to 63 := 0; begin spi2_data: process(SPI2_CLK,SPI2_CS) begin if SPI2_CS = '1' then count_spi2_bit <= 0; count_spi2_word <= 0; elsif rising_edge(SPI2_CLK) then sio_in(count_spi2_word) <= sio_in(count_spi2_word)(14 downto 0) & '0'; sio_out(count_spi2_word) <= sio_out(count_spi2_word)(14 downto 0) & SPI2_MOSI; if count_spi2_bit = 15 then count_spi2_word <= count_spi2_word + 1; end if; count_spi2_bit <= count_spi2_bit + 1; end if; end process; SPI2_MISO <= sio_in(count_spi2_word)(15); end arch;