Bläddra i källkod

Add MKS Robin Pro, MKS Robin Lite3 (#16163)

MS1987 4 år sedan
förälder
incheckning
31fdaea269

+ 15
- 12
Marlin/src/core/boards.h Visa fil

@@ -269,18 +269,21 @@
269 269
 #define BOARD_MKS_ROBIN_MINI          4007  // MKS Robin Mini (STM32F103VET6)
270 270
 #define BOARD_MKS_ROBIN_NANO          4008  // MKS Robin Nano (STM32F103VET6)
271 271
 #define BOARD_MKS_ROBIN_LITE          4009  // MKS Robin Lite/Lite2 (STM32F103RCT6)
272
-#define BOARD_BIGTREE_SKR_MINI_V1_1   4010  // BigTreeTech SKR Mini v1.1 (STM32F103RC)
273
-#define BOARD_BTT_SKR_MINI_E3_V1_0    4011  // BigTreeTech SKR Mini E3 (STM32F103RC)
274
-#define BOARD_BTT_SKR_MINI_E3_V1_2    4012  // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
275
-#define BOARD_BIGTREE_SKR_E3_DIP      4013  // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
276
-#define BOARD_JGAURORA_A5S_A1         4014  // JGAurora A5S A1 (STM32F103ZET6)
277
-#define BOARD_FYSETC_AIO_II           4015  // FYSETC AIO_II
278
-#define BOARD_FYSETC_CHEETAH          4016  // FYSETC Cheetah
279
-#define BOARD_FYSETC_CHEETAH_V12      4017  // FYSETC Cheetah V1.2
280
-#define BOARD_LONGER3D_LK             4018  // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
281
-#define BOARD_GTM32_MINI              4019  // STM32F103VET6 controller
282
-#define BOARD_GTM32_MINI_A30          4020  // STM32F103VET6 controller
283
-#define BOARD_GTM32_REV_B             4021  // STM32F103VET6 controller
272
+#define BOARD_MKS_ROBIN_LITE3         4010  // MKS Robin Lite3 (STM32F103RCT6)
273
+#define BOARD_MKS_ROBIN_PRO           4011  // MKS Robin Pro (STM32F103ZET6)
274
+#define BOARD_BIGTREE_SKR_MINI_V1_1   4012  // BigTreeTech SKR Mini v1.1 (STM32F103RC)
275
+#define BOARD_BTT_SKR_MINI_E3_V1_0    4013  // BigTreeTech SKR Mini E3 (STM32F103RC)
276
+#define BOARD_BTT_SKR_MINI_E3_V1_2    4014  // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
277
+#define BOARD_BIGTREE_SKR_E3_DIP      4015  // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
278
+#define BOARD_JGAURORA_A5S_A1         4016  // JGAurora A5S A1 (STM32F103ZET6)
279
+#define BOARD_FYSETC_AIO_II           4017  // FYSETC AIO_II
280
+#define BOARD_FYSETC_CHEETAH          4018  // FYSETC Cheetah
281
+#define BOARD_FYSETC_CHEETAH_V12      4019  // FYSETC Cheetah V1.2
282
+#define BOARD_LONGER3D_LK             4020  // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
283
+#define BOARD_GTM32_MINI              4021  // STM32F103VET6 controller
284
+#define BOARD_GTM32_MINI_A30          4022  // STM32F103VET6 controller
285
+#define BOARD_GTM32_REV_B             4023  // STM32F103VET6 controller
286
+
284 287
 
285 288
 //
286 289
 // ARM Cortex-M4F

+ 3
- 0
Marlin/src/inc/Conditionals_post.h Visa fil

@@ -259,6 +259,9 @@
259 259
 #elif ENABLED(AZSMZ_12864)
260 260
   #define _LCD_CONTRAST_MIN  120
261 261
   #define _LCD_CONTRAST_INIT 190
262
+#elif ENABLED(MKS_LCD12864B)
263
+  #define _LCD_CONTRAST_MIN  120
264
+  #define _LCD_CONTRAST_INIT 205
262 265
 #elif ENABLED(MKS_MINI_12864)
263 266
   #define _LCD_CONTRAST_MIN  120
264 267
   #define _LCD_CONTRAST_INIT 195

+ 37
- 34
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp Visa fil

@@ -244,48 +244,51 @@ bool MarlinUI::detected() { return true; }
244 244
 
245 245
 // Initialize or re-initialize the LCD
246 246
 void MarlinUI::init_lcd() {
247
+  #if DISABLED(MKS_LCD12864B)
247 248
 
248
-  #if PIN_EXISTS(LCD_BACKLIGHT)
249
-    OUT_WRITE(LCD_BACKLIGHT_PIN, (
250
-      #if ENABLED(DELAYED_BACKLIGHT_INIT)
251
-        LOW  // Illuminate after reset
252
-      #else
253
-        HIGH // Illuminate right away
249
+    #if PIN_EXISTS(LCD_BACKLIGHT)
250
+      OUT_WRITE(LCD_BACKLIGHT_PIN, (
251
+        #if ENABLED(DELAYED_BACKLIGHT_INIT)
252
+          LOW  // Illuminate after reset
253
+        #else
254
+          HIGH // Illuminate right away
255
+        #endif
256
+      ));
257
+    #endif
258
+
259
+    #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
260
+      SET_OUTPUT(LCD_PINS_DC);
261
+      #ifndef LCD_RESET_PIN
262
+        #define LCD_RESET_PIN LCD_PINS_RS
254 263
       #endif
255
-    ));
256
-  #endif
264
+    #endif
257 265
 
258
-  #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
259
-    SET_OUTPUT(LCD_PINS_DC);
260
-    #ifndef LCD_RESET_PIN
261
-      #define LCD_RESET_PIN LCD_PINS_RS
266
+    #if PIN_EXISTS(LCD_RESET)
267
+      // Perform a clean hardware reset with needed delays
268
+      OUT_WRITE(LCD_RESET_PIN, LOW);
269
+      _delay_ms(5);
270
+      WRITE(LCD_RESET_PIN, HIGH);
271
+      _delay_ms(5);
272
+      u8g.begin();
262 273
     #endif
263
-  #endif
264 274
 
265
-  #if PIN_EXISTS(LCD_RESET)
266
-    // Perform a clean hardware reset with needed delays
267
-    OUT_WRITE(LCD_RESET_PIN, LOW);
268
-    _delay_ms(5);
269
-    WRITE(LCD_RESET_PIN, HIGH);
270
-    _delay_ms(5);
271
-    u8g.begin();
272
-  #endif
275
+    #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
276
+      WRITE(LCD_BACKLIGHT_PIN, HIGH);
277
+    #endif
273 278
 
274
-  #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
275
-    WRITE(LCD_BACKLIGHT_PIN, HIGH);
276
-  #endif
279
+    #if HAS_LCD_CONTRAST
280
+      refresh_contrast();
281
+    #endif
277 282
 
278
-  #if HAS_LCD_CONTRAST
279
-    refresh_contrast();
280
-  #endif
283
+    #if ENABLED(LCD_SCREEN_ROT_90)
284
+      u8g.setRot90();
285
+    #elif ENABLED(LCD_SCREEN_ROT_180)
286
+      u8g.setRot180();
287
+    #elif ENABLED(LCD_SCREEN_ROT_270)
288
+      u8g.setRot270();
289
+    #endif
281 290
 
282
-  #if ENABLED(LCD_SCREEN_ROT_90)
283
-    u8g.setRot90();
284
-  #elif ENABLED(LCD_SCREEN_ROT_180)
285
-    u8g.setRot180();
286
-  #elif ENABLED(LCD_SCREEN_ROT_270)
287
-    u8g.setRot270();
288
-  #endif
291
+  #endif // !MKS_LCD12864B
289 292
 
290 293
   uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
291 294
 }

+ 4
- 1
Marlin/src/pins/pins.h Visa fil

@@ -493,6 +493,10 @@
493 493
   #include "stm32/pins_FYSETC_CHEETAH_V12.h"    // STM32F1                                env:STM32F103RC_fysetc
494 494
 #elif MB(LONGER3D_LK)
495 495
   #include "stm32/pins_LONGER3D_LK.h"           // STM32F1                                env:STM32F103VE_longer
496
+#elif MB(MKS_ROBIN_LITE3)
497
+  #include "stm32/pins_MKS_ROBIN_LITE3.h"       // STM32F1                                env:mks_robin_lite3
498
+#elif MB(MKS_ROBIN_PRO)
499
+  #include "stm32/pins_MKS_ROBIN_PRO.h"         // STM32F1                                env:mks_robin_pro
496 500
 
497 501
 //
498 502
 // ARM Cortex-M4F
@@ -531,7 +535,6 @@
531 535
   #include "stm32/pins_VAKE403D.h"              // STM32F4                                env:STM32F4
532 536
 #elif MB(FYSETC_S6)
533 537
   #include "stm32/pins_FYSETC_S6.h"             // STM32F4                                env:FYSETC_S6
534
-
535 538
 //
536 539
 // ARM Cortex M7
537 540
 //

+ 1
- 1
Marlin/src/pins/ramps/pins_RAMPS.h Visa fil

@@ -593,7 +593,7 @@
593 593
         //#define LCD_SCREEN_ROT_270
594 594
 
595 595
         // not connected to a pin
596
-        #define LCD_BACKLIGHT_PIN 65   // backlight LED on A11/D65
596
+        #define LCD_BACKLIGHT_PIN -1  // 65 (MKS mini12864 can't adjust backlight by software!)
597 597
 
598 598
         #define BTN_EN1         31
599 599
         #define BTN_EN2         33

+ 2
- 4
Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h Visa fil

@@ -23,10 +23,8 @@
23 23
 
24 24
 #ifndef __STM32F1__
25 25
   #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26
-#endif
27
-
28
-#if HOTENDS > 1 || E_STEPPERS > 1
29
-  #error "MKS Robin Lite supports up to 1 hotends / E-steppers. Comment out this line to continue."
26
+#elif HOTENDS > 1 || E_STEPPERS > 1
27
+  #error "MKS Robin Lite supports only 1 hotend / E-stepper. Comment out this line to continue."
30 28
 #endif
31 29
 
32 30
 #ifndef BOARD_INFO_NAME

+ 153
- 0
Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE3.h Visa fil

@@ -0,0 +1,153 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * MKS Robin Lite 3 (STM32F103RCT6) board pin assignments
26
+ */
27
+
28
+#ifndef __STM32F1__
29
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
30
+#elif HOTENDS > 2 || E_STEPPERS > 2
31
+  #error "MKS Robin Lite3 supports up to 2 hotends / E-steppers. Comment out this line to continue."
32
+#endif
33
+
34
+#ifndef BOARD_INFO_NAME
35
+  #define BOARD_INFO_NAME "MKS Robin Lite3"
36
+#endif
37
+#define BOARD_WEBSITE_URL "github.com/makerbase-mks"
38
+
39
+//#define DISABLE_DEBUG
40
+#define DISABLE_JTAG
41
+#define ENABLE_SPI2
42
+
43
+//
44
+// Servos
45
+//
46
+#define SERVO0_PIN         PA3
47
+
48
+//
49
+// Limit Switches
50
+//
51
+#define X_STOP_PIN         PA12
52
+#define Y_STOP_PIN         PA11
53
+#define Z_MIN_PIN          PC6
54
+#define Z_MAX_PIN          PB1
55
+
56
+//
57
+// Steppers
58
+//
59
+#define X_STEP_PIN         PC0
60
+#define X_DIR_PIN          PB2
61
+#define X_ENABLE_PIN       PC13
62
+
63
+#define Y_STEP_PIN         PC2
64
+#define Y_DIR_PIN          PB9
65
+#define Y_ENABLE_PIN       PB12
66
+
67
+#define Z_STEP_PIN         PB7
68
+#define Z_DIR_PIN          PB6
69
+#define Z_ENABLE_PIN       PB8
70
+
71
+#define E0_STEP_PIN        PB4
72
+#define E0_DIR_PIN         PB3
73
+#define E0_ENABLE_PIN      PB5
74
+
75
+#define E1_STEP_PIN        PC12
76
+#define E1_DIR_PIN         PC11
77
+#define E1_ENABLE_PIN      PD2
78
+
79
+//
80
+// Heaters 0,1 / Fans / Bed
81
+//
82
+#define HEATER_0_PIN       PC9
83
+#define HEATER_1_PIN       PC7
84
+#define FAN_PIN            PA8
85
+#define HEATER_BED_PIN     PC8
86
+
87
+//
88
+// Temperature Sensors
89
+//
90
+#define TEMP_BED_PIN       PA1  //TB
91
+#define TEMP_0_PIN         PA0  //TH1
92
+#define TEMP_1_PIN         PA2  //TH2
93
+
94
+#define FIL_RUNOUT_PIN     PB10 // MT_DET
95
+
96
+//
97
+// LCD Pins
98
+//
99
+#if HAS_SPI_LCD
100
+
101
+  #define BEEPER_PIN       PC1
102
+  #define BTN_ENC          PC3
103
+  #define LCD_PINS_ENABLE  PA4
104
+  #define LCD_PINS_RS      PA5
105
+  #define BTN_EN1          PB11
106
+  #define BTN_EN2          PB0
107
+
108
+  // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
109
+  #if ENABLED(MKS_MINI_12864)
110
+
111
+    #define LCD_BACKLIGHT_PIN -1
112
+    #define LCD_RESET_PIN  -1
113
+    #define DOGLCD_A0      PC4
114
+    #define DOGLCD_CS      PA7
115
+    #define DOGLCD_SCK     PB13
116
+    #define DOGLCD_MOSI    PB15
117
+
118
+    // Required for MKS_MINI_12864 with this board
119
+    #define MKS_LCD12864B
120
+    #undef SHOW_BOOTSCREEN
121
+
122
+  #else // !MKS_MINI_12864
123
+
124
+    #define LCD_PINS_D4    PA6
125
+    #if ENABLED(ULTIPANEL)
126
+      #define LCD_PINS_D5  PA7
127
+      #define LCD_PINS_D6  PC4
128
+      #define LCD_PINS_D7  PC5
129
+    #endif
130
+
131
+  #endif // !MKS_MINI_12864
132
+
133
+#endif // HAS_SPI_LCD
134
+
135
+//
136
+// SD Card
137
+//
138
+#define ENABLE_SPI2
139
+#define SD_DETECT_PIN      PC10
140
+#define SCK_PIN            PB13
141
+#define MISO_PIN           PB14
142
+#define MOSI_PIN           PB15
143
+#define SS_PIN             PA15
144
+
145
+#ifndef ST7920_DELAY_1
146
+  #define ST7920_DELAY_1 DELAY_NS(125)
147
+#endif
148
+#ifndef ST7920_DELAY_2
149
+  #define ST7920_DELAY_2 DELAY_NS(125)
150
+#endif
151
+#ifndef ST7920_DELAY_3
152
+  #define ST7920_DELAY_3 DELAY_NS(125)
153
+#endif

+ 2
- 4
Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h Visa fil

@@ -46,10 +46,8 @@
46 46
 //
47 47
 // Limit Switches
48 48
 //
49
-#define X_MIN_PIN          PA15
50
-#define X_MAX_PIN          PA15
51
-#define Y_MIN_PIN          PA12
52
-#define Y_MAX_PIN          PA12
49
+#define X_STOP_PIN         PA15
50
+#define Y_STOP_PIN         PA12
53 51
 #define Z_MIN_PIN          PA11
54 52
 #define Z_MAX_PIN          PC4
55 53
 

+ 1
- 1
Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h Visa fil

@@ -134,4 +134,4 @@
134 134
     #define TOUCH_MISO_PIN   PB14 // SPI2_MISO
135 135
     #define TOUCH_MOSI_PIN   PB15 // SPI2_MOSI
136 136
   #endif
137
-#endif
137
+#endif

+ 274
- 0
Marlin/src/pins/stm32/pins_MKS_ROBIN_PRO.h Visa fil

@@ -0,0 +1,274 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * MKS Robin pro (STM32F103ZET6) board pin assignments
26
+ */
27
+
28
+#ifndef __STM32F1__
29
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
30
+#elif HOTENDS > 3 || E_STEPPERS > 3
31
+  #error "MKS Robin pro supports up to 3 hotends / E-steppers. Comment out this line to continue."
32
+#endif
33
+
34
+#define BOARD_INFO_NAME "MKS Robin pro"
35
+
36
+//
37
+// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
38
+//
39
+#define DISABLE_DEBUG
40
+
41
+//
42
+// Note: MKS Robin board is using SPI2 interface.
43
+//
44
+//#define SPI_MODULE 2
45
+#define ENABLE_SPI2
46
+
47
+//
48
+// Servos
49
+//
50
+#define SERVO0_PIN         PA8   // BLTOUCH
51
+
52
+//
53
+// Limit Switches
54
+//
55
+#define X_MIN_PIN          PA15
56
+#define X_MAX_PIN          PG7
57
+#define Y_MIN_PIN          PA12
58
+#define Y_MAX_PIN          PG8
59
+#define Z_MIN_PIN          PA11
60
+#define Z_MAX_PIN          PC4
61
+
62
+//
63
+// Steppers
64
+//
65
+#define X_ENABLE_PIN       PE4
66
+#define X_STEP_PIN         PE3
67
+#define X_DIR_PIN          PE2
68
+#ifndef X_CS_PIN
69
+  #define X_CS_PIN         PF8
70
+#endif
71
+
72
+#define Y_ENABLE_PIN       PE1
73
+#define Y_STEP_PIN         PE0
74
+#define Y_DIR_PIN          PB9
75
+#ifndef Y_CS_PIN
76
+  #define Y_CS_PIN         PF3
77
+#endif
78
+
79
+#define Z_ENABLE_PIN       PB8
80
+#define Z_STEP_PIN         PB5
81
+#define Z_DIR_PIN          PB4
82
+#ifndef Z_CS_PIN
83
+  #define Z_CS_PIN         PF6
84
+#endif
85
+
86
+#define E0_ENABLE_PIN      PB3
87
+#define E0_STEP_PIN        PD6
88
+#define E0_DIR_PIN         PD3
89
+#ifndef E0_CS_PIN
90
+  #define E0_CS_PIN        PG15
91
+#endif
92
+
93
+#define E1_ENABLE_PIN      PA3
94
+#define E1_STEP_PIN        PA6
95
+#define E1_DIR_PIN         PA1
96
+#ifndef E1_CS_PIN
97
+  #define E1_CS_PIN        PG10
98
+#endif
99
+
100
+#define E2_ENABLE_PIN      PF0
101
+#define E2_STEP_PIN        PF2
102
+#define E2_DIR_PIN         PF1
103
+#ifndef E2_CS_PIN
104
+  #define E2_CS_PIN        PG9
105
+#endif
106
+//
107
+// Software SPI pins for TMC2130 stepper drivers
108
+//
109
+#if ENABLED(TMC_USE_SW_SPI)
110
+  #ifndef TMC_SW_MOSI
111
+    #define TMC_SW_MOSI    PB15
112
+  #endif
113
+  #ifndef TMC_SW_MISO
114
+    #define TMC_SW_MISO    PB14
115
+  #endif
116
+  #ifndef TMC_SW_SCK
117
+    #define TMC_SW_SCK     PB13
118
+  #endif
119
+#endif
120
+
121
+#if HAS_TMC220x
122
+  /**
123
+   * TMC2208/TMC2209 stepper drivers
124
+   *
125
+   * Hardware serial communication ports.
126
+   * If undefined software serial is used according to the pins below
127
+   */
128
+  //#define X_HARDWARE_SERIAL  Serial
129
+  //#define X2_HARDWARE_SERIAL Serial1
130
+  //#define Y_HARDWARE_SERIAL  Serial1
131
+  //#define Y2_HARDWARE_SERIAL Serial1
132
+  //#define Z_HARDWARE_SERIAL  Serial1
133
+  //#define Z2_HARDWARE_SERIAL Serial1
134
+  //#define E0_HARDWARE_SERIAL Serial1
135
+  //#define E1_HARDWARE_SERIAL Serial1
136
+  //#define E2_HARDWARE_SERIAL Serial1
137
+  //#define E3_HARDWARE_SERIAL Serial1
138
+  //#define E4_HARDWARE_SERIAL Serial1
139
+
140
+  //
141
+  // Software serial
142
+  //
143
+  #define X_SERIAL_TX_PIN  PF7
144
+  #define X_SERIAL_RX_PIN  PF8
145
+
146
+  #define Y_SERIAL_TX_PIN  PF4
147
+  #define Y_SERIAL_RX_PIN  PF3
148
+
149
+  #define Z_SERIAL_TX_PIN  PF5
150
+  #define Z_SERIAL_RX_PIN  PF6
151
+
152
+  #define E0_SERIAL_TX_PIN PG13
153
+  #define E0_SERIAL_RX_PIN PG15
154
+
155
+  #define E1_SERIAL_TX_PIN PG12
156
+  #define E1_SERIAL_RX_PIN PG10
157
+
158
+  #define E2_SERIAL_TX_PIN PC13
159
+  #define E2_SERIAL_RX_PIN PG9
160
+#endif
161
+
162
+//
163
+// Temperature Sensors
164
+//
165
+#define TEMP_0_PIN         PC1   // TH1
166
+#define TEMP_1_PIN         PC2   // TH2
167
+#define TEMP_2_PIN         PC3   // TH3
168
+#define TEMP_BED_PIN       PC0   // TB1
169
+
170
+//
171
+// Heaters / Fans
172
+//
173
+#define HEATER_0_PIN       PF10  // +HE0-
174
+#define HEATER_1_PIN       PB0   // +HE1-
175
+#define HEATER_2_PIN       PF9   // +HE2-
176
+#define HEATER_BED_PIN     PA0   // +HOT-BED-
177
+#define FAN_PIN            PB1   // +FAN-
178
+
179
+/**
180
+ * Note: MKS Robin Pro board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
181
+ */
182
+//#define MAX6675_SS_PIN     PE5   // TC1 - CS1
183
+//#define MAX6675_SS_PIN     PF11  // TC2 - CS2
184
+
185
+#define POWER_LOSS_PIN     PA2   // PW_DET
186
+#define PS_ON_PIN          PG11   // PW_OFF
187
+#define FIL_RUNOUT_PIN     PA4  // MT_DET1
188
+//#define FIL_RUNOUT_PIN     PE6   // MT_DET2
189
+//#define FIL_RUNOUT_PIN     PG14  // MT_DET3
190
+
191
+//
192
+// SD Card
193
+//
194
+#ifndef SDCARD_CONNECTION
195
+  #define SDCARD_CONNECTION ONBOARD
196
+#endif
197
+
198
+#if SD_CONNECTION_IS(LCD)
199
+  #define ENABLE_SPI2
200
+  #define SD_DETECT_PIN    PG3
201
+  #define SCK_PIN          PB13
202
+  #define MISO_PIN         PB14
203
+  #define MOSI_PIN         PB15
204
+  #define SS_PIN           PG6
205
+#elif SD_CONNECTION_IS(ONBOARD)
206
+  #define SDIO_SUPPORT
207
+  #define SD_DETECT_PIN    PD12
208
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
209
+  #error "No custom SD drive cable defined for this board."
210
+#endif
211
+
212
+/**
213
+ * Note: MKS Robin TFT screens use various TFT controllers.
214
+ * If the screen stays white, disable 'LCD_RESET_PIN'
215
+ * to let the bootloader init the screen.
216
+ */
217
+#if ENABLED(FSMC_GRAPHICAL_TFT)
218
+  #define FSMC_CS_PIN      PD7    // NE4
219
+  #define FSMC_RS_PIN      PD11   // A0
220
+
221
+  #define LCD_RESET_PIN    PF6
222
+  #define NO_LCD_REINIT             // Suppress LCD re-initialization
223
+
224
+  #define LCD_BACKLIGHT_PIN PD13
225
+
226
+  #if ENABLED(TOUCH_BUTTONS)
227
+    #define TOUCH_CS_PIN   PA7
228
+  #else
229
+    #define BEEPER_PIN     PC5
230
+    #define BTN_ENC        PG2
231
+    #define BTN_EN1        PG5
232
+    #define BTN_EN2        PG4
233
+  #endif
234
+
235
+#elif HAS_SPI_LCD
236
+
237
+  #define BEEPER_PIN       PC5
238
+  #define BTN_ENC          PG2
239
+  #define LCD_PINS_ENABLE  PG0
240
+  #define LCD_PINS_RS      PG1
241
+  #define BTN_EN1          PG5
242
+  #define BTN_EN2          PG4
243
+
244
+  // MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor)
245
+  #if ENABLED(MKS_MINI_12864)
246
+
247
+    #define LCD_BACKLIGHT_PIN -1
248
+    #define LCD_RESET_PIN  -1
249
+    #define DOGLCD_A0      PF12
250
+    #define DOGLCD_CS      PF15
251
+    #define DOGLCD_SCK     PB13
252
+    #define DOGLCD_MOSI    PB15
253
+
254
+  #else // !MKS_MINI_12864
255
+
256
+    #define LCD_PINS_D4    PF14
257
+    #if ENABLED(ULTIPANEL)
258
+      #define LCD_PINS_D5  PF15
259
+      #define LCD_PINS_D6  PF12
260
+      #define LCD_PINS_D7  PF13
261
+    #endif
262
+
263
+  #endif // !MKS_MINI_12864
264
+#endif
265
+
266
+#ifndef ST7920_DELAY_1
267
+  #define ST7920_DELAY_1 DELAY_NS(125)
268
+#endif
269
+#ifndef ST7920_DELAY_2
270
+  #define ST7920_DELAY_2 DELAY_NS(125)
271
+#endif
272
+#ifndef ST7920_DELAY_3
273
+  #define ST7920_DELAY_3 DELAY_NS(125)
274
+#endif

+ 14
- 0
buildroot/share/PlatformIO/ldscripts/mks_robin_lite3.ld Visa fil

@@ -0,0 +1,14 @@
1
+MEMORY
2
+{
3
+  ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
4
+  rom (rx)  : ORIGIN = 0x08005000, LENGTH = 256K - 20K
5
+}
6
+
7
+/* Provide memory region aliases for common.inc */
8
+REGION_ALIAS("REGION_TEXT", rom);
9
+REGION_ALIAS("REGION_DATA", ram);
10
+REGION_ALIAS("REGION_BSS", ram);
11
+REGION_ALIAS("REGION_RODATA", rom);
12
+
13
+/* Let common.inc handle the real work. */
14
+INCLUDE common.inc

+ 14
- 0
buildroot/share/PlatformIO/ldscripts/mks_robin_pro.ld Visa fil

@@ -0,0 +1,14 @@
1
+MEMORY
2
+{
3
+  ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40
4
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K
5
+}
6
+
7
+/* Provide memory region aliases for common.inc */
8
+REGION_ALIAS("REGION_TEXT", rom);
9
+REGION_ALIAS("REGION_DATA", ram);
10
+REGION_ALIAS("REGION_BSS", ram);
11
+REGION_ALIAS("REGION_RODATA", rom);
12
+
13
+/* Let common.inc handle the real work. */
14
+INCLUDE common.inc

+ 40
- 0
buildroot/share/PlatformIO/scripts/mks_robin_lite3.py Visa fil

@@ -0,0 +1,40 @@
1
+import os
2
+Import("env")
3
+
4
+# Relocate firmware from 0x08000000 to 0x08005000
5
+for define in env['CPPDEFINES']:
6
+    if define[0] == "VECT_TAB_ADDR":
7
+        env['CPPDEFINES'].remove(define)
8
+env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000"))
9
+
10
+custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_lite.ld")
11
+for i, flag in enumerate(env["LINKFLAGS"]):
12
+    if "-Wl,-T" in flag:
13
+        env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
14
+    elif flag == "-T":
15
+        env["LINKFLAGS"][i + 1] = custom_ld_script
16
+
17
+
18
+# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin'
19
+def encrypt(source, target, env):
20
+    import sys
21
+
22
+    key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]
23
+
24
+    firmware = open(target[0].path, "rb")
25
+    robin = open(target[0].dir.path +'/mksLite3.bin', "wb")
26
+    length = os.path.getsize(target[0].path)
27
+    position = 0
28
+    try:
29
+        while position < length:
30
+            byte = firmware.read(1)
31
+            if position >= 320 and position < 31040:
32
+                byte = chr(ord(byte) ^ key[position & 31])
33
+                if sys.version_info[0] > 2:
34
+                    byte = bytes(byte, 'latin1')
35
+            robin.write(byte)
36
+            position += 1
37
+    finally:
38
+        firmware.close()
39
+        robin.close()
40
+env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);

