From f02d21900572e1e61733564b3c4db29bc765d116 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:32:15 +0000 Subject: [PATCH 01/10] Add Dagoma D6 board as used in their DiscoUltimate v2 TMC. Taken from the Dagoma fork of Marlin DU_MC branch where it is called FYSETC_DAGOMA_F5 and explicitly confirmed by Dagoma as being the D6: "the BOARD_FYSETC_DAGOMA_F5 is effectively the definition for the D6" --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 82 ++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 Marlin/src/pins/ramps/pins_DAGOMA_D6.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 1dfcabdefb86..dbdcbe8b569f 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -131,6 +131,7 @@ #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 #define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) #define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus) +#define BOARD_DAGOMA_D6 1167 // Dagoma D6 // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 53d31c016819..280314f30855 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -224,6 +224,8 @@ #include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 +#elif MB(DAGOMA_D6) + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560 #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h new file mode 100644 index 000000000000..ab4ce3d1eaef --- /dev/null +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -0,0 +1,82 @@ +/** + * 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 + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Dagoma3D D6 supports only 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Dagoma3D D6" + +// +// Endstops +// +#define X_STOP_PIN 2 +#define Y_STOP_PIN 3 +#define Z_STOP_PIN 15 + +#define FIL_RUNOUT_PIN 39 +#if EXTRUDERS > 1 + #define FIL_RUNOUT2_PIN 14 +#endif + +// Alter timing for graphical display +#if IS_U8GLIB_ST7920 + #define BOARD_ST7920_DELAY_1 0 + #define BOARD_ST7920_DELAY_2 250 + #define BOARD_ST7920_DELAY_3 250 +#endif + +#define KILL_PIN -1 // NC + +#define LCD_CONTRAST_DEFAULT 255 + +// +// Sensorless homing DIAG pin is not directly connected to the MCU. Close +// the jumper next to the limit switch socket when using sensorless homing. +// +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + */ + #define X_SERIAL_RX_PIN 73 + #define X_SERIAL_TX_PIN 73 + #define Y_SERIAL_RX_PIN 73 + #define Y_SERIAL_TX_PIN 73 + #define Z_SERIAL_RX_PIN 73 + #define Z_SERIAL_TX_PIN 73 + #define E0_SERIAL_RX_PIN 73 + #define E0_SERIAL_TX_PIN 73 + #define E1_SERIAL_RX_PIN 12 + #define E1_SERIAL_TX_PIN 12 + + #define X_DIAG_PIN 43 + #define Y_DIAG_PIN 41 + #define Z_DIAG_PIN 47 + #define E0_DIAG_PIN 21 + #define E1_DIAG_PIN 20 +#endif + +// +// Import default RAMPS 1.4 pins +// +#include "pins_RAMPS.h" From f1e25208dd3627acf7539b917627927b8fa2b2ad Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:41:40 +0000 Subject: [PATCH 02/10] Update pins_DAGOMA_D6.h --- Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h index ab4ce3d1eaef..451212700afc 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -22,7 +22,7 @@ #pragma once #if HOTENDS > 2 || E_STEPPERS > 2 - #error "Dagoma3D D6 supports only 2 hotends / E-steppers. Comment out this line to continue." + #error "Dagoma3D D6 supports up to 2 hotends / E-steppers." #endif #define BOARD_INFO_NAME "Dagoma3D D6" From 9365c5dc076e7528a7c167943e472ef7562c8701 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:00:58 +0000 Subject: [PATCH 03/10] Fix pins.h env for Dagoma D6 --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 280314f30855..3d1d48fa2c22 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -225,7 +225,7 @@ #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_D6) - #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560 + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) From e2ed70cff97a9d8dd745ab2ba64634a7d37d5813 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:55:01 +0100 Subject: [PATCH 04/10] Address review comments. --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 3d1d48fa2c22..cdc4fdb7a406 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -225,7 +225,7 @@ #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_D6) - #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:FYSETC_F6 + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560ext #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) From b76cee8c6aa2d2a23fd051750fe07ecfa0e468c0 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:46:53 +0100 Subject: [PATCH 05/10] Revert "Address review comments." This reverts commit e2ed70cff97a9d8dd745ab2ba64634a7d37d5813. --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index cdc4fdb7a406..3d1d48fa2c22 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -225,7 +225,7 @@ #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_D6) - #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560ext + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) From a2d86bfe6f06cbc6417b94d89e937fa6adc3886b Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:26:25 +0100 Subject: [PATCH 06/10] Define TMC slave addresses in the pins file as requested --- Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h index 451212700afc..7fa571fd0d36 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -74,6 +74,34 @@ #define Z_DIAG_PIN 47 #define E0_DIAG_PIN 21 #define E1_DIAG_PIN 20 + + // Default TMC slave addresses + #ifdef X_SLAVE_ADDRESS + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_DAGOMA_D6."); + #else + #define X_SLAVE_ADDRESS 0 + #endif + #ifdef Y_SLAVE_ADDRESS + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_DAGOMA_D6."); + #else + #define Y_SLAVE_ADDRESS 1 + #endif + #ifdef Z_SLAVE_ADDRESS + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_DAGOMA_D6."); + #else + #define Z_SLAVE_ADDRESS 2 + #endif + #ifdef E0_SLAVE_ADDRESS + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6."); + #else + #define E0_SLAVE_ADDRESS 3 + #endif + #ifdef E1_SLAVE_ADDRESS + static_assert(E1_SLAVE_ADDRESS == 3, "E1_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6."); + #else + #define E1_SLAVE_ADDRESS 3 + #endif + #endif // From 936dea211b5d8adaf410997edf9daab846a4e5d7 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:48:13 +0100 Subject: [PATCH 07/10] Reapply "env:mega2560ext" This reapplies the same fix suggested by early review comments. Thanks to @0r31 for testing this. :thumbsup: --- Marlin/src/pins/pins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 3d1d48fa2c22..cdc4fdb7a406 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -225,7 +225,7 @@ #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_D6) - #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:FYSETC_F6 + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560ext #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) From 0dabe7bb00a745ef4adb20a088f4469b8855f9f3 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:58:39 +0100 Subject: [PATCH 08/10] Address @thisiskeithb review comments --- Marlin/src/core/boards.h | 2 +- Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index dbdcbe8b569f..cef30c5cd226 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -131,7 +131,7 @@ #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 #define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) #define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus) -#define BOARD_DAGOMA_D6 1167 // Dagoma D6 +#define BOARD_DAGOMA_D6 1167 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC) // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h index 7fa571fd0d36..7180fb984289 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm @@ -21,12 +21,20 @@ */ #pragma once +#include "env_validate.h" + #if HOTENDS > 2 || E_STEPPERS > 2 #error "Dagoma3D D6 supports up to 2 hotends / E-steppers." #endif #define BOARD_INFO_NAME "Dagoma3D D6" +#define X_DIAG_PIN 43 +#define Y_DIAG_PIN 41 +#define Z_DIAG_PIN 47 +#define E0_DIAG_PIN 21 +#define E1_DIAG_PIN 20 + // // Endstops // @@ -46,7 +54,7 @@ #define BOARD_ST7920_DELAY_3 250 #endif -#define KILL_PIN -1 // NC +#define KILL_PIN -1 // NC #define LCD_CONTRAST_DEFAULT 255 @@ -69,13 +77,7 @@ #define E1_SERIAL_RX_PIN 12 #define E1_SERIAL_TX_PIN 12 - #define X_DIAG_PIN 43 - #define Y_DIAG_PIN 41 - #define Z_DIAG_PIN 47 - #define E0_DIAG_PIN 21 - #define E1_DIAG_PIN 20 - - // Default TMC slave addresses + // Default TMC slave addresses #ifdef X_SLAVE_ADDRESS static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_DAGOMA_D6."); #else From fe8053550be6f10f0f4aba94f7c19d174c6ee4e3 Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:35:26 +0100 Subject: [PATCH 09/10] Remove `#include env_validate.h` --- Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h index 7180fb984289..799c699fac66 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -21,8 +21,6 @@ */ #pragma once -#include "env_validate.h" - #if HOTENDS > 2 || E_STEPPERS > 2 #error "Dagoma3D D6 supports up to 2 hotends / E-steppers." #endif From 1e4b4765158902d5626d6c9bdd510def7061c882 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:39:00 -0700 Subject: [PATCH 10/10] Add header comments, allow pin overrides --- Marlin/src/pins/ramps/pins_DAGOMA_D6.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h index 799c699fac66..de5dbbd9bb00 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -27,6 +27,9 @@ #define BOARD_INFO_NAME "Dagoma3D D6" +// +// Trinamic Stallguard pins +// #define X_DIAG_PIN 43 #define Y_DIAG_PIN 41 #define Z_DIAG_PIN 47 @@ -40,16 +43,27 @@ #define Y_STOP_PIN 3 #define Z_STOP_PIN 15 -#define FIL_RUNOUT_PIN 39 -#if EXTRUDERS > 1 +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 39 +#endif +#if EXTRUDERS > 1 && !defined(FIL_RUNOUT2_PIN) #define FIL_RUNOUT2_PIN 14 #endif // Alter timing for graphical display #if IS_U8GLIB_ST7920 - #define BOARD_ST7920_DELAY_1 0 - #define BOARD_ST7920_DELAY_2 250 - #define BOARD_ST7920_DELAY_3 250 + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 0 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 250 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 250 + #endif #endif #define KILL_PIN -1 // NC