Browse Source

Merge pull request #4277 from thinkyhead/rc_mks_13_viki2

Support for VIKI2 with MKS 1.3 / 1.4
Scott Lahteine 8 years ago
parent
commit
9766e24504
3 changed files with 114 additions and 39 deletions
  1. 84
    2
      Marlin/pins_MKS_13.h
  2. 24
    35
      Marlin/pins_RAMPS_14.h
  3. 6
    2
      Marlin/ultralcd.cpp

+ 84
- 2
Marlin/pins_MKS_13.h View File

@@ -37,6 +37,88 @@
37 37
 #define HEATER_1_PIN        7 // EXTRUDER 2 (-1 on RAMPS 1.4)
38 38
 
39 39
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
40
-  //#undef SD_DETECT_PIN
41
-  //#define SD_DETECT_PIN 49  // For easy adapter board
40
+  /**
41
+   * VIKI2 Has two groups of wires with...
42
+   *
43
+   * +Vin     + Input supply, requires 120ma for LCD and mSD card
44
+   * GND      Ground Pin
45
+   * MOSI     Data input for LCD and SD
46
+   * MISO     Data output for SD
47
+   * SCK      Clock for LCD and SD
48
+   * AO       Reg. Sel for LCD
49
+   * LCS      Chip Select for LCD
50
+   * SDCS     Chip Select for SD
51
+   * SDCD     Card Detect pin for SD
52
+   * ENCA     Encoder output A
53
+   * ENCB     Encoder output B
54
+   * ENCBTN   Encoder button switch
55
+   *
56
+   * BTN      Panel mounted button switch
57
+   * BUZZER   Piezo buzzer
58
+   * BLUE-LED Blue LED ring pin (3 to 5v, mosfet buffered)
59
+   * RED-LED  Red LED ring pin (3 to 5v, mosfet buffered)
60
+   *
61
+   * This configuration uses the following arrangement:
62
+   *
63
+   * EXP1 D37 = EN2   D35 = EN1     EXP2 D50 = MISO  D52 = SCK
64
+   *      D17 = BLUE  D16 = RED          D31 = ENC   D53 = SDCS
65
+   *      D23 = KILL  D25 = BUZZ         D33 = ---   D51 = MOSI
66
+   *      D27 = A0    D29 = LCS          D49 = SDCD  RST = ---
67
+   *      GND = GND   5V  = 5V           GND = ---   D41 = ---
68
+   */
69
+
70
+  #undef BTN_EN1
71
+  #undef BTN_EN2
72
+  #undef BTN_ENC
73
+  #undef DOGLCD_A0
74
+  #undef DOGLCD_CS
75
+  #undef SD_DETECT_PIN
76
+  #undef BEEPER_PIN
77
+  #undef KILL_PIN
78
+
79
+  //
80
+  // VIKI2 12-wire lead
81
+  //
82
+
83
+  // orange/white         SDCD
84
+  #define SD_DETECT_PIN   49
85
+
86
+  // white                ENCA
87
+  #define BTN_EN1         35
88
+
89
+  // green                ENCB
90
+  #define BTN_EN2         37
91
+
92
+  // purple               ENCBTN
93
+  #define BTN_ENC         31
94
+
95
+  // brown                A0
96
+  #define DOGLCD_A0       27
97
+
98
+  // green/white          LCS
99
+  #define DOGLCD_CS       29
100
+
101
+                       // 50    gray   MISO
102
+                       // 51    yellow MOSI
103
+                       // 52    orange SCK
104
+
105
+  // blue                 SDCS
106
+  //#define SDSS            53
107
+
108
+  //
109
+  // VIKI2 4-wire lead
110
+  //
111
+
112
+  // blue                 BTN
113
+  #define KILL_PIN        23
114
+
115
+  // green                BUZZER
116
+  #define BEEPER_PIN      25
117
+
118
+  // yellow               RED-LED
119
+  #define STAT_LED_RED    16
120
+
121
+  // white                BLUE-LED
122
+  #define STAT_LED_BLUE   17
123
+
42 124
 #endif

+ 24
- 35
Marlin/pins_RAMPS_14.h View File

