From 3462479457ef47ba21dbdcf804a7c936bfd4b718 Mon Sep 17 00:00:00 2001 From: Mateusz Faderewski Date: Tue, 23 Jan 2024 00:10:14 +0100 Subject: [PATCH] moved bit value threshold and stop bit timeout in joybus interface --- fw/rtl/n64/n64_si.sv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fw/rtl/n64/n64_si.sv b/fw/rtl/n64/n64_si.sv index 045211d..e381e8c 100644 --- a/fw/rtl/n64/n64_si.sv +++ b/fw/rtl/n64/n64_si.sv @@ -77,7 +77,7 @@ module n64_si ( // RX bit generator - logic [3:0] rx_sub_bit_counter; + logic [4:0] rx_sub_bit_counter; logic rx_timeout; logic rx_bit_valid; logic rx_bit_data; @@ -94,7 +94,7 @@ module n64_si ( always_comb begin rx_timeout = si_clk_rising_edge && si_dq_in && (&rx_sub_bit_counter); rx_bit_valid = si_dq_rising_edge; - rx_bit_data = (rx_sub_bit_counter >= 4'd3) ? 1'b0 : 1'b1; + rx_bit_data = (rx_sub_bit_counter > 5'd4) ? 1'b0 : 1'b1; end @@ -124,7 +124,7 @@ module n64_si ( logic rx_stop; always_comb begin - rx_stop = si_clk_rising_edge && si_dq_in && (rx_sub_bit_counter == 4'd7) && (rx_bit_counter == 3'd1); + rx_stop = si_clk_rising_edge && si_dq_in && (rx_sub_bit_counter == 5'd16) && (rx_bit_counter == 3'd1); end