+ 39
- 0
buildroot/share/PlatformIO/scripts/mks_robin_pro.py Visa fil

@@ -0,0 +1,39 @@
1
+import os
2
+Import("env")
3
+
4
+# Relocate firmware from 0x08000000 to 0x08007000
5
+for define in env['CPPDEFINES']:
6
+    if define[0] == "VECT_TAB_ADDR":
7
+        env['CPPDEFINES'].remove(define)
8
+env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))
9
+
10
+custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_pro.ld")
11
+for i, flag in enumerate(env["LINKFLAGS"]):
12
+    if "-Wl,-T" in flag:
13
+        env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
14
+    elif flag == "-T":
15
+        env["LINKFLAGS"][i + 1] = custom_ld_script
16
+
17
+# Encrypt ${PROGNAME}.bin and save it as 'Robin.bin'
18
+def encrypt(source, target, env):
19
+    import sys
20
+
21
+    key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]
22
+
23
+    firmware = open(target[0].path, "rb")
24
+    robin = open(target[0].dir.path +'/Robin_pro.bin', "wb")
25
+    length = os.path.getsize(target[0].path)
26
+    position = 0
27
+    try:
28
+        while position < length:
29
+            byte = firmware.read(1)
30
+            if position >= 320 and position < 31040:
31
+                byte = chr(ord(byte) ^ key[position & 31])
32
+                if sys.version_info[0] > 2:
33
+                    byte = bytes(byte, 'latin1')
34
+            robin.write(byte)
35
+            position += 1
36
+    finally:
37
+        firmware.close()
38
+        robin.close()
39
+env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);

