Преглед изворни кода

Update BIQU SKR V1.1 pins, add TMC2130 settings (#13166)

* Remove untested displays add TMC2130 configs.
* Remove references to the ReARM, delete untested displays. Add TMC2130 settings. Cleanup spacing, etc.
Andy Shaw пре 6 година
родитељ
комит
84fc400aba
1 измењених фајлова са 161 додато и 122 уклоњено
  1. 161
    122
      Marlin/src/pins/pins_BIQU_SKR_V1.1.h

+ 161
- 122
Marlin/src/pins/pins_BIQU_SKR_V1.1.h Прегледај датотеку

@@ -65,9 +65,9 @@
65 65
 // Temperature Sensors
66 66
 //  3.3V max when defined as an analog input
67 67
 //
68
-#define TEMP_BED_PIN       0   // A0 (T0) - (67) - TEMP_BED_PIN
69
-#define TEMP_0_PIN         1   // A1 (T1) - (68) - TEMP_0_PIN
70
-#define TEMP_1_PIN         2   // A2 (T2) - (69) - TEMP_1_PIN
68
+#define TEMP_BED_PIN       0   // Analog Input
69
+#define TEMP_0_PIN         1   // Analog Input
70
+#define TEMP_1_PIN         2   // Analog Input
71 71
 
72 72
 //
73 73
 // Heaters / Fans
@@ -81,123 +81,34 @@
81 81
 #define FAN_PIN            P2_03
82 82
 #define HEATER_BED_PIN     P2_05
83 83
 
84
-//
85
-// Misc. Functions
86
-//
87
-#define SDSS               P1_23   // (53)
88
-
89 84
 /**
90 85
  * LCD / Controller
86
+ * 
87
+ * As of 20 JAN 2019 only the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER display has
88
+ * been tested with these settings. It can be connected to the SKR using standard cables
89
+ * via the EXP1 and EXP2 ports. Other displays may need a custom cable and/or changes to
90
+ * the pins defined below.
91 91
  *
92
- * All controllers can use J3 and J5 on the Re-ARM board.  Custom cabling will be required.
93
- */
94
-
95
-/**
96
- * Smart LCD adapter
97
- *
98
- * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
99
- * REPRAP_DISCOUNT_SMART_CONTROLLER.  It can't be used for controllers that use
100
- * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
101
- * is needed to pick up 5V for the EXP1 connection.
102
- *
103
- * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
104
- * on the LCD display during accesses of the SD card. The menus/code has been arranged so
105
- * that the garbage/lines are erased immediately after the SD card accesses are completed.
92
+ * The SD card on the LCD controller uses the same SPI signals as the LCD, resulting in
93
+ * garbage/lines on the LCD display during SD card access. The LCD code mitigates this
94
+ * by redrawing the screen after SD card accesses.
106 95
  */
107 96
 
108 97
 #if ENABLED(ULTRA_LCD)
109
-
110
-  #if ENABLED(CR10_STOCKDISPLAY)
111
-
112
-    // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3.
113
-    // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one
114
-    // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3.
115
-    // Requires REVERSE_ENCODER_DIRECTION in Configuration.h
116
-
117
-    #define BEEPER_PIN     P2_11   // J3-3 & AUX-4
118
-
119
-    #define BTN_EN1        P0_16   // J3-7 & AUX-4
120
-    #define BTN_EN2        P1_23   // J3-5 & AUX-4
121
-    #define BTN_ENC        P3_25   // J3-4 & AUX-4
122
-
123
-    #define LCD_PINS_RS    P0_15   // J3-9 & AUX-4 (CS)
124
-    #define LCD_PINS_ENABLE P0_18  // J3-10 & AUX-3 (SID, MOSI)
125
-    #define LCD_PINS_D4    P2_06   // J3-8 & AUX-3 (SCK, CLK)
126
-
127
-  #else
128
-
129
-    #define BEEPER_PIN     P1_30   // (37) not 5V tolerant
130
-
131
-    #define BTN_EN1        P3_26   // (31) J3-2 & AUX-4
132
-    #define BTN_EN2        P3_25   // (33) J3-4 & AUX-4
133
-    #define BTN_ENC        P2_11   // (35) J3-3 & AUX-4
134
-
135
-    #define SD_DETECT_PIN  P1_31   // (49) not 5V tolerant   J3-1 & AUX-3
136
-    #define KILL_PIN       P1_22   // (41) J5-4 & AUX-4
137
-    #define LCD_PINS_RS    P0_16   // (16) J3-7 & AUX-4
138
-    #define LCD_SDSS       P0_16   // (16) J3-7 & AUX-4
139
-
140
-    #if ENABLED(REPRAPWORLD_KEYPAD)
141
-      #define SHIFT_OUT    P0_18   // (51)  (MOSI) J3-10 & AUX-3
142
-      #define SHIFT_CLK    P0_15   // (52)  (SCK)  J3-9 & AUX-3
143
-      #define SHIFT_LD     P1_31   // (49)  not 5V tolerant   J3-1 & AUX-3
144
-    #elif DISABLED(NEWPANEL)
145
-      //#define SHIFT_CLK  P3_26   // (31)  J3-2 & AUX-4
146
-      //#define SHIFT_LD   P3_25   // (33)  J3-4 & AUX-4
147
-      //#define SHIFT_OUT  P2_11   // (35)  J3-3 & AUX-4
148
-      //#define SHIFT_EN   P1_22   // (41)  J5-4 & AUX-4
149
-    #endif
150
-
151
-    #if ENABLED(VIKI2) || ENABLED(miniVIKI)
152
-      // #define LCD_SCREEN_ROT_180
153
-
154
-      #define BTN_EN1      P3_26   // (31) J3-2 & AUX-4
155
-      #define BTN_EN2      P3_25   // (33) J3-4 & AUX-4
156
-      #define BTN_ENC      P2_11   // (35) J3-3 & AUX-4
157
-
158
-      #define SD_DETECT_PIN P1_31  // (49) not 5V tolerant   J3-1 & AUX-3
159
-      #define KILL_PIN     P1_22   // (41) J5-4 & AUX-4
160
-
161
-      #define DOGLCD_CS    P0_16   // (16)
162
-      #define DOGLCD_A0    P2_06   // (59) J3-8 & AUX-2
163
-      #define DOGLCD_SCK   SCK_PIN
164
-      #define DOGLCD_MOSI  MOSI_PIN
165
-
166
-      #define STAT_LED_BLUE_PIN   P0_26   // (63)  may change if cable changes
167
-      #define STAT_LED_RED_PIN    P1_21   // ( 6)  may change if cable changes
168
-    #else
169
-      #define DOGLCD_CS    P0_26   // (63) J5-3 & AUX-2
170
-      #define DOGLCD_A0    P2_06   // (59) J3-8 & AUX-2
171
-      #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
172
-      #define LCD_PINS_ENABLE P0_18   // (51) (MOSI) J3-10 & AUX-3
173
-      #define LCD_PINS_D4  P0_15   // (52) (SCK)  J3-9 & AUX-3
174
-      #if ENABLED(ULTIPANEL)
175
-        #define LCD_PINS_D5 P1_17  // (71) ENET_MDIO
176
-        #define LCD_PINS_D6 P1_14  // (73) ENET_RX_ER
177
-        #define LCD_PINS_D7 P1_10  // (75) ENET_RXD1
178
-      #endif
179
-    #endif
180
-
181
-    //#define MISO_PIN      P0_17   // (50)  system defined J3-10 & AUX-3
182
-    //#define MOSI_PIN      P0_18   // (51)  system defined J3-10 & AUX-3
183
-    //#define SCK_PIN       P0_15   // (52)  system defined J3-9 & AUX-3
184
-    //#define SS_PIN        P1_23   // (53)  system defined J3-5 & AUX-3 - sometimes called SDSS
185
-
186
-    #if ENABLED(MINIPANEL)
187
-      // GLCD features
188
-      //#define LCD_CONTRAST   190
189
-      // Uncomment screen orientation
190
-      //#define LCD_SCREEN_ROT_90
191
-      //#define LCD_SCREEN_ROT_180
192
-      //#define LCD_SCREEN_ROT_270
193
-    #endif
194
-
195
-  #endif
196
-
197
-#endif // ULTRA_LCD
98
+  #define BEEPER_PIN       P1_30
99
+  #define BTN_EN1          P3_26
100
+  #define BTN_EN2          P3_25
101
+  #define BTN_ENC          P2_11
102
+
103
+  #define SD_DETECT_PIN    P1_31
104
+  #define LCD_SDSS         P1_23
105
+  #define LCD_PINS_RS      P0_16
106
+  #define LCD_PINS_ENABLE  P0_18
107
+  #define LCD_PINS_D4      P0_15
108
+#endif
198 109
 
199 110
 //
200
-// SD Support (as with the AZTEEG_X5_MINI_WIFI)
111
+// SD Support
201 112
 //
202 113
 //#define USB_SD_DISABLED     // Disable host access to SD card as mass storage device through USB
203 114
 #define USB_SD_ONBOARD        // Enable host access to SD card as mass storage device through USB
@@ -209,11 +120,11 @@
209 120
 
210 121
 #if ENABLED(LPC_SD_LCD)
211 122
 
212
-  #define SCK_PIN            P0_15
213
-  #define MISO_PIN           P0_17
214
-  #define MOSI_PIN           P0_18
215
-  #define SS_PIN             P1_23   // Chip select for SD card used by Marlin
216
-  #define ONBOARD_SD_CS      P0_06   // Chip select for "System" SD card
123
+  #define SCK_PIN          P0_15
124
+  #define MISO_PIN         P0_17
125
+  #define MOSI_PIN         P0_18
126
+  #define SS_PIN           P1_23   // Chip select for SD card used by Marlin
127
+  #define ONBOARD_SD_CS    P0_06   // Chip select for "System" SD card
217 128
 
218 129
 #elif ENABLED(LPC_SD_ONBOARD)
219 130
 
@@ -223,10 +134,138 @@
223 134
     #define SHARED_SD_CARD
224 135
     #undef SD_DETECT_PIN // there is also no detect pin for the onboard card
225 136
   #endif
226
-  #define SCK_PIN            P0_07
227
-  #define MISO_PIN           P0_08
228
-  #define MOSI_PIN           P0_09
229
-  #define SS_PIN             P0_06   // Chip select for SD card used by Marlin
230
-  #define ONBOARD_SD_CS      P0_06   // Chip select for "System" SD card
137
+  #define SCK_PIN          P0_07
138
+  #define MISO_PIN         P0_08
139
+  #define MOSI_PIN         P0_09
140
+  #define SS_PIN           P0_06   // Chip select for SD card used by Marlin
141
+  #define ONBOARD_SD_CS    P0_06   // Chip select for "System" SD card
142
+
143
+#endif
144
+
145
+// Trinamic driver support
146
+
147
+#if HAS_TRINAMIC
148
+  // Using TMC devices in intelligent mode requires extra connections to each device. Unfortunately
149
+  // the SKR does not have many free pins (especially if a display is in use). The SPI-based devices
150
+  // will require 3 connections (clock, mosi, miso), plus a chip select line (CS) for each driver.
151
+  // The UART-based devices require 2 pis per deriver (one of which must be interrupt capable).
152
+  // The same SPI pins can be shared with the display/SD card reader, meaning SPI-based devices are
153
+  // probably a good choice for this board.
154
+  //
155
+  // SOFTWARE_DRIVER_ENABLE is a good option. It uses SPI to control the driver enable and allows the
156
+  // hardware ENABLE pins for each driver to be repurposed as SPI chip select. To use this mode the
157
+  // driver modules will probably need to be modified, removing the pin used for the enable line from
158
+  // the module and wiring this connection directly to GND (as is the case for TMC2130).
159
+  // Using this option and sharing all of the SPI pins allows 5 TMC2130 drivers to be used along with
160
+  // a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER without requiring the use of any extra pins.
161
+  //
162
+  // Other options will probably require the use of any free pins and the TFT serial port or a
163
+  // different type of display (like the TFT), using the pins normally used for the display and encoder.
164
+  // Unfortunately, tests show it's not possible to use endstop and thermistor pins for chip-select.
165
+  // Sample settings are provided below, but only some have been tested.
166
+  //
167
+  // Another option is to share the enable and chip-select pins when using SPI. Several users have
168
+  // reported that this works. However, it's unlikely that this configuration will allow SPI communi-
169
+  // cation with the device when the drivers are active, meaning that some of the more advanced TMC
170
+  // options may not be available.
171
+
172
+  // When using any TMC SPI-based drivers, software SPI is used
173
+  // because pins may be shared with the display or SD card.
174
+  #define TMC_USE_SW_SPI
175
+  #define TMC_SW_MOSI       P0_18
176
+  #define TMC_SW_MISO       P0_17
177
+  // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
178
+  #define TMC_SW_SCK        P0_15
179
+  // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
180
+  //#define TMC_SW_SCK        P2_06
181
+
182
+  #if ENABLED(SOFTWARE_DRIVER_ENABLE)
183
+
184
+    // Software enable allows the enable pins to be repurposed as chip-select pins.
185
+    // Note: Requires the driver modules to be modified to always be enabled with the enable pin removed.
186
+    #if AXIS_DRIVER_TYPE_X(TMC2130)
187
+      #define X_CS_PIN         P4_28
188
+      #undef  X_ENABLE_PIN
189
+      #define X_ENABLE_PIN     -1
190
+    #endif
191
+
192
+    #if AXIS_DRIVER_TYPE_Y(TMC2130)
193
+      #define Y_CS_PIN         P2_00
194
+      #undef  Y_ENABLE_PIN
195
+      #define Y_ENABLE_PIN     -1
196
+    #endif
197
+
198
+    #if AXIS_DRIVER_TYPE_Z(TMC2130)
199
+      #define Z_CS_PIN         P0_19
200
+      #undef  Z_ENABLE_PIN
201
+      #define Z_ENABLE_PIN     -1
202
+    #endif
203
+
204
+    #if AXIS_DRIVER_TYPE_E0(TMC2130)
205
+      #define E0_CS_PIN        P2_12
206
+      #undef  E0_ENABLE_PIN
207
+      #define E0_ENABLE_PIN    -1
208
+    #endif
209
+
210
+
211
+    #if AXIS_DRIVER_TYPE_E1(TMC2130)
212
+      #define E1_CS_PIN        P0_10
213
+      #undef  E1_ENABLE_PIN
214
+      #define E1_ENABLE_PIN    -1
215
+    #endif
216
+
217
+  #else // !SOFTWARE_DRIVER_ENABLE
218
+
219
+    // A chip-select pin is needed for each driver.
220
+
221
+    // EXAMPLES
222
+
223
+    // Example 1: No LCD attached or a TFT style display using the AUX header RX/TX pins.
224
+    //            LPC_SD_LCD must not be enabled. Nothing should be connected to EXP1/EXP2.
225
+    //#define SKR_USE_LCD_PINS_FOR_CS
226
+    #if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
227
+      #if ENABLED(LPC_SD_LCD)
228
+        #error "LPC_SD_LCD must not be enabled with SKR_USE_LCD_PINS_FOR_CS."
229
+      #endif
230
+      #define X_CS_PIN      P1_23
231
+      #define Y_CS_PIN      P3_26
232
+      #define Z_CS_PIN      P2_11
233
+      #define E0_CS_PIN     P3_25
234
+      #define E1_CS_PIN     P1_31
235
+    #endif
236
+
237
+    // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
238
+    //            The SD card reader attached to the LCD (if present) can't be used because
239
+    //            the pins will be in use. So LPC_SD_LCD must not be defined.
240
+    //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
241
+    #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
242
+      #if ENABLED(LPC_SD_LCD)
243
+        #error "LPC_SD_LCD must not be enabled with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
244
+      #endif
245
+      #define X_CS_PIN      P0_02
246
+      #define Y_CS_PIN      P0_03
247
+      #define Z_CS_PIN      P2_06
248
+      // We use SD_DETECT_PIN for E0
249
+      #undef SD_DETECT_PIN
250
+      #define E0_CS_PIN     P1_31
251
+      // We use LCD_SDSS pin for E1
252
+      #undef  LCD_SDSS
253
+      #define LCD_SDSS      -1
254
+      #define E1_CS_PIN     P1_23
255
+    #endif
256
+
257
+    // Example 3: Use the driver enable pins for chip-select.
258
+    //            Commands must not be sent to the drivers when enabled. So certain
259
+    //            advanced features (like driver monitoring) will not be available.
260
+    //#define SKR_USE_ENABLE_CS
261
+    #if ENABLED(SKR_USE_ENABLE_FOR_CS)
262
+      #define X_CS_PIN      X_ENABLE_PIN
263
+      #define Y_CS_PIN      Y_ENABLE_PIN
264
+      #define Z_CS_PIN      Z_ENABLE_PIN
265
+      #define E0_CS_PIN     E0_ENABLE_PIN
266
+      #define E1_CS_PIN     E1_ENABLE_PIN
267
+    #endif
268
+
269
+  #endif // SOFTWARE_DRIVER_ENABLE
231 270
 
232 271
 #endif

Loading…
Откажи
Сачувај