From 3d8491af710310e353572242f61e32b0dfb80e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Str=C3=B6mbergson?= Date: Wed, 10 Jul 2024 13:25:13 +0200 Subject: [PATCH] FPGA: Move sample point to not miss MISO lsb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joachim Strömbergson --- hw/application_fpga/core/tk1/rtl/tk1_spi_master.v | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/application_fpga/core/tk1/rtl/tk1_spi_master.v b/hw/application_fpga/core/tk1/rtl/tk1_spi_master.v index 17b27eb..64971b7 100644 --- a/hw/application_fpga/core/tk1/rtl/tk1_spi_master.v +++ b/hw/application_fpga/core/tk1/rtl/tk1_spi_master.v @@ -229,7 +229,6 @@ module tk1_spi_master( spi_ctrl_new = CTRL_IDLE; spi_ctrl_we = 1'h0; - case (spi_ctrl_reg) CTRL_IDLE: begin if (spi_start) begin @@ -244,14 +243,14 @@ module tk1_spi_master( end CTRL_POS_FLANK: begin - spi_rx_data_nxt = 1'h1; spi_csk_new = 1'h1; spi_csk_we = 1'h1; - spi_ctrl_new = CTRL_NEG_FLANK; - spi_ctrl_we = 1'h1; + spi_ctrl_new = CTRL_NEG_FLANK; + spi_ctrl_we = 1'h1; end CTRL_NEG_FLANK: begin + spi_tx_data_nxt = 1'h1; spi_csk_new = 1'h0; spi_csk_we = 1'h1; spi_ctrl_new = CTRL_NEXT; @@ -259,6 +258,7 @@ module tk1_spi_master( end CTRL_NEXT: begin + spi_rx_data_nxt = 1'h1; if (spi_bit_ctr_reg == 3'h7) begin spi_ready_new = 1'h1; spi_ready_we = 1'h1; @@ -266,7 +266,6 @@ module tk1_spi_master( spi_ctrl_we = 1'h1; end else begin - spi_tx_data_nxt = 1'h1; spi_bit_ctr_inc = 1'h1; spi_ctrl_new = CTRL_POS_FLANK; spi_ctrl_we = 1'h1;