Browse Source

ZoneStar Z6FB (#18918)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
wmariz 3 years ago
parent
commit
da4eaebdc9
No account linked to committer's email address

+ 9
- 2
Marlin/Configuration.h View File

@@ -2089,7 +2089,7 @@
2089 2089
 //#define OLED_PANEL_TINYBOY2
2090 2090
 
2091 2091
 //
2092
-// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
2092
+// MKS OLED 1.3" 128×64 FULL GRAPHICS CONTROLLER
2093 2093
 // https://reprap.org/wiki/MKS_12864OLED
2094 2094
 //
2095 2095
 // Tiny, but very sharp OLED display
@@ -2098,6 +2098,13 @@
2098 2098
 //#define MKS_12864OLED_SSD1306  // Uses the SSD1306 controller
2099 2099
 
2100 2100
 //
2101
+// Zonestar OLED 128×64 FULL GRAPHICS CONTROLLER
2102
+//
2103
+//#define ZONESTAR_12864LCD           // Graphical (DOGM) with ST7920 controller
2104
+//#define ZONESTAR_12864OLED          // 1.3" OLED with SH1106 controller (default)
2105
+//#define ZONESTAR_12864OLED_SSD1306  // 0.96" OLED with SSD1306 controller
2106
+
2107
+//
2101 2108
 // Einstart S OLED SSD1306
2102 2109
 //
2103 2110
 //#define U8GLIB_SH1106_EINSTART
@@ -2108,7 +2115,7 @@
2108 2115
 //#define OVERLORD_OLED
2109 2116
 
2110 2117
 //
2111
-// FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER with WS2812 RGB
2118
+// FYSETC OLED 2.42" 128×64 FULL GRAPHICS CONTROLLER with WS2812 RGB
2112 2119
 // Where to find : https://www.aliexpress.com/item/4000345255731.html
2113 2120
 //#define FYSETC_242_OLED_12864   // Uses the SSD1309 controller
2114 2121
 

+ 1
- 0
Marlin/src/core/boards.h View File

@@ -171,6 +171,7 @@
171 171
 #define BOARD_STB_11                  1508  // STB V1.1
172 172
 #define BOARD_AZTEEG_X1               1509  // Azteeg X1
173 173
 #define BOARD_ANET_10                 1510  // Anet 1.0 (Melzi clone)
174
+#define BOARD_ZMIB_V2                 1511  // ZoneStar ZMIB V2
174 175
 
175 176
 //
176 177
 // Other ATmega644P, ATmega644, ATmega1284P

+ 13
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -62,6 +62,19 @@
62 62
   #define ENCODER_STEPS_PER_MENU_ITEM 1
63 63
   #define ENCODER_FEEDRATE_DEADZONE 2
64 64
 
65
+#elif ENABLED(ZONESTAR_12864LCD)
66
+  #define DOGLCD
67
+  #define IS_RRD_SC
68
+  #define U8GLIB_ST7920
69
+
70
+#elif ENABLED(ZONESTAR_12864OLED)
71
+  #define IS_RRD_SC
72
+  #define U8GLIB_SH1106
73
+
74
+#elif ENABLED(ZONESTAR_12864OLED_SSD1306)
75
+  #define IS_RRD_SC
76
+  #define IS_U8GLIB_SSD1306
77
+
65 78
 #elif ENABLED(RADDS_DISPLAY)
66 79
   #define IS_ULTIPANEL
67 80
   #define ENCODER_PULSES_PER_STEP 2

+ 4
- 0
Marlin/src/inc/Conditionals_post.h View File

@@ -312,6 +312,10 @@
312 312
   #define _LCD_CONTRAST_INIT  17
313 313
 #elif ENABLED(MINIPANEL)
314 314
   #define _LCD_CONTRAST_INIT  150
315
+#elif ENABLED(ZONESTAR_12864OLED)
316
+  #define _LCD_CONTRAST_MIN   64
317
+  #define _LCD_CONTRAST_INIT 128
318
+  #define _LCD_CONTRAST_MAX  255
315 319
 #endif
316 320
 
317 321
 #ifdef _LCD_CONTRAST_INIT

+ 4
- 1
Marlin/src/inc/SanityCheck.h View File

@@ -2227,6 +2227,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2227 2227
   + ENABLED(OLED_PANEL_TINYBOY2) \
2228 2228
   + ENABLED(MKS_12864OLED) \
2229 2229
   + ENABLED(MKS_12864OLED_SSD1306) \
2230
+  + ENABLED(ZONESTAR_12864LCD) \
2231
+  + ENABLED(ZONESTAR_12864OLED) \
2232
+  + ENABLED(ZONESTAR_12864OLED_SSD1306) \
2230 2233
   + ENABLED(U8GLIB_SH1106_EINSTART) \
2231 2234
   + ENABLED(OVERLORD_OLED) \
2232 2235
   + ENABLED(FYSETC_242_OLED_12864) \
@@ -2242,7 +2245,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2242 2245
   + ENABLED(TFT_LVGL_UI_SPI) \
2243 2246
   + ENABLED(ANYCUBIC_LCD_I3MEGA) \
2244 2247
   + ENABLED(ANYCUBIC_LCD_CHIRON)
2245
-  #error "Please select no more than one LCD controller option."
2248
+  #error "Please select only one LCD controller option."
2246 2249
 #endif
2247 2250
 
2248 2251
 #undef IS_RRD_SC

+ 1
- 1
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

@@ -246,7 +246,7 @@ void MarlinUI::init_lcd() {
246 246
       OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
247 247
     #endif
248 248
 
249
-    #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864)
249
+    #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED)
250 250
       SET_OUTPUT(LCD_PINS_DC);
251 251
       #ifndef LCD_RESET_PIN
252 252
         #define LCD_RESET_PIN LCD_PINS_RS

+ 42
- 40
Marlin/src/lcd/dogm/ultralcd_DOGM.h View File

@@ -33,6 +33,9 @@
33 33
 //#define ALTERNATIVE_LCD
34 34
 
35 35
 #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
36
+
37
+  // RepRapWorld Graphical LCD
38
+
36 39
   #define U8G_CLASS U8GLIB_ST7920_128X64_4X
37 40
   #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN)
38 41
     #define U8G_PARAM LCD_PINS_RS
@@ -43,6 +46,7 @@
43 46
 #elif ENABLED(U8GLIB_ST7920)
44 47
 
45 48
   // RepRap Discount Full Graphics Smart Controller
49
+  // and other variant LCDs using ST7920
46 50
 
47 51
   #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN)
48 52
     #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL               // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.)
@@ -88,9 +92,29 @@
88 92
     #define FORCE_SOFT_SPI                                      // SW-SPI
89 93
   #endif
90 94
 
91
-#elif ENABLED(MKS_12864OLED_SSD1306)
95
+#elif ANY(FYSETC_MINI_12864, MKS_MINI_12864, ENDER2_STOCKDISPLAY)
96
+
97
+  // The FYSETC Mini 12864 display                              // "4 stripes"
98
+
99
+  // The MKS_MINI_12864 V1/V2 aren't exact copies of the MiniPanel.
100
+  // Panel management is in u8g_dev_uc1701_mini12864_HAL.cpp with
101
+  // extra delays added to remove glitches seen with fast MCUs.
102
+
103
+  #define U8G_CLASS U8GLIB_MINI12864_2X_HAL                     // 8 stripes (HW-SPI)
104
+
105
+#elif ENABLED(MINIPANEL)
106
+
107
+  #if ENABLED(ALTERNATIVE_LCD)
108
+    #define U8G_CLASS U8GLIB_MINI12864
109
+  #else
110
+    #define U8G_CLASS U8GLIB_MINI12864_2X                       // 8 stripes (HW-SPI)
111
+  #endif
112
+
113
+#elif EITHER(MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864)
92 114
 
93 115
   // MKS 128x64 (SSD1306) OLED I2C LCD
116
+  // - or -
117
+  // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER
94 118
 
95 119
   #define FORCE_SOFT_SPI                                        // SW-SPI
96 120
 
@@ -100,40 +124,36 @@
100 124
     #define U8G_CLASS U8GLIB_SSD1306_128X64                     // 8 stripes
101 125
   #endif
102 126
 
103
-#elif ENABLED(U8GLIB_SSD1306)
127
+#elif ENABLED(ZONESTAR_12864OLED_SSD1306)
104 128
 
105
-  // Generic SSD1306 OLED I2C LCD
129
+  // Zonestar SSD1306 OLED SPI LCD
106 130
 
131
+  #define FORCE_SOFT_SPI                                        // SW-SPI
107 132
   #if ENABLED(ALTERNATIVE_LCD)
108
-    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE       // 4 stripes
133
+    #define U8G_CLASS U8GLIB_SH1306_128X64_2X                   // 4 stripes
109 134
   #else
110
-    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X                  // 4 stripes
135
+    #define U8G_CLASS U8GLIB_SH1306_128X64                      // 8 stripes
111 136
   #endif
112
-  #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)
113 137
 
114
-#elif ENABLED(MKS_12864OLED)
138
+#elif EITHER(MKS_12864OLED, ZONESTAR_12864OLED)
115 139
 
116 140
   // MKS 128x64 (SH1106) OLED I2C LCD
141
+  // - or -
142
+  // Zonestar SH1106 OLED SPI LCD
117 143
 
118 144
   #define FORCE_SOFT_SPI                                        // SW-SPI
119
-
120 145
   #if ENABLED(ALTERNATIVE_LCD)
121 146
     #define U8G_CLASS U8GLIB_SH1106_128X64_2X                   // 4 stripes
122 147
   #else
123 148
     #define U8G_CLASS U8GLIB_SH1106_128X64                      // 8 stripes
124 149
   #endif
125 150
 
126
-#elif ENABLED(FYSETC_242_OLED_12864)
127
-
128
-  // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER
151
+#elif ENABLED(U8GLIB_SH1106_EINSTART)
129 152
 
130
-  #define FORCE_SOFT_SPI                                        // SW-SPI
153
+  // Connected via motherboard header
131 154
 
132
-  #if ENABLED(ALTERNATIVE_LCD)
133
-    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X                  // 4 stripes
134
-  #else
135
-    #define U8G_CLASS U8GLIB_SSD1306_128X64                     // 8 stripes
136
-  #endif
155
+  #define U8G_CLASS U8GLIB_SH1106_128X64
156
+  #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS
137 157
 
138 158
 #elif ENABLED(U8GLIB_SH1106)
139 159
 
@@ -153,34 +173,16 @@
153 173
   #define U8G_CLASS U8GLIB_SSD1309_128X64
154 174
   #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)       // I2C
155 175
 
156
-#elif ENABLED(FYSETC_MINI_12864)
157
-
158
-  // The FYSETC Mini 12864 display
159
-
160
-  #define U8G_CLASS U8GLIB_MINI12864_2X_HAL                     // 4 stripes
161
-
162
-#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
163
-
164
-  // The MKS_MINI_12864 V1/V2 aren't exact copies of the MiniPanel.
165
-  // Panel management is in u8g_dev_uc1701_mini12864_HAL.cpp with
166
-  // extra delays added to remove glitches seen with fast MCUs.
167
-
168
-  #define U8G_CLASS U8GLIB_MINI12864_2X_HAL                     // 8 stripes (HW-SPI)
176
+#elif ENABLED(U8GLIB_SSD1306)
169 177
 
170
-#elif ENABLED(MINIPANEL)
178
+  // Generic SSD1306 OLED I2C LCD
171 179
 
172 180
   #if ENABLED(ALTERNATIVE_LCD)
173
-    #define U8G_CLASS U8GLIB_MINI12864
181
+    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE       // 4 stripes
174 182
   #else
175
-    #define U8G_CLASS U8GLIB_MINI12864_2X                       // 8 stripes (HW-SPI)
183
+    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X                  // 4 stripes
176 184
   #endif
177
-
178
-#elif ENABLED(U8GLIB_SH1106_EINSTART)
179
-
180
-  // Connected via motherboard header
181
-
182
-  #define U8G_CLASS U8GLIB_SH1106_128X64
183
-  #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS
185
+  #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)
184 186
 
185 187
 #elif TFT_SCALED_DOGLCD
186 188
 

+ 3
- 3
Marlin/src/lcd/extui_anycubic_chiron_lcd.cpp View File

@@ -16,7 +16,7 @@
16 16
  * GNU General Public License for more details.
17 17
  *
18 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/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22 22
 
@@ -145,7 +145,7 @@ namespace ExtUI {
145 145
     if (rx[0] != 'A') {
146 146
       SERIAL_ECHOPGM("Unexpected RX: ");
147 147
       SERIAL_ECHOLN(rx);
148
-    
148
+
149 149
       return;
150 150
     }
151 151
 
@@ -490,7 +490,7 @@ namespace ExtUI {
490 490
   void onMediaRemoved() {
491 491
     SENDLINE_PGM("J01"); // SD Removed
492 492
   }
493
-  
493
+
494 494
   void onPlayTone(const uint16_t frequency, const uint16_t duration) {
495 495
     tone(BEEPER_PIN, frequency, duration);
496 496
   }

+ 2
- 0
Marlin/src/pins/pins.h View File

@@ -300,6 +300,8 @@
300 300
   #include "sanguino/pins_STB_11.h"             // ATmega644P, ATmega1284P                env:sanguino644p env:sanguino1284p
301 301
 #elif MB(AZTEEG_X1)
302 302
   #include "sanguino/pins_AZTEEG_X1.h"          // ATmega644P, ATmega1284P                env:sanguino644p env:sanguino1284p
303
+#elif MB(ZMIB_V2)
304
+  #include "sanguino/pins_ZMIB_V2.h"            // ATmega644P, ATmega1284P                env:sanguino_atmega644p env:sanguino_atmega1284p
303 305
 
304 306
 //
305 307
 // Other ATmega644P, ATmega644, ATmega1284P

+ 234
- 0
Marlin/src/pins/sanguino/pins_ZMIB_V2.h View File

@@ -0,0 +1,234 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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
+#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__)
25
+  #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'"
26
+#endif
27
+
28
+#define BOARD_INFO_NAME   "Zonestar ZMIB_V2"
29
+#define BOARD_WEBSITE_URL "https://www.aliexpress.com/item/32957490744.html"
30
+
31
+#define IS_ZMIB_V2
32
+
33
+/**
34
+ * ZMIB pin assignments
35
+ *
36
+ * The ZMIB board needs a bootloader installed before Marlin can be uploaded.
37
+ * If you don't have a chip programmer you can use a spare Arduino plus a few
38
+ * electronic components to write the bootloader.
39
+ *
40
+ * See http://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/
41
+ */
42
+
43
+/**
44
+ * PIN:   0   Port: B0   HEATER_0_PIN
45
+ * PIN:   1   Port: B1   HEATER_BED_PIN
46
+ * PIN:   2   Port: B2   EXP1_4(BTN_EN2)
47
+ * PIN:   3   Port: B3   V1: SD_DETECT_PIN
48
+ * PIN:   3   Port: B3   V2: EXP1_6
49
+ * PIN:   4   Port: B4   SDSS
50
+ * PIN:   4   Port: B4   V1: EXP1_6
51
+ * PIN:   5   Port: B5   AVR_MOSI_PIN
52
+ * .                     MOSI_PIN
53
+ * PIN:   6   Port: B6   AVR_MISO_PIN
54
+ * .                     EXP1_9(MISO_PIN)
55
+ * PIN:   7   Port: B7   AVR_SCK_PIN
56
+ * .                     EXP1_10(SCK_PIN)
57
+ * PIN:   8   Port: D0   RXD
58
+ * PIN:   9   Port: D1   TXD
59
+ * PIN:  10   Port: D2   EXP1_8
60
+ * PIN:  11   Port: D3   EXP1_7
61
+ * PIN:  12   Port: D4   EXP1_5(BTN_EN1)
62
+ * PIN:  13   Port: D5   Z_MIN_PIN
63
+ * PIN:  14   Port: D6   E1_DIR_PIN
64
+ * PIN:  15   Port: D7   E1_STEP_PIN
65
+ * PIN:  16   Port: C0   Z_DIR_PIN
66
+ * PIN:  17   Port: C1   Z_STEP_PIN
67
+ * PIN:  18   Port: C2   Y_MIN_PIN
68
+ * PIN:  19   Port: C3   Y_DIR_PIN
69
+ * PIN:  20   Port: C4   Y_STEP_PIN
70
+ * PIN:  21   Port: C5   X_MIN_PIN
71
+ * PIN:  22   Port: C6   X_DIR_PIN
72
+ * PIN:  23   Port: C7   X_STEP_PIN
73
+ * PIN:  24   Port: A7   X_ENABLE_PIN
74
+ *                       Y_ENABLE_PIN
75
+ *                       Z_ENABLE_PIN
76
+ *                       E0_ENABLE_PIN
77
+ *                       E1_ENABLE_PIN
78
+ * PIN:  25   Port: A6   FIL_RUNOUT_PIN
79
+ * PIN:  26   Port: A5   E0_DIR_PIN
80
+ * PIN:  27   Port: A4   E0_STEP_PIN
81
+ * PIN:  28   Port: A3   FAN_PIN
82
+ * PIN:  29   Port: A2   EXP1_3(BTN_ENC)
83
+ *                       ADC_KEY_PIN
84
+ * PIN:  30   Port: A1   TEMP_0_PIN
85
+ * PIN:  31   Port: A0   TEMP_BED_PIN
86
+ */
87
+
88
+//
89
+// Limit Switches
90
+//
91
+#define X_MIN_PIN                             21
92
+#define Y_MIN_PIN                             18
93
+
94
+#if EITHER(Z6S_ZFAULT, Z6BS_ZFAULT)
95
+  #define Z_MIN_PIN                           25
96
+#else
97
+  #define Z_MIN_PIN                           13
98
+#endif
99
+
100
+//
101
+// Steppers
102
+//
103
+#define X_STEP_PIN                            23
104
+#define X_DIR_PIN                             22
105
+#define X_ENABLE_PIN                          24
106
+
107
+#define Y_STEP_PIN                            20
108
+#define Y_DIR_PIN                             19
109
+#define Y_ENABLE_PIN                          24
110
+
111
+#if EITHER(Z6S_ZFAULT, Z6BS_ZFAULT)
112
+  #define Z_STEP_PIN                          27
113
+  #define Z_DIR_PIN                           26
114
+#else
115
+  #define Z_STEP_PIN                          17
116
+  #define Z_DIR_PIN                           16
117
+#endif
118
+
119
+#define Z_ENABLE_PIN                          24
120
+
121
+#if EITHER(Z6S_ZFAULT, Z6BS_ZFAULT)
122
+  #define E0_STEP_PIN                         15
123
+  #define E0_DIR_PIN                          14
124
+#else
125
+  #define E0_STEP_PIN                         27
126
+  #define E0_DIR_PIN                          26
127
+#endif
128
+
129
+#define E0_ENABLE_PIN                         24
130
+
131
+#define E1_STEP_PIN                           15
132
+#define E1_DIR_PIN                            14
133
+#define E1_ENABLE_PIN                         24
134
+
135
+//
136
+// Temperature Sensors
137
+//
138
+#define TEMP_0_PIN                             1  // Analog Input
139
+#define TEMP_BED_PIN                           0  // Analog Input
140
+
141
+//
142
+// Heaters / Fans
143
+//
144
+#define HEATER_0_PIN                           0
145
+#define HEATER_BED_PIN                         1
146
+#define FAN_PIN                               28
147
+#define FAN1_PIN                              -1
148
+
149
+//
150
+//filament run out sensor
151
+//
152
+#if EITHER(Z6S_ZFAULT, Z6BS_ZFAULT)
153
+  #define FIL_RUNOUT_PIN                      13
154
+#else
155
+  #define FIL_RUNOUT_PIN                      25  // Z-MIN
156
+#endif
157
+
158
+//
159
+// SD card
160
+//
161
+#if ENABLED(SDSUPPORT)
162
+  #define SDSS                                 4
163
+#endif
164
+#define SD_DETECT_PIN                         -1
165
+
166
+/*===================================================
167
+ * ZMIB Version 1 - EXP1 Connector
168
+ *   MOSI(D5)  TX1(D11)  ENA(D12)  ENC(D29/A2) 5V
169
+ *   SCK(D7)   RX1(D10)  SCS(D4)   ENB(D2)     GND
170
+ *===================================================
171
+ * ZMIB Version 2 - EXP1 Connector
172
+ *   MOSI(D5)  TX1(D11)  ENA(D12)  ENC(D29/A2) 5V
173
+ *   SCK(D7)   RX1(D10)  SCS(D3)   ENB(D2)     GND
174
+ *===================================================
175
+ * LCD 128x64
176
+ *==================================================*/
177
+
178
+#if ENABLED(ZONESTAR_12864LCD)
179
+  //
180
+  // LCD 128x64
181
+  //
182
+  #define LCDSCREEN_NAME  "ZONESTAR_12864LCD"
183
+  #define FORCE_SOFT_SPI
184
+  //#define LCD_SDSS                          11
185
+  #define LCD_PINS_RS                         11  // ST7920_CS_PIN    LCD_PIN_RS    (PIN4 of LCD module)
186
+  #ifdef IS_ZMIB_V2
187
+    #define LCD_PINS_ENABLE                    3  // ST7920_DAT_PIN LCD_PIN_R/W   (PIN5 of LCD module)
188
+  #else
189
+    #define LCD_PINS_ENABLE                    4  // ST7920_DAT_PIN LCD_PIN_R/W   (PIN5 of LCD module)
190
+  #endif
191
+  #define LCD_PINS_D4                         10  // ST7920_CLK_PIN LCD_PIN_ENABLE (PIN6 of LCD module)
192
+
193
+  // Alter timing for graphical display
194
+  #define ST7920_DELAY_1             DELAY_2_NOP
195
+  #define ST7920_DELAY_2             DELAY_2_NOP
196
+  #define ST7920_DELAY_3             DELAY_2_NOP
197
+
198
+#elif EITHER(ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306)
199
+  //
200
+  // OLED 128x64
201
+  //
202
+  #define LCDSCREEN_NAME "ZONESTAR 12864OLED"
203
+  #define FORCE_SOFT_SPI
204
+  #ifdef IS_ZMIB_V2
205
+    #define LCD_PINS_RS                        3  // RESET
206
+  #else
207
+    #define LCD_PINS_RS                        4  // RESET
208
+  #endif
209
+  #define LCD_PINS_DC                         10  // DC
210
+  #define DOGLCD_CS                           11  // CS
211
+  #if ENABLED(OLED_HW_IIC)
212
+    #error "Oops! can't choose HW IIC for ZMIB board!!"
213
+  #elif ENABLED(OLED_HW_SPI)
214
+    // HW SPI
215
+    #define DOGLCD_A0                LCD_PINS_DC  // A0 = DC
216
+  #else
217
+    // SW SPI
218
+    #define DOGLCD_A0                LCD_PINS_DC  // A0 = DC
219
+    #define DOGLCD_MOSI             AVR_MOSI_PIN  // SDA
220
+    #define DOGLCD_SCK               AVR_SCK_PIN  // SCK
221
+  #endif
222
+
223
+#endif
224
+
225
+//
226
+// All the above are also RRDSC with rotary encoder
227
+//
228
+#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
229
+  #define BTN_EN1                              2
230
+  #define BTN_EN2                             12
231
+  #define BTN_ENC                             29
232
+  #define BEEPER_PIN                          -1
233
+  #define KILL_PIN                            -1
234
+#endif

+ 9
- 2
Marlin/src/sd/Sd2Card.cpp View File

@@ -240,8 +240,15 @@ bool Sd2Card::init(const uint8_t sckRateID, const pin_t chipSelectPin) {
240 240
   watchdog_refresh(); // In case init takes too long
241 241
 
242 242
   // Set pin modes
243
-  extDigitalWrite(chipSelectPin_, HIGH);  // For some CPUs pinMode can write the wrong data so init desired data value first
244
-  pinMode(chipSelectPin_, OUTPUT);        // Solution for #8746 by @benlye
243
+  #if ENABLED(ZONESTAR_12864OLED)
244
+    if (chipSelectPin_ != DOGLCD_CS) {
245
+      SET_OUTPUT(DOGLCD_CS);
246
+      WRITE(DOGLCD_CS, HIGH);
247
+    }
248
+  #else
249
+    extDigitalWrite(chipSelectPin_, HIGH);  // For some CPUs pinMode can write the wrong data so init desired data value first
250
+    pinMode(chipSelectPin_, OUTPUT);        // Solution for #8746 by @benlye
251
+  #endif
245 252
   spiBegin();
246 253
 
247 254
   // Set SCK rate for initialization commands

+ 0
- 1
platformio.ini View File

@@ -869,7 +869,6 @@ board           = genericSTM32F103VE
869 869
 platform_packages = tool-stm32duino
870 870
 extra_scripts   = ${common.extra_scripts}
871 871
   buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
872
-lib_deps        = ${common_stm32f1.lib_deps}
873 872
 build_flags     = ${common_stm32f1.build_flags}
874 873
   -DMCU_STM32F103VE -DSS_TIMER=4
875 874
 debug_tool      = jlink

Loading…
Cancel
Save