From 82c21461c410388a24474a4abf7d310d3ab3efa1 Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Wed, 10 Apr 2024 19:38:31 -0400 Subject: [PATCH 1/2] Allows RAMPS to auto assign HW SPI Pins for TMC --- Marlin/src/pins/ramps/pins_RAMPS.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 0195f3a1bc9a..b0074dc7858d 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -320,17 +320,29 @@ #endif // -// TMC software SPI +// TMC SPI // #if HAS_TMC_SPI - #ifndef TMC_SPI_MOSI - #define TMC_SPI_MOSI AUX2_09 - #endif - #ifndef TMC_SPI_MISO - #define TMC_SPI_MISO AUX2_07 - #endif - #ifndef TMC_SPI_SCK - #define TMC_SPI_SCK AUX2_05 + #if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SPI_MOSI + #define TMC_SPI_MOSI AUX2_09 + #endif + #ifndef TMC_SPI_MISO + #define TMC_SPI_MISO AUX2_07 + #endif + #ifndef TMC_SPI_SCK + #define TMC_SPI_SCK AUX2_05 + #endif + #else + #ifndef TMC_SPI_MOSI + #define TMC_SPI_MOSI AUX3_03 + #endif + #ifndef TMC_SPI_MISO + #define TMC_SPI_MISO AUX3_04 + #endif + #ifndef TMC_SPI_SCK + #define TMC_SPI_SCK AUX3_05 + #endif #endif #endif From 2af4a5dd93d0b04453074d4392b0efdae386f48a Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Wed, 10 Apr 2024 21:19:44 -0400 Subject: [PATCH 2/2] Update pins_RAMPS.h --- Marlin/src/pins/ramps/pins_RAMPS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index b0074dc7858d..0e6e33e18e88 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -335,10 +335,10 @@ #endif #else #ifndef TMC_SPI_MOSI - #define TMC_SPI_MOSI AUX3_03 + #define TMC_SPI_MOSI AUX3_04 #endif #ifndef TMC_SPI_MISO - #define TMC_SPI_MISO AUX3_04 + #define TMC_SPI_MISO AUX3_03 #endif #ifndef TMC_SPI_SCK #define TMC_SPI_SCK AUX3_05