Reset rx_data register when SPI is not enabled

Signed-off-by: Joachim Strömbergson <joachim@assured.se>
This commit is contained in:
Joachim Strömbergson 2023-07-04 09:17:37 +02:00
parent b3781390fe
commit fef40a9ca1
No known key found for this signature in database
GPG Key ID: 865B8A548EA61679

View File

@ -226,7 +226,12 @@ module tk1_spi_master(
spi_rx_data_new = 8'h0;
spi_rx_data_we = 1'h0;
if (spi_rx_data_nxt) begin
if (spi_ss) begin
spi_rx_data_new = 8'h0;
spi_rx_data_we = 1'h1;
end
else if (spi_rx_data_nxt) begin
spi_rx_data_new = {spi_rx_data_reg[6 : 0], spi_miso_sample1_reg};
spi_rx_data_we = 1'h1;
end