Browse Source

Add RepRapDiscount Full Graphic Smart Controller support to MIGHTYBOARD REVE

Paweł Stawicki 7 years ago
parent
commit
652bedfa18
1 changed files with 111 additions and 20 deletions
  1. 111
    20
      Marlin/pins_MIGHTYBOARD_REVE.h

+ 111
- 20
Marlin/pins_MIGHTYBOARD_REVE.h View File

@@ -129,6 +129,9 @@
129 129
 #define THERMO_CS1          5 // E3
130 130
 #define THERMO_CS2          2 // E4
131 131
 
132
+#define MAX6675_SS          THERMO_CS1
133
+#define MAX6675_SCK_PIN     THERMO_SCK_PIN
134
+#define MAX6675_DO_PIN      THERMO_DO_PIN
132 135
 //
133 136
 // Augmentation for auto-assigning plugs
134 137
 //
@@ -137,7 +140,7 @@
137 140
 // With no heated bed, an additional 24V fan is possible.
138 141
 //
139 142
 #define MOSFET_A_PIN     6 // H3
140
-#define MOSFET_B_PIN     9 // B5
143
+#define MOSFET_B_PIN    11 // B5
141 144
 #define MOSFET_C_PIN    45 // L4
142 145
 #define MOSFET_D_PIN    44 // L5
143 146
 
@@ -181,8 +184,8 @@
181 184
 //
182 185
 // Extruder Auto Fan Pins
183 186
 //
184
-#define EXTRUDER_0_AUTO_FAN  7 // H4
185
-#define EXTRUDER_1_AUTO_FAN 12 // B6
187
+#define ORIG_E0_AUTO_FAN_PIN   7 // H4
188
+#define ORIG_E1_AUTO_FAN_PIN  12 // B6
186 189
 
187 190
 //
188 191
 // Misc. Functions
@@ -194,29 +197,117 @@
194 197
 //
195 198
 // LCD / Controller
196 199
 //
197
-// Replicator uses a 3-wire SR controller with HD44780
198
-// For now, pretend it's the SAV
199
-//
200
-#define SAV_3DLCD
201
-#define SR_DATA_PIN         34 // C3
202
-#define SR_CLK_PIN          35 // C2
203
-#define SR_STROBE_PIN       33 // C4
204 200
 
205
-#define BTN_UP              75 // J4
206
-#define BTN_DOWN            73 // J3
207
-#define BTN_LEFT            72 // J2
208
-#define BTN_RIGHT           14 // J1
209
-#define BTN_CENTER          15 // J0
210
-#define BTN_ENC             BTN_CENTER
201
+#ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
202
+
203
+  #define LCD_PINS_RS           33 // C4, LCD-STROBE
204
+  #define LCD_PINS_ENABLE       72 // J2, LEFT
205
+  #define LCD_PINS_D4           35 // C2, LCD-CLK
206
+  #define LCD_PINS_D5           32 // C5, RLED
207
+  #define LCD_PINS_D6           34 // C3, LCD-DATA
208
+  #define LCD_PINS_D7           31 // C6, GLED
209
+
210
+  #define BTN_EN2               75 // J4, UP
211
+  #define BTN_EN1               73 // J3, DOWN
212
+  //STOP button connected as KILL_PIN
213
+  #define KILL_PIN              14 // J1, RIGHT
214
+  //KILL - not connected
215
+
216
+  #define BEEPER_PIN             8 // H5, SD_WP
217
+
218
+  #define BTN_CENTER            15 // J0
219
+  #define BTN_ENC               BTN_CENTER
220
+
221
+  //on board leds
222
+  #define STAT_LED_RED_LED      SERVO0_PIN // C1 (1280-EX1, DEBUG2)
223
+  #define STAT_LED_BLUE_PIN     SERVO1_PIN // C0 (1280-EX2, DEBUG3)
224
+
225
+#else
226
+  // Replicator uses a 3-wire SR controller with HD44780
227
+  // For now, pretend it's the SAV
228
+  //
229
+
230
+  #define SAV_3DLCD
231
+  #define SR_DATA_PIN         34 // C3
232
+  #define SR_CLK_PIN          35 // C2
233
+  #define SR_STROBE_PIN       33 // C4
211 234
 
