From 5c133b4ac98250878c6c167bd641084d24547211 Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Tue, 12 Jan 2021 13:05:49 -0500 Subject: [PATCH] [PSX] Fix original PSX TXD timing For some reason the standard SPI Mode 3 timing for ESP32 didn't work with the original PSX models. Tested to work on SCPH-5501, SCPH-101, SCPH-30001 & SCPH-90001. --- main/wired/ps_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/wired/ps_spi.c b/main/wired/ps_spi.c index 4043d7dd..f5c7ad13 100644 --- a/main/wired/ps_spi.c +++ b/main/wired/ps_spi.c @@ -669,9 +669,9 @@ void ps_spi_init(void) { spi_hw->ctrl.wr_bit_order = 1; spi_hw->ctrl.rd_bit_order = 1; - /* Set be Mode 3, unlike sniffer! */ + /* Set Mode 3 as per ESP32 TRM, except ck_i_edge that need to be 1 for original PSX! */ spi_hw->pin.ck_idle_edge = 0; - spi_hw->user.ck_i_edge = 0; + spi_hw->user.ck_i_edge = 1; spi_hw->ctrl2.miso_delay_mode = 1; spi_hw->ctrl2.miso_delay_num = 0; spi_hw->ctrl2.mosi_delay_mode = 0;