From 78fea4a9ca198b737e00025ff42fc2ddace38092 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Wed, 5 Feb 2020 20:28:28 -0600 Subject: [PATCH] Split up MKS_RUMBA32 into two variants (#16781) --- Marlin/src/core/boards.h | 27 ++--- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- .../{pins_BTT_SKR.h => pins_BTT_SKR_common.h} | 0 Marlin/src/pins/pins.h | 10 +- Marlin/src/pins/stm32/pins_RUMBA32_AUS3D.h | 42 +++++++ Marlin/src/pins/stm32/pins_RUMBA32_MKS.h | 109 ++++++++++++++++++ .../{pins_RUMBA32.h => pins_RUMBA32_common.h} | 41 +++++-- platformio.ini | 4 +- 10 files changed, 208 insertions(+), 31 deletions(-) rename Marlin/src/pins/lpc1768/{pins_BTT_SKR.h => pins_BTT_SKR_common.h} (100%) create mode 100644 Marlin/src/pins/stm32/pins_RUMBA32_AUS3D.h create mode 100644 Marlin/src/pins/stm32/pins_RUMBA32_MKS.h rename Marlin/src/pins/stm32/{pins_RUMBA32.h => pins_RUMBA32_common.h} (82%) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 4e6829342d..904c25d868 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -310,19 +310,20 @@ #define BOARD_BEAST 4200 // STM32F4xxVxT6 Libmaple-based STM32F4 controller #define BOARD_GENERIC_STM32F4 4201 // STM32 STM32GENERIC-based STM32F4 controller #define BOARD_ARMED 4202 // Arm'ed STM32F4-based controller -#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller -#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE -#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE -#define BOARD_STEVAL_3DP001V1 4206 // STEVAL-3DP001V1 3D PRINTER BOARD -#define BOARD_BTT_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) -#define BOARD_BTT_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE) -#define BOARD_BTT_GTR_V1_0 4209 // BigTreeTech GTR v1.0 (STM32F407IGT) -#define BOARD_LERDGE_K 4210 // Lerdge K (STM32F407ZG) -#define BOARD_LERDGE_X 4211 // Lerdge X (STM32F407VE) -#define BOARD_VAKE403D 4212 // VAkE 403D (STM32F446VET6) -#define BOARD_FYSETC_S6 4213 // FYSETC S6 board -#define BOARD_FLYF407ZG 4214 // FLYF407ZG board (STM32F407ZG) -#define BOARD_MKS_ROBIN2 4215 // MKS_ROBIN2 (STM32F407ZE) +#define BOARD_RUMBA32_AUS3D 4203 // RUMBA32 STM32F446VET6 based controller from Aus3D +#define BOARD_RUMBA32_MKS 4204 // RUMBA32 STM32F446VET6 based controller from Makerbase +#define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE +#define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE +#define BOARD_STEVAL_3DP001V1 4207 // STEVAL-3DP001V1 3D PRINTER BOARD +#define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) +#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VE) +#define BOARD_BTT_GTR_V1_0 4210 // BigTreeTech GTR v1.0 (STM32F407IGT) +#define BOARD_LERDGE_K 4211 // Lerdge K (STM32F407ZG) +#define BOARD_LERDGE_X 4212 // Lerdge X (STM32F407VE) +#define BOARD_VAKE403D 4213 // VAkE 403D (STM32F446VET6) +#define BOARD_FYSETC_S6 4214 // FYSETC S6 board +#define BOARD_FLYF407ZG 4215 // FLYF407ZG board (STM32F407ZG) +#define BOARD_MKS_ROBIN2 4216 // MKS_ROBIN2 (STM32F407ZE) // // ARM Cortex M7 diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 816dbb9dc4..15b6349409 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -230,4 +230,4 @@ #endif // Include common SKR pins -#include "pins_BTT_SKR.h" +#include "pins_BTT_SKR_common.h" diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index a3cdf1586c..d7af232427 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -369,4 +369,4 @@ */ // Include common SKR pins -#include "pins_BTT_SKR.h" +#include "pins_BTT_SKR_common.h" diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 01a8bd7e38..2bb57c09fd 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -153,7 +153,7 @@ // // Include common SKR pins // -#include "pins_BTT_SKR.h" +#include "pins_BTT_SKR_common.h" // // Software SPI pins for TMC2130 stepper drivers diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h similarity index 100% rename from Marlin/src/pins/lpc1768/pins_BTT_SKR.h rename to Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index def3e2681b..35e73e9d3f 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -528,8 +528,10 @@ #include "stm32/pins_GENERIC_STM32F4.h" // STM32F4 env:STM32F4 #elif MB(ARMED) #include "stm32/pins_ARMED.h" // STM32F4 env:ARMED -#elif MB(RUMBA32) - #include "stm32/pins_RUMBA32.h" // STM32F4 env:rumba32_f446ve env:mks_rumba32 +#elif MB(RUMBA32_AUS3D) + #include "stm32/pins_RUMBA32_AUS3D.h" // STM32F4 env:rumba32_f446ve +#elif MB(RUMBA32_MKS) + #include "stm32/pins_RUMBA32_MKS.h" // STM32F4 env:rumba32_mks #elif MB(BLACK_STM32F407VE) #include "stm32/pins_BLACK_STM32F407VE.h" // STM32F4 env:STM32F407VE_black #elif MB(STEVAL_3DP001V1) @@ -607,6 +609,7 @@ #define BOARD_BIGTREE_SKR_MINI_V1_1 -1015 #define BOARD_BIGTREE_SKR_MINI_E3 -1016 #define BOARD_BIGTREE_SKR_E3_DIP -1017 + #define BOARD_RUMBA32 -1018 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." @@ -646,6 +649,8 @@ #error "BOARD_ESP32 has been renamed BOARD_ESPRESSIF_ESP32. Please update your configuration." #elif MB(STEVAL) #error "BOARD_STEVAL has been renamed BOARD_STEVAL_3DP001V1. Please update your configuration." + #elif MB(RUMBA32) + #error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_AUS3D. Please update your configuration." #else #error "Unknown MOTHERBOARD value set in Configuration.h" #endif @@ -668,6 +673,7 @@ #undef BOARD_BIGTREE_SKR_PRO_V1_1 #undef BOARD_BIGTREE_SKR_MINI_V1_1 #undef BOARD_BIGTREE_SKR_E3_DIP + #undef BOARD_RUMBA32 #endif diff --git a/Marlin/src/pins/stm32/pins_RUMBA32_AUS3D.h b/Marlin/src/pins/stm32/pins_RUMBA32_AUS3D.h new file mode 100644 index 0000000000..cff34a2d86 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_RUMBA32_AUS3D.h @@ -0,0 +1,42 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Pin assignments for the MKS RUMBA32 + * + * https://aus3d.com.au/rumba32 + * https://github.com/Aus3D/RUMBA32 + * + * The MKS and Aus3D versions have the same pinout but the MKS version + * has some added resistors and LEDs. The resistors needed for the + * TMC2208/9 UART interface are among the additions. Also added were + * connectors and resistors dedicated to the TMC2130 sensorless homing + * interface. + */ + +#define BOARD_INFO_NAME "Aus3D RUMBA32" + +#define RUMBA32_V1_0 +//#define I2C_EEPROM + +#include "pins_RUMBA32_common.h" diff --git a/Marlin/src/pins/stm32/pins_RUMBA32_MKS.h b/Marlin/src/pins/stm32/pins_RUMBA32_MKS.h new file mode 100644 index 0000000000..8e2bb3b8af --- /dev/null +++ b/Marlin/src/pins/stm32/pins_RUMBA32_MKS.h @@ -0,0 +1,109 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Pin assignments for the MKS RUMBA32 + * + * https://github.com/makerbase-mks/MKS-RUMBA32 + * + * The MKS and Aus3D versions have the same pinout but the MKS version + * has some added resistors and LEDs. The resistors needed for the + * TMC2208/9 UART interface are among the additions. Also added were + * connectors and resistors dedicated to the TMC2130 sensorless homing + * interface. + */ + +#define BOARD_INFO_NAME "MKS RUMBA32" + +#define RUMBA32_V1_0 +#define ENABLE_SPI1 +//#define I2C_EEPROM + +#include "pins_RUMBA32_common.h" + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PA7 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PA6 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PA5 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PA3 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PA4 + #define Y_SERIAL_RX_PIN PE4 + + #define Z_SERIAL_TX_PIN PD13 + #define Z_SERIAL_RX_PIN PE0 + + #define E0_SERIAL_TX_PIN PD14 + #define E0_SERIAL_RX_PIN PC13 + + #define E1_SERIAL_TX_PIN PD15 + #define E1_SERIAL_RX_PIN PD5 + + #define E2_SERIAL_TX_PIN PD12 + #define E2_SERIAL_RX_PIN PD1 +#endif + +// +// LCD / Controller +// + +// Alter timing for graphical display +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) +#endif diff --git a/Marlin/src/pins/stm32/pins_RUMBA32.h b/Marlin/src/pins/stm32/pins_RUMBA32_common.h similarity index 82% rename from Marlin/src/pins/stm32/pins_RUMBA32.h rename to Marlin/src/pins/stm32/pins_RUMBA32_common.h index dcdbd1b40a..0fb469112d 100644 --- a/Marlin/src/pins/stm32/pins_RUMBA32.h +++ b/Marlin/src/pins/stm32/pins_RUMBA32_common.h @@ -21,17 +21,23 @@ */ #pragma once +/** + * Common pin assignments for all RUMBA32 boards + */ + #ifndef STM32F4 #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA32 supports up to 3 hotends / E-steppers." + #error "RUMBA32 boards support up to 3 hotends / E-steppers." #endif #define RUMBA32_V1_0 -#define BOARD_INFO_NAME "RUMBA32" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME //#define I2C_EEPROM +#ifdef E2END + #undef E2END +#endif #define E2END 0xFFF // 4KB // @@ -119,12 +125,25 @@ // // LCD / Controller // -#define LCD_PINS_RS PE10 -#define LCD_PINS_ENABLE PE9 -#define LCD_PINS_D4 PE12 -#define LCD_PINS_D5 PE13 -#define LCD_PINS_D6 PE14 -#define LCD_PINS_D7 PE15 -#define BTN_EN1 PB1 -#define BTN_EN2 PB2 -#define BTN_ENC PE7 +#if HAS_SPI_LCD + + #define BTN_EN1 PB2 + #define BTN_EN2 PB1 + #define BTN_ENC PE7 + + #define LCD_PINS_RS PE10 + #define LCD_PINS_ENABLE PE9 + #define LCD_PINS_D4 PE12 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS PE13 + #define DOGLCD_A0 PE14 + #endif + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE13 + #define LCD_PINS_D6 PE14 + #define LCD_PINS_D7 PE15 + #endif + +#endif diff --git a/platformio.ini b/platformio.ini index df3dcb0f66..2e57e7d773 100644 --- a/platformio.ini +++ b/platformio.ini @@ -822,9 +822,9 @@ monitor_speed = 500000 upload_protocol = dfu # -# MKS RUMBA32(add TMC2208/2209 UART interface and AUX-1) +# MKS RUMBA32 (adds TMC2208/2209 UART interface and AUX-1) # -[env:mks_rumba32] +[env:rumba32_mks] platform = ststm32 board = rumba32_f446ve build_flags = ${common.build_flags}