Skip to content

Commit

Permalink
Elegoo Neptune boards
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael <[email protected]>
  • Loading branch information
thinkyhead and mlee12382 committed Aug 20, 2023
1 parent db5ead4 commit 98643cb
Show file tree
Hide file tree
Showing 8 changed files with 577 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@
#define BOARD_CREALITY_F401RE 5245 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG)
#define BOARD_ZNP_ROBIN_NANO_V1_3 5248 // Elegoo Neptune 2 v1.3 board
#define BOARD_MKS_NEPTUNE_X 5249 // Elegoo Neptune X
#define BOARD_ZNP_ROBIN_NANO 5250 // Elegoo Neptune 2 v1.2 board
#define BOARD_MKS_NEPTUNE_3 5251 // Elegoo Neptune 3

//
// ARM Cortex-M7
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/pins/mega/pins_WEEDO_62A.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Based on WEEDO 62A pin configuration
* Copyright (c) 2019 WEEDO3D Perron
* ATmega2560
*/

#pragma once

#include "env_validate.h"

#ifndef BOARD_INFO_NAME
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@
#include "stm32f4/pins_BLACKPILL_CUSTOM.h" // STM32F4 env:STM32F401CD_blackpill_stlink
#elif MB(I3DBEEZ9_V1)
#include "stm32f4/pins_I3DBEEZ9.h" // STM32F4 env:I3DBEEZ9_V1
#elif MB(ZNP_ROBIN_NANO_V1_3)
#include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4 env:znp_robin_nano_v1_3
#elif MB(MKS_NEPTUNE_X)
#include "stm32f4/pins_MKS_NEPTUNE_X.h" // STM32F4 env:mks_neptune_x
#elif MB(ZNP_ROBIN_NANO)
#include "stm32f1/pins_MKS_ROBIN_NANO.h" // STM32F1 env:znp_robin_nano35
#elif MB(MKS_NEPTUNE_3)
#include "stm32f4/pins_MKS_NEPTUNE_3.h" // STM32F4 env:mks_neptune_3

//
// ARM Cortex-M7
Expand Down
143 changes: 143 additions & 0 deletions Marlin/src/pins/stm32f4/pins_MKS_NEPTUNE_3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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

//
// MKS Neptune 3
//

// Avoid conflict with TIMER_TONE
#define ALLOW_STM32F4
#include "env_validate.h"

#define BOARD_INFO_NAME "MKS Neptune 3"

//
// Release PB4 (Z_DIR_PIN) from JTAG NRST role
//
//#define DISABLE_DEBUG

// Use one of these or SDCard-based Emulation will be used
//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
#define I2C_EEPROM
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#define I2C_SCL_PIN PB6
#define I2C_SDA_PIN PB7
#endif

//
// Servos
//
#define SERVO0_PIN PA8 // BLTOUCH

//
// Limit Switches
//
//#define ZNP_TEST
#ifdef ZNP_TEST
#define X_DIAG_PIN PC14 // Z+
#else
#define X_DIAG_PIN PA13 // X-
#endif

#define Y_DIAG_PIN PB8
#define Z_DIAG_PIN PC13

#define X_STOP_PIN X_DIAG_PIN
#define Y_STOP_PIN Y_DIAG_PIN
#define Z_STOP_PIN Z_DIAG_PIN

//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PC14 // PB9
#endif

//
// Steppers
//
#define X_ENABLE_PIN PD2
#define X_STEP_PIN PC12
#define X_DIR_PIN PB3

#define Y_ENABLE_PIN PC10
#define Y_STEP_PIN PC11
#define Y_DIR_PIN PA15

#define Z_ENABLE_PIN PC8
#define Z_STEP_PIN PC7
#define Z_DIR_PIN PC9

#define E0_ENABLE_PIN PC6
#define E0_STEP_PIN PB10
#define E0_DIR_PIN PB1

#define E1_ENABLE_PIN PC5
#define E1_STEP_PIN PC4
#define E1_DIR_PIN PA4

//
// Temperature Sensors
//
#define TEMP_0_PIN PC1 // TH1
#define TEMP_1_PIN PC2 // TH2
#define TEMP_BED_PIN PC0 // TB1

//
// Heaters / Fans
//
#define HEATER_0_PIN PA6 // HEATER1
#define HEATER_BED_PIN PA5 // HOT BED

#define FAN_PIN PB0 // FAN
//#define FAN1_PIN PA7 // FAN1

#if NEED_TOUCH_PINS
#define TOUCH_CS_PIN PA7 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
#endif

//
// SD Support
//
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif

#if SD_CONNECTION_IS(ONBOARD)
#define ENABLE_SPI3
#define SD_SS_PIN -1
#define SDSS PB12
#define SD_SCK_PIN PB13
#define SD_MISO_PIN PB14
#define SD_MOSI_PIN PB15
#define SD_SPI_SPEED SPI_HALF_SPEED
#if ENABLED(NO_SD_HOST_DRIVE)
// Detect pin doesn't work when NO_SD_HOST_DRIVE disabled
#define SD_DETECT_PIN PC3
#endif
#endif
52 changes: 52 additions & 0 deletions Marlin/src/pins/stm32f4/pins_MKS_NEPTUNE_X.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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

#define ALLOW_STM32DUINO
#include "env_validate.h"

#if HOTENDS > 2 || E_STEPPERS > 2
#error "MKS Neptune X supports up to 2 hotends / E steppers."
#endif

#define BOARD_INFO_NAME "MKS Neptune X"

//
// Software SPI pins for TMC2130 stepper drivers
// This board only supports SW SPI for stepper drivers
//
#if HAS_TMC_SPI && DISABLED(TMC_USE_SW_SPI)
#warning "TMC_USE_SW_SPI is required for MKS Neptune X with TMC drivers."
#endif
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI PD14
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO PD1
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK PD0
#endif
#endif

#include "pins_MKS_NEPTUNE_X_common.h"
Loading

0 comments on commit 98643cb

Please sign in to comment.