Skip to content

Commit 147f466

Browse files
magicmaker3Pragma8123
authored andcommitted
✨ MM-JOKER (ESP32) board (MarlinFirmware#25897)
1 parent 32a2eac commit 147f466

File tree

4 files changed

+275
-4
lines changed

4 files changed

+275
-4
lines changed

Marlin/src/core/boards.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@
490490
#define BOARD_MKS_TINYBEE 7008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
491491
#define BOARD_ENWI_ESPNP 7009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
492492
#define BOARD_GODI_CONTROLLER_V1_0 7010 // Godi Controller based on ESP32 32-Bit V1.0
493+
#define BOARD_MM_JOKER 7011 // MagicMaker JOKER based on ESP32 (with I2S stepper stream)
493494

494495
//
495496
// SAMD51 ARM Cortex-M4

Marlin/src/inc/SanityCheck.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
648648
*/
649649
#if HAS_MULTI_EXTRUDER
650650

651-
#if HAS_EXTENDABLE_MMU
652-
#define MAX_EXTRUDERS 15
653-
#else
654-
#define MAX_EXTRUDERS 8
651+
#ifndef MAX_EXTRUDERS
652+
#if HAS_EXTENDABLE_MMU
653+
#define MAX_EXTRUDERS 15
654+
#else
655+
#define MAX_EXTRUDERS 8
656+
#endif
655657
#endif
656658
static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS.");
657659
#undef MAX_EXTRUDERS

Marlin/src/pins/esp32/pins_MM_JOKER.h

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
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+
/**
25+
* JOKER pin assignments
26+
*/
27+
28+
#include "env_validate.h"
29+
30+
#define BOARD_INFO_NAME "JOKER"
31+
#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
32+
33+
//
34+
// Expansion Boards for more axes, sensors, heaters
35+
// Only enable one of these options.
36+
//
37+
//#define JOKER_PLUS_2
38+
//#define JOKER_PLUS_5
39+
40+
#if ENABLED(JOKER_PLUS_2)
41+
#define MAX_EXTRUDERS 2
42+
#if E_STEPPERS > 2
43+
#error "JOKER with +2 expansion supports up to 2 E steppers."
44+
#elif HOTENDS > 2
45+
#error "JOKER with +2 expansion supports up to 2 hotends."
46+
#endif
47+
#elif ENABLED(JOKER_PLUS_5)
48+
#define MAX_EXTRUDERS 3
49+
#if E_STEPPERS > 3
50+
#error "JOKER with +5 expansion supports up to 3 E steppers."
51+
#elif HOTENDS > 3
52+
#error "JOKER with +5 expansion supports up to 3 hotends."
53+
#endif
54+
#else
55+
#if E_STEPPERS > 1
56+
#error "JOKER without expansion only supports 1 E stepper."
57+
#elif HAS_MULTI_HOTEND
58+
#error "JOKER without expansion only supports 1 hotend."
59+
#endif
60+
#endif
61+
62+
//
63+
// Servos
64+
//
65+
#define SERVO0_PIN 14
66+
67+
//
68+
// Limit Switches
69+
//
70+
#define X_STOP_PIN 15
71+
#define Y_STOP_PIN 16
72+
#define Z_STOP_PIN 17
73+
74+
//
75+
// Filament Runout Sensor
76+
//
77+
#ifndef FIL_RUNOUT_PIN
78+
#define FIL_RUNOUT_PIN 13
79+
#endif
80+
81+
#ifndef Z_MIN_PROBE_PIN
82+
//#define Z_MIN_PROBE_PIN 35 // Pin 35 is the RAMPS default
83+
#endif
84+
85+
//
86+
// Enable I2S stepper stream
87+
//
88+
#define I2S_STEPPER_STREAM
89+
#if ENABLED(I2S_STEPPER_STREAM)
90+
#define I2S_WS 26
91+
#define I2S_BCK 25
92+
#define I2S_DATA 27
93+
#if ENABLED(LIN_ADVANCE)
94+
#error "I2S stream is currently incompatible with LIN_ADVANCE."
95+
#endif
96+
#endif
97+
98+
//
99+
// Steppers
100+
//
101+
#define X_STEP_PIN 128
102+
#define X_DIR_PIN 129
103+
#define X_ENABLE_PIN 136
104+
105+
#define Y_STEP_PIN 130
106+
#define Y_DIR_PIN 131
107+
#define Y_ENABLE_PIN X_ENABLE_PIN
108+
109+
#define Z_STEP_PIN 132
110+
#define Z_DIR_PIN 133
111+
#define Z_ENABLE_PIN 137
112+
113+
#define E0_STEP_PIN 134
114+
#define E0_DIR_PIN 135
115+
#define E0_ENABLE_PIN 138
116+
117+
#if ENABLED(JOKER_PLUS_2)
118+
119+
#define E1_STEP_PIN 144
120+
#define E1_DIR_PIN 145
121+
#define E1_ENABLE_PIN 146
122+
123+
#define E2_STEP_PIN 147
124+
#define E2_DIR_PIN 148
125+
#define E2_ENABLE_PIN 149
126+
127+
#elif ENABLED(JOKER_PLUS_5)
128+
129+
#define E1_STEP_PIN 144
130+
#define E1_DIR_PIN 145
131+
#define E1_ENABLE_PIN 146
132+
133+
#define E2_STEP_PIN 153
134+
#define E2_DIR_PIN 154
135+
#define E2_ENABLE_PIN 155
136+
137+
#define E3_STEP_PIN 156
138+
#define E3_DIR_PIN 157
139+
#define E3_ENABLE_PIN 158
140+
141+
// Are these preferred for X2, Y2, Z2, Z3 ?
142+
#define E4_STEP_PIN 147
143+
#define E4_DIR_PIN 148
144+
#define E4_ENABLE_PIN 149
145+
146+
#define E5_STEP_PIN 150
147+
#define E5_DIR_PIN 151
148+
#define E5_ENABLE_PIN 152
149+
150+
#endif
151+
152+
//
153+
// Temperature Sensors
154+
//
155+
#define TEMP_0_PIN 36 // Analog Input
156+
#define TEMP_BED_PIN 39 // Analog Input
157+
158+
#if ENABLED(JOKER_PLUS_2)
159+
#define TEMP_1_PIN 34 // Analog Input
160+
#elif ENABLED(JOKER_PLUS_5)
161+
#define TEMP_1_PIN 32 // Analog Input
162+
#define TEMP_2_PIN 33 // Analog Input
163+
#define TEMP_3_PIN 34 // Analog Input
164+
#endif
165+
166+
//
167+
// Heaters / Fans
168+
//
169+
#define HEATER_0_PIN 141
170+
#define HEATER_BED_PIN 140
171+
#define FAN0_PIN 143
172+
173+
#ifndef E0_AUTO_FAN_PIN
174+
#define E0_AUTO_FAN_PIN 142 // Enabled in Configuration_adv.h
175+
#endif
176+
177+
#ifndef CONTROLLER_FAN_PIN
178+
//#define CONTROLLER_FAN_PIN -1
179+
#endif
180+
181+
#if ENABLED(JOKER_PLUS_2)
182+
183+
#define HEATER_1_PIN 150
184+
#define FAN1_PIN 151
185+
186+
#elif ENABLED(JOKER_PLUS_5)
187+
188+
#define HEATER_1_PIN 159
189+
#define HEATER_2_PIN 160
190+
#define HEATER_3_PIN 161
191+
192+
#define FAN1_PIN 162
193+
#define FAN2_PIN 163
194+
#define FAN3_PIN 164
195+
196+
#ifndef E1_AUTO_FAN_PIN
197+
#define E1_AUTO_FAN_PIN 165
198+
#endif
199+
#ifndef E2_AUTO_FAN_PIN
200+
#define E2_AUTO_FAN_PIN 166
201+
#endif
202+
#ifndef E3_AUTO_FAN_PIN
203+
#define E3_AUTO_FAN_PIN 167
204+
#endif
205+
206+
#endif
207+
208+
//
209+
// SD Card
210+
//
211+
#define SD_MOSI_PIN 23
212+
#define SD_MISO_PIN 19
213+
#define SD_SCK_PIN 18
214+
#define SDSS 5
215+
#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers
216+
217+
//
218+
// LCD / Controller
219+
//
220+
#if HAS_WIRED_LCD
221+
222+
//#define LCD_PINS_RS 13
223+
//#define LCD_PINS_ENABLE 17
224+
//#define LCD_PINS_D4 16
225+
226+
#if ENABLED(CR10_STOCKDISPLAY)
227+
228+
#define BEEPER_PIN 151
229+
230+
#elif IS_RRD_FG_SC
231+
232+
#define BEEPER_PIN 151
233+
234+
//#define LCD_PINS_D5 -1
235+
//#define LCD_PINS_D6 -1
236+
//#define LCD_PINS_D7 -1
237+
238+
#endif
239+
240+
#define BTN_EN1 2
241+
#define BTN_EN2 4
242+
#define BTN_ENC 12
243+
#define BEEPER_PIN 139
244+
245+
#endif // HAS_WIRED_LCD
246+
247+
/**
248+
* Hardware Serial
249+
* Add the following to Configuration.h or Configuration_adv.h to assign
250+
* specific pins to hardware Serial1 and Serial2.
251+
* Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but
252+
* JOKER does not have enough spare pins for such reassignment.
253+
*/
254+
//#define HARDWARE_SERIAL1_RX 21
255+
//#define HARDWARE_SERIAL1_TX 22
256+
//#define HARDWARE_SERIAL2_RX 2
257+
//#define HARDWARE_SERIAL2_TX 4
258+
259+
//
260+
// M3/M4/M5 - Spindle/Laser Control
261+
//
262+
#if HAS_CUTTER
263+
#define SPINDLE_LASER_ENA_PIN -1 // FET 1
264+
#define SPINDLE_LASER_PWM_PIN 33 // Bed FET
265+
//#define SPINDLE_DIR_PIN -1 // FET 3
266+
#endif

Marlin/src/pins/pins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,8 @@
856856
#include "esp32/pins_ENWI_ESPNP.h" // ESP32 env:esp32
857857
#elif MB(GODI_CONTROLLER_V1_0)
858858
#include "esp32/pins_GODI_CONTROLLER_V1_0.h" // ESP32 env:godi_esp32
859+
#elif MB(MM_JOKER)
860+
#include "esp32/pins_MM_JOKER.h" // ESP32 env:esp32
859861

860862
//
861863
// Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4)

0 commit comments

Comments
 (0)