Skip to content

Commit

Permalink
✨ BTT RAMPS 1.6+ (MarlinFirmware#25970)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and Andy-Big committed Jul 19, 2023
1 parent 6d101d9 commit c2a303b
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 19 deletions.
6 changes: 6 additions & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
#define BOARD_RAMPS_PLUS_EEF 1033 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_PLUS_SF 1034 // RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)

#define BOARD_RAMPS_BTT_16_PLUS_EFB 1035 // RAMPS 1.6+ (Power outputs: Hotend, Fan, Bed)
#define BOARD_RAMPS_BTT_16_PLUS_EEB 1036 // RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Bed)
#define BOARD_RAMPS_BTT_16_PLUS_EFF 1037 // RAMPS 1.6+ (Power outputs: Hotend, Fan0, Fan1)
#define BOARD_RAMPS_BTT_16_PLUS_EEF 1038 // RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_BTT_16_PLUS_SF 1039 // RAMPS 1.6+ (Power outputs: Spindle, Controller Fan)

//
// RAMPS Derivatives - ATmega1280, ATmega2560
//
Expand Down
44 changes: 25 additions & 19 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,28 @@

#define MAX_E_STEPPERS 8

#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB)
#define FET_ORDER_EFB 1
#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB)
#define FET_ORDER_EEB 1
#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF)
#define FET_ORDER_EFF 1
#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF)
#define FET_ORDER_EEF 1
#elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF) || ANY(SPINDLE_FEATURE, LASER_FEATURE)
#define FET_ORDER_SF 1
#elif HAS_MULTI_HOTEND && TEMP_SENSOR_BED
#define FET_ORDER_EEB 1
#elif HAS_MULTI_HOTEND
#define FET_ORDER_EEF 1
#elif TEMP_SENSOR_BED
#define FET_ORDER_EFB 1
#else
#define FET_ORDER_EFF 1
#if NONE(FET_ORDER_EEF, FET_ORDER_EEB, FET_ORDER_EFF, FET_ORDER_EFB, FET_ORDER_SF)
#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB, RAMPS_BTT_16_PLUS_EFB)
#define FET_ORDER_EFB 1
#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB, RAMPS_BTT_16_PLUS_EEB)
#define FET_ORDER_EEB 1
#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF, RAMPS_BTT_16_PLUS_EFF)
#define FET_ORDER_EFF 1
#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF, RAMPS_BTT_16_PLUS_EEF)
#define FET_ORDER_EEF 1
#elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF, RAMPS_BTT_16_PLUS_SF)
#define FET_ORDER_SF 1
#elif HAS_MULTI_HOTEND || (HAS_EXTRUDERS && HAS_CUTTER)
#if TEMP_SENSOR_BED
#define FET_ORDER_EEB 1
#else
#define FET_ORDER_EEF 1
#endif
#elif TEMP_SENSOR_BED
#define FET_ORDER_EFB 1
#else
#define FET_ORDER_EFF 1
#endif
#endif

#if !(ALL(HAS_WIRED_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD))
Expand Down Expand Up @@ -120,7 +124,7 @@
#endif

//
// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
// RAMPS 1.3 / 1.4 / 1.6+ - ATmega1280, ATmega2560
//

#if MB(RAMPS_OLD)
Expand All @@ -131,6 +135,8 @@
#include "ramps/pins_RAMPS.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280
#elif MB(RAMPS_PLUS_EFB, RAMPS_PLUS_EEB, RAMPS_PLUS_EFF, RAMPS_PLUS_EEF, RAMPS_PLUS_SF)
#include "ramps/pins_RAMPS_PLUS.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280
#elif MB(RAMPS_BTT_16_PLUS_EFB, RAMPS_BTT_16_PLUS_EEB, RAMPS_BTT_16_PLUS_EFF, RAMPS_BTT_16_PLUS_EEF, RAMPS_BTT_16_PLUS_SF)
#include "ramps/pins_RAMPS_BTT_16_PLUS.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280

//
// RAMPS Derivatives - ATmega1280, ATmega2560
Expand Down
49 changes: 49 additions & 0 deletions Marlin/src/pins/ramps/pins_RAMPS_BTT_16_PLUS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Arduino Mega with RAMPS BTT v1.6+
* Schematic: https://github.com/bigtreetech/ramps-1.6/blob/master/Ramps1.6/hardware/R6%2B-SCH.pdf
*
* Differences from RAMPS v1.4:
* - SPI Stepper drivers use AVR hardware SPI pins
* - SPI Stepper CS pins are different
*/

#include "env_validate.h"

#define BOARD_INFO_NAME "RAMPS BTT 1.6+"

#if HAS_TMC_SPI && DISABLED(TMC_USE_SW_SPI)
#define TMC_SPI_MOSI MOSI // 51
#define TMC_SPI_MISO MISO // 50
#define TMC_SPI_SCK SCK // 52
#endif

#define X_CS_PIN 63 // A0
#define Y_CS_PIN 40
#define Z_CS_PIN 42
#define E0_CS_PIN 65 // A11
#define E1_CS_PIN 66 // A12

#include "pins_RAMPS.h"

0 comments on commit c2a303b

Please sign in to comment.