+ 2218
- 0
config/examples/Mks/Robin_Lite3/Configuration.h
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 5
- 0
config/examples/Mks/Robin_Lite3/ReadMe.txt Visa fil

@@ -0,0 +1,5 @@
1
+1. MKS Robin Lite3 is a powerful 32-bit 3D printer control board with STM32F103RCT6.
2
+2. Support Marlin2.0.
3
+3. Support MKS LCD12864B/MINI12864/LCD2004/12864 and MKS TFT Touch Screens.
4
+4. The main board integrates 5 AXIS interface, BLTOUCH interface, hot bed, 2 heating heads, 3 NTC100K and LCD screen SD card supports firmware update.
5
+https://www.aliexpress.com/item/4000295949948.html?spm=2114.12010615.8148356.1.596183361yB18D

+ 2217
- 0
config/examples/Mks/Robin_Pro/Configuration.h
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 4
- 0
config/examples/Mks/Robin_Pro/ReadMe.txt Visa fil

@@ -0,0 +1,4 @@
1
+1. MKS Robin Pro is a powerful 32-bit 3D printer control board with STM32F103ZET6.
2
+2. Support Marlin2.0. Support LCD2004/12864 and MKS Robin TFT24/28/32... Screens.
3
+3. The motherboard integrates 6 AXIS interface, BLTOUCH interface, hot bed, 3 heating heads, 4 NTC100K, 2 MAX31855, integrates SPI / UART interface and works with MKS TMC2130/TMC2208 V2.0/TMC
4
+https://www.aliexpress.com/item/4000444286159.html?spm=2114.12010615.8148356.1.4158721an5TnW9

