From 1e20dba10ad112f2e8f84d2270f50c3fcf11a3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=85gren?= Date: Fri, 9 May 2025 17:29:52 +0200 Subject: [PATCH] fpga/ch552: Swap fpga_cts and ch552_cts pins The FPGA uwg30 package cannot use B3 as an input when an instance of SB_PLL40_CORE is placed. We swap fpga_cts and ch552_cts to make B3 (from here on fpga_cts) an output. For more info check out: FPGA-TN-02052-1-4-iCE40-sysCLOCK-PLL-Design-User-Guide.pdf chapter "5.1 PLL Placement Rules" --- hw/application_fpga/data/application_fpga_tk1.pcf | 4 ++-- hw/application_fpga/data/application_fpga_tk1_uwg30.pcf | 4 ++-- hw/usb_interface/ch552_fw/inc/gpio.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/application_fpga/data/application_fpga_tk1.pcf b/hw/application_fpga/data/application_fpga_tk1.pcf index efc5387..6bbb811 100644 --- a/hw/application_fpga/data/application_fpga_tk1.pcf +++ b/hw/application_fpga/data/application_fpga_tk1.pcf @@ -14,8 +14,8 @@ # UART. set_io interface_rx 26 set_io interface_tx 25 -set_io interface_ch552_cts 27 -set_io interface_fpga_cts 28 +set_io interface_ch552_cts 28 +set_io interface_fpga_cts 27 # SPI master to flash memory. diff --git a/hw/application_fpga/data/application_fpga_tk1_uwg30.pcf b/hw/application_fpga/data/application_fpga_tk1_uwg30.pcf index 4163fa3..de8c4a5 100644 --- a/hw/application_fpga/data/application_fpga_tk1_uwg30.pcf +++ b/hw/application_fpga/data/application_fpga_tk1_uwg30.pcf @@ -15,8 +15,8 @@ # UART. set_io interface_rx A2 set_io interface_tx A1 -set_io interface_ch552_cts B3 -set_io interface_fpga_cts A4 +set_io interface_ch552_cts A4 +set_io interface_fpga_cts B3 # SPI master to flash memory. diff --git a/hw/usb_interface/ch552_fw/inc/gpio.h b/hw/usb_interface/ch552_fw/inc/gpio.h index 1c710ea..e382570 100644 --- a/hw/usb_interface/ch552_fw/inc/gpio.h +++ b/hw/usb_interface/ch552_fw/inc/gpio.h @@ -9,8 +9,8 @@ #define PIN_P1_4 0x10 #define PIN_P1_5 0x20 -#define PIN_FPGA_CTS PIN_P1_4 -#define PIN_CH552_CTS PIN_P1_5 +#define PIN_FPGA_CTS PIN_P1_5 +#define PIN_CH552_CTS PIN_P1_4 void gpio_set(uint8_t pin); void gpio_unset(uint8_t pin);