From d9ce0f12ffeeb1896dec4e9e2003ce791a0775dd Mon Sep 17 00:00:00 2001 From: Daniel Mazurkiewicz Date: Sat, 8 Feb 2020 14:06:35 +0100 Subject: [PATCH 1/5] updated pin description for MKS BASE V1.6 --- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 45 +++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 1cf2345e051c..59277e913592 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -31,13 +31,12 @@ #define BOARD_INFO_NAME "MKS BASE 1.6" -#include "pins_MKS_BASE.h" /** * Microstepping pins */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 / SERVO2_PIN -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 / SERVO1_PIN +#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 +#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 #define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 #define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 #define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 @@ -45,4 +44,42 @@ #define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 #define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 #define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 / SERVO3_PIN +#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 + + +/** + * Servos pins + */ +#define SERVO1_PIN 12 // Digital 12 / Pin 25 + + +/** + * Heaters / Fans + */ +#define MOSFET_D_PIN 7 + + +/** + * RAMPS pins that are not available on board + */ +#ifndef SERVO2_PIN + #define SERVO2_PIN -1 +#endif +#ifndef SERVO3_PIN + #define SERVO3_PIN -1 +#endif + +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN -1 +#endif + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN -1 +#endif + +#ifndef PS_ON_PIN + #define PS_ON_PIN -1 +#endif + + +#include "pins_RAMPS.h" \ No newline at end of file From ac6e1b2a119c6317bb9133d44898a52f055b1c88 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 8 Feb 2020 17:55:05 -0600 Subject: [PATCH 2/5] Update pins_MKS_BASE_16.h --- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 74 +++++++++++------------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 59277e913592..03addbf56152 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -31,55 +31,47 @@ #define BOARD_INFO_NAME "MKS BASE 1.6" - -/** - * Microstepping pins - */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 - - -/** - * Servos pins - */ -#define SERVO1_PIN 12 // Digital 12 / Pin 25 - - -/** - * Heaters / Fans - */ -#define MOSFET_D_PIN 7 - - -/** - * RAMPS pins that are not available on board - */ +// +// Servos +// +#define SERVO1_PIN 12 // Digital 12 / Pin 25 + +// +// Steppers Microstepping +// +#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 +#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 +#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 +#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 +#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 +#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 +#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 +#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 +#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 +#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 + +// +// Heaters / Fans +// +#define MOSFET_D_PIN 7 + +// +// Omitted RAMPS pins +// #ifndef SERVO2_PIN - #define SERVO2_PIN -1 + #define SERVO2_PIN -1 #endif #ifndef SERVO3_PIN - #define SERVO3_PIN -1 + #define SERVO3_PIN -1 #endif - #ifndef FILWIDTH_PIN - #define FILWIDTH_PIN -1 + #define FILWIDTH_PIN -1 #endif - #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN -1 + #define FIL_RUNOUT_PIN -1 #endif - #ifndef PS_ON_PIN - #define PS_ON_PIN -1 + #define PS_ON_PIN -1 #endif - -#include "pins_RAMPS.h" \ No newline at end of file +#include "pins_RAMPS.h" From 9b9b000e18094821c14b31ff75172cc48d0df070 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Feb 2020 10:08:49 -0600 Subject: [PATCH 3/5] Include default pins for features --- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 03addbf56152..7d1275639b5f 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -50,11 +50,6 @@ #define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 #define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 -// -// Heaters / Fans -// -#define MOSFET_D_PIN 7 - // // Omitted RAMPS pins // @@ -74,4 +69,4 @@ #define PS_ON_PIN -1 #endif -#include "pins_RAMPS.h" +#include "pins_MKS_BASE.h" From afce6157d084f11686fe68d6be93ceeb55319d87 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Feb 2020 10:54:04 -0600 Subject: [PATCH 4/5] Consolidate MKS BASE more --- Marlin/src/pins/pins.h | 2 +- .../{pins_MKS_BASE.h => pins_MKS_BASE_10.h} | 22 +----- Marlin/src/pins/ramps/pins_MKS_BASE_14.h | 43 +++-------- Marlin/src/pins/ramps/pins_MKS_BASE_15.h | 17 +---- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 17 +---- Marlin/src/pins/ramps/pins_MKS_BASE_common.h | 75 +++++++++++++++++++ 6 files changed, 94 insertions(+), 82 deletions(-) rename Marlin/src/pins/ramps/{pins_MKS_BASE.h => pins_MKS_BASE_10.h} (74%) create mode 100644 Marlin/src/pins/ramps/pins_MKS_BASE_common.h diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 35e73e9d3f35..941b21bbbf87 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -105,7 +105,7 @@ #elif MB(BAM_DICE_DUE) #include "ramps/pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_BASE) - #include "ramps/pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_MKS_BASE_10.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_BASE_14) #include "ramps/pins_MKS_BASE_14.h" // ATmega2560 env:megaatmega2560 #elif MB(MKS_BASE_15) diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h similarity index 74% rename from Marlin/src/pins/ramps/pins_MKS_BASE.h rename to Marlin/src/pins/ramps/pins_MKS_BASE_10.h index 72e062e635ea..b1010482c168 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h @@ -31,23 +31,7 @@ #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "MKS BASE 1.0" -#endif - -// -// Heaters / Fans -// -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 - -#define CASE_LIGHT_PIN 2 - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // Hardware PWM -#define SPINDLE_LASER_ENA_PIN 15 // Pullup! -#define SPINDLE_DIR_PIN 19 +#define BOARD_INFO_NAME "MKS BASE 1.0" +#define MKS_BASE_VERSION 10 -#include "pins_RAMPS.h" +#include "pins_MKS_BASE_common.h" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h index a4fe6f90c12a..b1564ea2c326 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h @@ -30,52 +30,31 @@ #endif #define BOARD_INFO_NAME "MKS BASE 1.4" +#define MKS_BASE_VERSION 14 // // Heaters / Fans // -#define MOSFET_D_PIN 7 // PH4 ** Pin16 ** PWM7 //E1 -#define FAN_PIN 9 // PH6 ** Pin18 ** PWM9 +#define FAN_PIN 9 // PH6 ** Pin18 ** PWM9 // Other Mods -#define CASE_LIGHT_PIN 11 // PB5 ** Pin24 ** PWM11 -#define SERVO3_PIN 12 // PB6 ** Pin25 ** D12 -#define PS_ON_PIN 2 // X+ // PE4 ** Pin6 ** PWM2 **MUST BE HARDWARE PWM -#define FILWIDTH_PIN 15 // Y+ // PJ0 ** Pin63 ** USART3_RX **Pin should have a pullup! -#define FIL_RUNOUT_PIN 19 // Z+ // PD2 ** Pin45 ** USART1_RX - -// -// M3/M4/M5 - Spindle/Laser Control -// -#define SPINDLE_LASER_PWM_PIN 2 // X+ // PE4 ** Pin6 ** PWM2 **MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 15 // Y+ // PJ0 ** Pin63 ** USART3_RX **Pin should have a pullup! -#define SPINDLE_DIR_PIN 19 // Z+ // PD2 ** Pin45 ** USART1_RX - -// -// Microstepping pins -// -#define X_MS1_PIN 5 // PE3 ** Pin5 ** PWM5 -#define X_MS2_PIN 6 // PH3 ** Pin15 ** PWM6 -#define Y_MS1_PIN 59 // PF5 ** Pin92 ** A5 -#define Y_MS2_PIN 58 // PF4 ** Pin93 ** A4 -#define Z_MS1_PIN 22 // PA0 ** Pin78 ** D22 -#define Z_MS2_PIN 39 // PG2 ** Pin70 ** D39 -#define E0_MS1_PIN 64 // PK2 ** Pin87 ** A10 -#define E0_MS2_PIN 63 // PK1 ** Pin88 ** A9 -#define E1_MS1_PIN 57 // PF3 ** Pin94 ** A3 -#define E1_MS2_PIN 4 // PG5 ** Pin1 ** PWM4 +#define CASE_LIGHT_PIN 11 // PB5 ** Pin24 ** PWM11 +#define SERVO3_PIN 12 // PB6 ** Pin25 ** D12 +#define PS_ON_PIN 2 // X+ // PE4 ** Pin6 ** PWM2 **MUST BE HARDWARE PWM +#define FILWIDTH_PIN 15 // Y+ // PJ0 ** Pin63 ** USART3_RX **Pin should have a pullup! +#define FIL_RUNOUT_PIN 19 // Z+ // PD2 ** Pin45 ** USART1_RX #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 + #define RGB_LED_R_PIN 50 #endif #ifndef RGB_LED_R_PIN - #define RGB_LED_G_PIN 51 + #define RGB_LED_G_PIN 51 #endif #ifndef RGB_LED_R_PIN - #define RGB_LED_B_PIN 52 + #define RGB_LED_B_PIN 52 #endif -#include "pins_RAMPS.h" +#include "pins_MKS_BASE_common.h" /* Available connectors on MKS BASE v1.4 diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h index efb7bb23eb1a..683c6b7d0ee9 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h @@ -30,19 +30,6 @@ #endif #define BOARD_INFO_NAME "MKS BASE 1.5" +#define MKS_BASE_VERSION 15 -#include "pins_MKS_BASE.h" - -/** - * Microstepping pins - */ -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 / SERVO2_PIN -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 / SERVO1_PIN -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 / SERVO3_PIN +#include "pins_MKS_BASE_common.h" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index 7d1275639b5f..985aa056b81a 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -30,26 +30,13 @@ #endif #define BOARD_INFO_NAME "MKS BASE 1.6" +#define MKS_BASE_VERSION 16 // // Servos // #define SERVO1_PIN 12 // Digital 12 / Pin 25 -// -// Steppers Microstepping -// -#define X_MS1_PIN 5 // Digital 3 / Pin 5 / PE3 -#define X_MS2_PIN 6 // Digital 6 / Pin 14 / PH3 -#define Y_MS1_PIN 59 // Analog 5 / Pin 92 / PF5 -#define Y_MS2_PIN 58 // Analog 4 / Pin 93 / PF4 -#define Z_MS1_PIN 22 // Digital 22 / Pin 78 / PA0 -#define Z_MS2_PIN 39 // Digital 39 / Pin 70 / PG2 -#define E0_MS1_PIN 63 // Analog 9 / Pin 86 / PK1 -#define E0_MS2_PIN 64 // Analog 10 / Pin 87 / PK2 -#define E1_MS1_PIN 57 // Analog 3 / Pin 93 / PF3 -#define E1_MS2_PIN 4 // Digital 4 / Pin 1 / PG5 - // // Omitted RAMPS pins // @@ -69,4 +56,4 @@ #define PS_ON_PIN -1 #endif -#include "pins_MKS_BASE.h" +#include "pins_MKS_BASE_common.h" diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h new file mode 100644 index 000000000000..9e2916c8e972 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h @@ -0,0 +1,75 @@ +/** + * 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 + +/** + * MKS BASE – Arduino Mega2560 with RAMPS pin assignments + */ + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS BASE" +#endif + +#if MKS_BASE_VERSION == 14 || MKS_BASE_VERSION == 15 + // + // Heaters / Fans + // + // Power outputs EFBF or EFBE + #define MOSFET_D_PIN 7 + + // + // M3/M4/M5 - Spindle/Laser Control + // + #if HAS_CUTTER + #define SPINDLE_LASER_PWM_PIN 2 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 15 // Pullup! + #define SPINDLE_DIR_PIN 19 + #endif + + #ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 2 + #endif + +#endif + +// +// Microstepping pins +// +#if MKS_BASE_VERSION >= 14 // |===== 1.4 =====|===== 1.5+ =====| + #define X_MS1_PIN 5 // PE3 | Pin 5 | PWM5 | | D3 | SERVO2_PIN + #define X_MS2_PIN 6 // PH3 | Pin 15 | PWM6 | Pin 14 | D6 | SERVO1_PIN + #define Y_MS1_PIN 59 // PF5 | Pin 92 | A5 | | | + #define Y_MS2_PIN 58 // PF4 | Pin 93 | A4 | | | + #define Z_MS1_PIN 22 // PA0 | Pin 78 | D22 | | | + #define Z_MS2_PIN 39 // PG2 | Pin 70 | D39 | | | + #if MKS_BASE_VERSION == 14 + #define E0_MS1_PIN 64 // PK2 | Pin 87 | A10 | | | + #define E0_MS2_PIN 63 // PK1 | Pin 88 | A9 | | | + #else + #define E0_MS1_PIN 63 // PK1 | | | Pin 86 | A9 | + #define E0_MS2_PIN 64 // PK2 | | | Pin 87 | A10 | + #endif + #define E1_MS1_PIN 57 // PF3 | Pin 94 | A3 | Pin 93 | A3 | + #define E1_MS2_PIN 4 // PG5 | Pin 1 | PWM4 | | D4 | SERVO3_PIN +#endif + +#include "pins_RAMPS.h" From 155c4620d42a08d00ddb1243b76c95646a08c067 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Feb 2020 12:10:11 -0600 Subject: [PATCH 5/5] Update pins_MKS_BASE_common.h --- Marlin/src/pins/ramps/pins_MKS_BASE_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h index 9e2916c8e972..0406da560503 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h @@ -34,7 +34,7 @@ // Heaters / Fans // // Power outputs EFBF or EFBE - #define MOSFET_D_PIN 7 + #define MOSFET_D_PIN 7 // // M3/M4/M5 - Spindle/Laser Control @@ -46,7 +46,7 @@ #endif #ifndef CASE_LIGHT_PIN - #define CASE_LIGHT_PIN 2 + #define CASE_LIGHT_PIN 2 #endif #endif