Prusa MINI Firmware overview
pins_FYSETC_F6_13.h
Go to the documentation of this file.
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 // FYSETC F6 pin assignments
26 //
27 
28 #ifndef __AVR_ATmega2560__
29  #error "Oops! Select 'FYSETC F6' in 'Tools > Board.'"
30 #endif
31 
32 #if ENABLED(SD_DETECT_INVERTED)
33  //#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
34 #endif
35 
36 #define BOARD_INFO_NAME "FYSETC F6 1.3"
37 
38 #define RESET_PIN 30
39 #define SPI_FLASH_CS 83
40 
41 //
42 // Servos
43 //
44 #define SERVO0_PIN 13
45 #define SERVO1_PIN 11 // (PS_ON_PIN)
46 #define SERVO2_PIN 10 // (FIL_RUNOUT_PIN)
47 #define SERVO3_PIN 4 // (RGB_LED_G_PIN)
48 
49 //
50 // Limit Switches
51 //
52 #define X_MIN_PIN 63
53 #define X_MAX_PIN 64
54 #define Y_MIN_PIN 14
55 #define Y_MAX_PIN 15
56 #define Z_MIN_PIN 12
57 #define Z_MAX_PIN 9
58 
59 #ifndef FIL_RUNOUT_PIN
60  #define FIL_RUNOUT_PIN SERVO2_PIN
61 #endif
62 
63 //
64 // Z Probe (when not Z_MIN_PIN)
65 //
66 #ifndef Z_MIN_PROBE_PIN
67  #define Z_MIN_PROBE_PIN 9 // Servos pin
68 #endif
69 
70 //
71 // Steppers
72 //
73 #define X_STEP_PIN 54
74 #define X_DIR_PIN 55
75 #define X_ENABLE_PIN 38
76 #ifndef X_CS_PIN
77  #define X_CS_PIN 70
78 #endif
79 
80 #define Y_STEP_PIN 60
81 #define Y_DIR_PIN 61
82 #define Y_ENABLE_PIN 56
83 #ifndef Y_CS_PIN
84  #define Y_CS_PIN 39
85 #endif
86 
87 #define Z_STEP_PIN 43
88 #define Z_DIR_PIN 48
89 #define Z_ENABLE_PIN 58
90 #ifndef Z_CS_PIN
91  #define Z_CS_PIN 74
92 #endif
93 
94 #define E0_STEP_PIN 26
95 #define E0_DIR_PIN 28
96 #define E0_ENABLE_PIN 24
97 #ifndef E0_CS_PIN
98  #define E0_CS_PIN 47
99 #endif
100 
101 #define E1_STEP_PIN 36
102 #define E1_DIR_PIN 34
103 #define E1_ENABLE_PIN 30
104 #ifndef E1_CS_PIN
105  #define E1_CS_PIN 32
106 #endif
107 
108 #define E2_STEP_PIN 59
109 #define E2_DIR_PIN 57
110 #define E2_ENABLE_PIN 40
111 #ifndef E2_CS_PIN
112  #define E2_CS_PIN 42
113 #endif
114 
115 //
116 // Sensorless homing DIAG pin is not directly connected to the MCU. Close
117 // the jumper next to the limit switch socket when using sensorless homing.
118 //
119 
120 #if HAS_TMC220x
121  /**
122  * TMC2208/TMC2209 stepper drivers
123  *
124  * Software serial communication pins.
125  * At the moment, F6 rx pins are not pc interrupt pins
126  */
127  #define X_SERIAL_RX_PIN -1 // 71
128  #define X_SERIAL_TX_PIN 72
129  #define Y_SERIAL_RX_PIN -1 // 73
130  #define Y_SERIAL_TX_PIN 75
131  #define Z_SERIAL_RX_PIN -1 // 78
132  #define Z_SERIAL_TX_PIN 79
133  #define E0_SERIAL_RX_PIN -1 // 76
134  #define E0_SERIAL_TX_PIN 77
135  #define E1_SERIAL_RX_PIN -1 // 80
136  #define E1_SERIAL_TX_PIN 81
137  #define E2_SERIAL_RX_PIN -1 // 22
138  #define E2_SERIAL_TX_PIN 82
139 #endif
140 
141 //
142 // Temperature Sensors
143 //
144 #define TEMP_0_PIN 12 // Analog Input
145 #define TEMP_1_PIN 13 // Analog Input
146 #define TEMP_2_PIN 14 // Analog Input
147 #define TEMP_BED_PIN 15 // Analog Input
148 
149 #ifndef FILWIDTH_PIN
150  #define FILWIDTH_PIN 9 // Analog Input on X+ endstop
151 #endif
152 
153 //
154 // Heaters / Fans
155 //
156 #define HEATER_0_PIN 5
157 #define HEATER_1_PIN 6
158 #define HEATER_2_PIN 7
159 #define HEATER_BED_PIN 8
160 
161 #define FAN_PIN 44
162 #define FAN1_PIN 45
163 #define FAN2_PIN 46
164 
165 //
166 // Misc. Functions
167 //
168 #define SDSS 53
169 #define LED_PIN 13
170 #define KILL_PIN 41
171 
172 #ifndef PS_ON_PIN
173  #define PS_ON_PIN SERVO1_PIN
174 #endif
175 
176 /**
177  * ----- -----
178  * 5V/D41 | · · | GND 5V | · · | GND
179  * RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6)
180  * (MOSI) D51 | · · | D33 (BTN_EN2) (LCD_D5) D25 | · · | D23 (LCD_D4)
181  * (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN)
182  * (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER)
183  * ----- -----
184  * EXP2 EXP1
185  */
186 
187 //
188 // LCDs and Controllers
189 //
190 #define BEEPER_PIN 37
191 #define SD_DETECT_PIN 49
192 
193 #if ENABLED(FYSETC_MINI_12864)
194  //
195  // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
196  //
197  #define DOGLCD_A0 16
198  #define DOGLCD_CS 17
199 
200  #define LCD_BACKLIGHT_PIN -1
201  #define KILL_PIN 41
202 
203  #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
204  // Seems to work best if left open.
205 
206  #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
207  #ifndef RGB_LED_R_PIN
208  #define RGB_LED_R_PIN 25
209  #endif
210  #ifndef RGB_LED_G_PIN
211  #define RGB_LED_G_PIN 27
212  #endif
213  #ifndef RGB_LED_B_PIN
214  #define RGB_LED_B_PIN 29
215  #endif
216  #elif ENABLED(FYSETC_MINI_12864_2_1)
217  #define NEOPIXEL_PIN 25
218  #endif
219 
220 #elif HAS_GRAPHICAL_LCD
221 
222  #define LCD_PINS_RS 16
223  #define LCD_PINS_ENABLE 17
224  #define LCD_PINS_D4 23
225  #define LCD_PINS_D5 25
226  #define LCD_PINS_D6 27
227  #define LCD_PINS_D7 29
228 
229  #if ENABLED(MKS_MINI_12864)
230  #define DOGLCD_CS 25
231  #define DOGLCD_A0 27
232  #endif
233 
234 #endif
235 
236 #if ENABLED(NEWPANEL)
237  #define BTN_EN1 31
238  #define BTN_EN2 33
239  #define BTN_ENC 35
240 #endif
241 
242 #ifndef RGB_LED_R_PIN
243  #define RGB_LED_R_PIN 3
244 #endif
245 #ifndef RGB_LED_G_PIN
246  #define RGB_LED_G_PIN 4
247 #endif
248 #ifndef RGB_LED_B_PIN
249  #define RGB_LED_B_PIN 9
250 #endif
251 #ifndef RGB_LED_W_PIN
252  #define RGB_LED_W_PIN -1
253 #endif