Skip to content

Commit d537b1e

Browse files
ellenspTracy Spiva
authored and
Tracy Spiva
committed
✨ Creality Ender-2 (Melzi) (MarlinFirmware#25754)
1 parent d2e03bf commit d537b1e

File tree

3 files changed

+105
-6
lines changed

3 files changed

+105
-6
lines changed

Marlin/src/core/boards.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@
191191
#define BOARD_MELZI_V2 1503 // Melzi V2
192192
#define BOARD_MELZI_MAKR3D 1504 // Melzi with ATmega1284 (MaKr3d version)
193193
#define BOARD_MELZI_CREALITY 1505 // Melzi Creality3D (for CR-10 etc)
194-
#define BOARD_MELZI_MALYAN 1506 // Melzi Malyan M150
195-
#define BOARD_MELZI_TRONXY 1507 // Tronxy X5S
196-
#define BOARD_STB_11 1508 // STB V1.1
197-
#define BOARD_AZTEEG_X1 1509 // Azteeg X1
198-
#define BOARD_ANET_10 1510 // Anet 1.0 (Melzi clone)
199-
#define BOARD_ZMIB_V2 1511 // ZoneStar ZMIB V2
194+
#define BOARD_MELZI_CREALITY_ENDER2 1506 // Melzi Creality3D (for Ender-2)
195+
#define BOARD_MELZI_MALYAN 1507 // Melzi Malyan M150
196+
#define BOARD_MELZI_TRONXY 1508 // Tronxy X5S
197+
#define BOARD_STB_11 1509 // STB V1.1
198+
#define BOARD_AZTEEG_X1 1510 // Azteeg X1
199+
#define BOARD_ANET_10 1511 // Anet 1.0 (Melzi clone)
200+
#define BOARD_ZMIB_V2 1512 // ZoneStar ZMIB V2
200201

201202
//
202203
// Other ATmega644P, ATmega644, ATmega1284P

Marlin/src/pins/pins.h

+2
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@
372372
#include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino1284p_optimized env:sanguino1284p env:sanguino644p
373373
#elif MB(MELZI_CREALITY)
374374
#include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi_optiboot_optimized env:melzi_optiboot env:melzi_optimized env:melzi
375+
#elif MB(MELZI_CREALITY_ENDER2)
376+
#include "sanguino/pins_MELZI_CREALITY_E2.h" // ATmega1284P env:melzi_optiboot_optimized env:melzi_optiboot env:melzi_optimized env:melzi
375377
#elif MB(MELZI_MALYAN)
376378
#include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino1284p_optimized env:sanguino1284p env:sanguino644p
377379
#elif MB(MELZI_TRONXY)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#define BOARD_INFO_NAME "Melzi Ender 2 (Creality)"
25+
26+
/**
27+
* Connectors.
28+
* FAN1 LASER K-FAN B-MOT(A6) E-TEMP(A7) CHECK AVR ISP
29+
* --------- --------- --------- --------- --------- --------- ----------
30+
* J11 (Power Switch) |12V GND| |12V D4| |12V D4| |GND D25| |GND D24| |D29 GND| |MISO 5V|
31+
* ------ --------- --------- --------- --------- --------- --------- |SCK MOSI|
32+
* |V-IN|(Regulator) BED HOT-END FAN2 OFF X-STOP Y-STOP Z-STOP |RST GND|
33+
* |GND | --------- --------- --------- --------- --------- --------- --------- ----------
34+
* |12V | |12V D12| |12V D13| |12V GND| |D27 D17| |GND D18| |GND D19| |GND D20|
35+
* ------ --------- --------- --------- --------- --------- --------- ---------
36+
*
37+
* EXP1 EXP1 as ENDER2 STOCKDISPLAY EXP1 as CR10 STOCKDISPLAY
38+
* ------ ------ ------
39+
* (AVR_SCK) D7 | 1 2 | D16 SCK | 1 2 | BTN_E BEEPER_PIN | 1 2 | BTN_ENC
40+
* D11 | 3 4 | RESET BTN_EN1 | 3 4 | RESET BTN_EN1 | 3 4 | RESET
41+
* D10 5 6 | D30 BTN_EN2 5 6 | LCD_A0 BTN_EN2 5 6 | LCD_D4 (ST9720 CLK)
42+
* D28 | 7 8 | D5 (AVR_MOSI) LCD_CS | 7 8 | MOSI (ST9720 CS) LCD_RS | 7 8 | LCD_EN (ST9720 DAT)
43+
* GND | 9 10 | 5V GND | 9 10 | 5V GND | 9 10 | 5V
44+
* ------ ------ ------
45+
*/
46+
47+
#define EXP1_01_PIN 7
48+
#define EXP1_02_PIN 16
49+
#define EXP1_03_PIN 11
50+
#define EXP1_04_PIN -1 // hardware reset line
51+
#define EXP1_05_PIN 10
52+
#define EXP1_06_PIN 30
53+
#define EXP1_07_PIN 28
54+
#define EXP1_08_PIN 5
55+
56+
//
57+
// LCD / Controller
58+
//
59+
#if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
60+
#if ENABLED(CR10_STOCKDISPLAY)
61+
#if ENABLED(SDSUPPORT)
62+
#error "Cannot have SDSUPPORT with CR10_STOCKDISPLAY on this motherboard." // Hardware SDCARD SCK and MOSI pins are reallocated.
63+
#endif
64+
#define LCD_PINS_RS EXP1_07_PIN // ST9720 CS
65+
#define LCD_PINS_EN EXP1_08_PIN // ST9720 DAT
66+
#define LCD_PINS_D4 EXP1_06_PIN // ST9720 CLK
67+
#define BEEPER_PIN EXP1_01_PIN
68+
#elif ENABLED(ENDER2_STOCKDISPLAY)
69+
#define DOGLCD_CS EXP1_07_PIN
70+
#define DOGLCD_A0 EXP1_06_PIN
71+
#endif
72+
#define BTN_ENC EXP1_02_PIN
73+
#define BTN_EN1 EXP1_03_PIN
74+
#define BTN_EN2 EXP1_05_PIN
75+
#define LCD_PINS_DEFINED
76+
#endif
77+
78+
#define LCD_SDSS 31 // Controller's SD card
79+
80+
#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11
81+
82+
#if ENABLED(BLTOUCH)
83+
#ifndef SERVO0_PIN
84+
#define SERVO0_PIN 27
85+
#endif
86+
#if SERVO0_PIN == BEEPER_PIN
87+
#undef BEEPER_PIN
88+
#endif
89+
#elif HAS_FILAMENT_SENSOR
90+
#ifndef FIL_RUNOUT_PIN
91+
#define FIL_RUNOUT_PIN 27
92+
#endif
93+
#if FIL_RUNOUT_PIN == BEEPER_PIN
94+
#undef BEEPER_PIN
95+
#endif
96+
#endif

0 commit comments

Comments
 (0)