+ 30
- 0
platformio.ini Visa fil

@@ -470,6 +470,21 @@ src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
470 470
 lib_ignore    = Adafruit NeoPixel, SPI
471 471
 monitor_speed = 250000
472 472
 
473
+
474
+#
475
+# MKS Robin Pro (STM32F103ZET6)
476
+#
477
+[env:mks_robin_pro]
478
+platform      = ststm32
479
+board         = genericSTM32F103ZE
480
+extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_pro.py
481
+build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
482
+  ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY
483
+build_unflags = -std=gnu++11
484
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
485
+lib_deps      = ${common.lib_deps}
486
+lib_ignore    = Adafruit NeoPixel, SPI, TMCStepper
487
+
473 488
 #
474 489
 # MKS Robin Lite/Lite2 (STM32F103RCT6)
475 490
 #
@@ -485,6 +500,21 @@ lib_ignore    = Adafruit NeoPixel, SPI
485 500
 monitor_speed = 250000
486 501
 
487 502
 #
503
+# MKS ROBIN LITE3 (STM32F103RCT6)
504
+#
505
+[env:mks_robin_lite3]
506
+platform      = ststm32
507
+board         = genericSTM32F103RC
508
+extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_lite3.py
509
+build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
510
+  ${common.build_flags} -std=gnu++14
511
+build_unflags = -std=gnu++11
512
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
513
+lib_deps      = ${common.lib_deps}
514
+lib_ignore    = Adafruit NeoPixel, SPI
515
+
516
+
517
+#
488 518
 # MKS Robin Mini (STM32F103VET6)
489 519
 #
490 520
 [env:mks_robin_mini]

Laddar…
Avbryt
Spara