@@ -141,22 +141,30 @@
141 141
 
142 142
 #if ENABLED(ULTRA_LCD)
143 143
 
144
+  #if ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
145
+    #define LCD_PINS_RS 40
146
+    #define LCD_PINS_ENABLE 42
147
+    #define LCD_PINS_D4 65
148
+    #define LCD_PINS_D5 66
149
+    #define LCD_PINS_D6 44
150
+    #define LCD_PINS_D7 64
151
+  #else
152
+    #define BEEPER_PIN 33
153
+    #define LCD_PINS_RS 16
154
+    #define LCD_PINS_ENABLE 17
155
+    #define LCD_PINS_D4 23
156
+    #define LCD_PINS_D5 25
157
+    #define LCD_PINS_D6 27
158
+    #define LCD_PINS_D7 29
159
+    // Buttons are attached to a shift register
160
+    // Not wired yet
161
+    //#define SHIFT_CLK 38
162
+    //#define SHIFT_LD 42
163
+    //#define SHIFT_OUT 40
164
+    //#define SHIFT_EN 17
165
+  #endif
166
+
144 167
   #if ENABLED(NEWPANEL)
145
-    #if ENABLED(PANEL_ONE)
146
-      #define LCD_PINS_RS 40
147
-      #define LCD_PINS_ENABLE 42
148
-      #define LCD_PINS_D4 65
149
-      #define LCD_PINS_D5 66
150
-      #define LCD_PINS_D6 44
151
-      #define LCD_PINS_D7 64
152
-    #else
153
-      #define LCD_PINS_RS 16
154
-      #define LCD_PINS_ENABLE 17
155
-      #define LCD_PINS_D4 23
156
-      #define LCD_PINS_D5 25
157
-      #define LCD_PINS_D6 27
158
-      #define LCD_PINS_D7 29
159
-    #endif
160 168
 
161 169
     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
162 170
       #define BEEPER_PIN 37
@@ -272,26 +280,7 @@
272 280
       #endif
273 281
 
274 282
     #endif
275
-  #else // !NEWPANEL (Old-style panel with shift register)
276
-
277
-    // No Beeper added
278
-    #define BEEPER_PIN 33
279
-
280
-    // Buttons are attached to a shift register
281
-    // Not wired yet
282
-    //#define SHIFT_CLK 38
283
-    //#define SHIFT_LD 42
284
-    //#define SHIFT_OUT 40
285
-    //#define SHIFT_EN 17
286
-
287
-    #define LCD_PINS_RS 16
288
-    #define LCD_PINS_ENABLE 17
289
-    #define LCD_PINS_D4 23
290
-    #define LCD_PINS_D5 25
291
-    #define LCD_PINS_D6 27
292
-    #define LCD_PINS_D7 29
293
-
294
-  #endif // !NEWPANEL
283
+  #endif // NEWPANEL
295 284
 
296 285
 #endif // ULTRA_LCD
297 286
 

+ 6
- 2
Marlin/ultralcd.cpp View File

@@ -184,9 +184,10 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
184 184
     static void menu_action_sddirectory(const char* filename, char* longFilename);
185 185
   #endif
186 186
 
187
-  #define ENCODER_FEEDRATE_DEADZONE 10
188
-
189 187
   #if DISABLED(LCD_I2C_VIKI)
188
+    #ifndef ENCODER_FEEDRATE_DEADZONE
189
+      #define ENCODER_FEEDRATE_DEADZONE 10
190
+    #endif
190 191
     #ifndef ENCODER_STEPS_PER_MENU_ITEM
191 192
       #define ENCODER_STEPS_PER_MENU_ITEM 5
192 193
     #endif
@@ -194,6 +195,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
194 195
       #define ENCODER_PULSES_PER_STEP 1
195 196
     #endif
196 197
   #else
198
+    #ifndef ENCODER_FEEDRATE_DEADZONE
199
+      #define ENCODER_FEEDRATE_DEADZONE 4
200
+    #endif
197 201
     #ifndef ENCODER_STEPS_PER_MENU_ITEM
198 202
       #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
199 203
     #endif

Loading…
Cancel
Save