212
-#define BEEPER_PIN           4 // G5
235
+  #define BTN_UP              75 // J4
236
+  #define BTN_DOWN            73 // J3
237
+  #define BTN_LEFT            72 // J2
238
+  #define BTN_RIGHT           14 // J1
239
+  #define BTN_CENTER          15 // J0
240
+  #define BTN_ENC             BTN_CENTER
241
+
242
+  #define BEEPER_PIN           4 // G5
243
+
244
+  #define STAT_LED_RED_PIN    32 // C5
245
+  #define STAT_LED_BLUE_PIN   31 // C6 (Actually green)
246
+
247
+#endif
213 248
 
214
-#define STAT_LED_RED        32 // C5
215
-#define STAT_LED_BLUE       31 // C6 (Actually green)
216 249
 
217 250
 //
218 251
 // SD Card
219 252
 //
220 253
 #define SDSS                53 // B0
221
-#define SD_DETECT_PIN       30 // C7
254
+#define SD_DETECT_PIN       9  // H6
255
+
256
+#define MAX_PIN             THERMO_SCK_PIN
257
+
258
+//check if all pins are defined in mega/pins_arduino.h
259
+#include <Arduino.h>
260
+static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h"
261
+                                          "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below");
262
+
263
+/* in [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h
264
+change:
265
+#define NUM_DIGITAL_PINS            70
266
+to:
267
+#define NUM_DIGITAL_PINS            80
268
+
269
+to digital_pin_to_port_PGM add at the end:
270
+const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
271
+....
272
+        PG      , // PG 4 ** 70 **
273
+        PG      , // PG 3 ** 71 **
274
+        PJ      , // PJ 2 ** 72 **
275
+        PJ      , // PJ 3 ** 73 **
276
+        PJ      , // PJ 7 ** 74 **
277
+        PJ      , // PJ 4 ** 75 **
278
+        PJ      , // PJ 5 ** 76 **
279
+        PJ      , // PJ 6 ** 77 **
280
+        PE      , // PE 2 ** 78 **
281
+        PE      , // PE 6 ** 79 **
282
+};
283
+
284
+to digital_pin_to_bit_mask_PGM  add at the end:
285
+const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
286
+....
287
+        _BV( 4 )        , // PG 4 ** 70 **
288
+        _BV( 3 )        , // PG 3 ** 71 **
289
+        _BV( 2 )        , // PJ 2 ** 72 **
290
+        _BV( 3 )        , // PJ 3 ** 73 **
291
+        _BV( 7 )        , // PJ 7 ** 74 **
292
+        _BV( 4 )        , // PJ 4 ** 75 **
293
+        _BV( 5 )        , // PJ 5 ** 76 **
294
+        _BV( 6 )        , // PJ 6 ** 77 **
295
+        _BV( 2 )        , // PE 2 ** 78 **
296
+        _BV( 6 )        , // PE 6 ** 79 **
297
+};
222 298
 
299
+to digital_pin_to_timer_PGM add at the end:
300
+const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
301
+....
302
+        NOT_ON_TIMER    , // PG 4 ** 70 **
303
+        NOT_ON_TIMER    , // PG 3 ** 71 **
304
+        NOT_ON_TIMER    , // PJ 2 ** 72 **
305
+        NOT_ON_TIMER    , // PJ 3 ** 73 **
306
+        NOT_ON_TIMER    , // PJ 7 ** 74 **
307
+        NOT_ON_TIMER    , // PJ 4 ** 75 **
308
+        NOT_ON_TIMER    , // PJ 5 ** 76 **
309
+        NOT_ON_TIMER    , // PJ 6 ** 77 **
310
+        NOT_ON_TIMER    , // PE 2 ** 78 **
311
+        NOT_ON_TIMER    , // PE 6 ** 79 **
312
+};
313
+*/

Loading…
Cancel
Save