Prusa MINI Firmware overview
pins_RAMPS_FD_V1.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  * RAMPS-FD
26  *
27  * No EEPROM
28  * Use 4k7 thermistor tables
29  */
30 
31 #ifndef __SAM3X8E__
32  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
33 #endif
34 
35 #ifndef BOARD_INFO_NAME
36  #define BOARD_INFO_NAME "RAMPS-FD v1"
37 #endif
38 
39 #define INVERTED_HEATER_PINS
40 #define INVERTED_BED_PINS
41 #define INVERTED_FAN_PINS
42 
43 //
44 // Servos
45 //
46 #define SERVO0_PIN 7
47 #define SERVO1_PIN 6
48 #define SERVO2_PIN 5
49 #define SERVO3_PIN 3
50 
51 //
52 // Limit Switches
53 //
54 #define X_MIN_PIN 22
55 #define X_MAX_PIN 30
56 #define Y_MIN_PIN 24
57 #define Y_MAX_PIN 38
58 #define Z_MIN_PIN 26
59 #define Z_MAX_PIN 34
60 
61 //
62 // Steppers
63 //
64 #define X_STEP_PIN 63
65 #define X_DIR_PIN 62
66 #define X_ENABLE_PIN 48
67 #ifndef X_CS_PIN
68  #define X_CS_PIN 68
69 #endif
70 
71 #define Y_STEP_PIN 65
72 #define Y_DIR_PIN 64
73 #define Y_ENABLE_PIN 46
74 #ifndef Y_CS_PIN
75  #define Y_CS_PIN 60
76 #endif
77 
78 #define Z_STEP_PIN 67
79 #define Z_DIR_PIN 66
80 #define Z_ENABLE_PIN 44
81 #ifndef Z_CS_PIN
82  #define Z_CS_PIN 58
83 #endif
84 
85 #define E0_STEP_PIN 36
86 #define E0_DIR_PIN 28
87 #define E0_ENABLE_PIN 42
88 #ifndef E0_CS_PIN
89  #define E0_CS_PIN 67
90 #endif
91 
92 #define E1_STEP_PIN 43
93 #define E1_DIR_PIN 41
94 #define E1_ENABLE_PIN 39
95 #ifndef E1_CS_PIN
96  #define E1_CS_PIN 61
97 #endif
98 
99 #define E2_STEP_PIN 32
100 #define E2_DIR_PIN 47
101 #define E2_ENABLE_PIN 45
102 #ifndef E2_CS_PIN
103  #define E2_CS_PIN 59
104 #endif
105 
106 //
107 // Temperature Sensors
108 //
109 #define TEMP_0_PIN 1 // Analog Input
110 #define TEMP_1_PIN 2 // Analog Input
111 #define TEMP_2_PIN 3 // Analog Input
112 #define TEMP_BED_PIN 0 // Analog Input
113 
114 // SPI for Max6675 or Max31855 Thermocouple
115 #if DISABLED(SDSUPPORT)
116  #define MAX6675_SS_PIN 53
117 #else
118  #define MAX6675_SS_PIN 49
119 #endif
120 
121 //
122 // Heaters / Fans
123 //
124 #define HEATER_0_PIN 9
125 #define HEATER_1_PIN 10
126 #define HEATER_2_PIN 11
127 #define HEATER_BED_PIN 8
128 
129 #ifndef FAN_PIN
130  #define FAN_PIN 12
131 #endif
132 
133 //
134 // Misc. Functions
135 //
136 #define SDSS 4
137 #define LED_PIN 13
138 
139 //
140 // LCD / Controller
141 //
142 #if HAS_SPI_LCD
143  // ramps-fd lcd adaptor
144 
145  #define BEEPER_PIN 37
146  #define BTN_EN1 33
147  #define BTN_EN2 31
148  #define BTN_ENC 35
149  #define SD_DETECT_PIN 49
150 
151  #if ENABLED(NEWPANEL)
152  #define LCD_PINS_RS 16
153  #define LCD_PINS_ENABLE 17
154  #endif
155 
156  #if ENABLED(FYSETC_MINI_12864)
157  #define DOGLCD_CS LCD_PINS_ENABLE
158  #define DOGLCD_A0 LCD_PINS_RS
159  #define DOGLCD_SCK 76
160  #define DOGLCD_MOSI 75
161 
162  //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
163  // results in LCD soft SPI mode 3, SD soft SPI mode 0
164 
165  #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
166 
167  #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
168  #ifndef RGB_LED_R_PIN
169  #define RGB_LED_R_PIN 25
170  #endif
171  #ifndef RGB_LED_G_PIN
172  #define RGB_LED_G_PIN 27
173  #endif
174  #ifndef RGB_LED_B_PIN
175  #define RGB_LED_B_PIN 29
176  #endif
177  #elif ENABLED(FYSETC_MINI_12864_2_1)
178  #define NEOPIXEL_PIN 25
179  #endif
180 
181  #elif ENABLED(NEWPANEL)
182 
183  #define LCD_PINS_D4 23
184  #define LCD_PINS_D5 25
185  #define LCD_PINS_D6 27
186  #define LCD_PINS_D7 29
187 
188  #if ENABLED(MINIPANEL)
189  #define DOGLCD_CS 25
190  #define DOGLCD_A0 27
191  #endif
192 
193  #endif
194 
195  #if ANY(VIKI2, miniVIKI)
196  #define DOGLCD_A0 16
197  #define KILL_PIN 51
198  #define STAT_LED_BLUE_PIN 29
199  #define STAT_LED_RED_PIN 23
200  #define DOGLCD_CS 17
201  #define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI
202  #define DOGLCD_MOSI 75 // MOSI_PIN
203  #define DOGLCD_MISO 74 // MISO_PIN
204  #endif
205 
206 #endif // HAS_SPI_LCD
207 
208 #if HAS_TMC220x
209  /**
210  * TMC2208/TMC2209 stepper drivers
211  *
212  * Hardware serial communication ports.
213  * If undefined software serial is used according to the pins below
214  */
215  //#define X_HARDWARE_SERIAL Serial1
216  //#define X2_HARDWARE_SERIAL Serial1
217  //#define Y_HARDWARE_SERIAL Serial1
218  //#define Y2_HARDWARE_SERIAL Serial1
219  //#define Z_HARDWARE_SERIAL Serial1
220  //#define Z2_HARDWARE_SERIAL Serial1
221  //#define E0_HARDWARE_SERIAL Serial1
222  //#define E1_HARDWARE_SERIAL Serial1
223  //#define E2_HARDWARE_SERIAL Serial1
224  //#define E3_HARDWARE_SERIAL Serial1
225  //#define E4_HARDWARE_SERIAL Serial1
226 #endif
227 
228 //
229 // M3/M4/M5 - Spindle/Laser Control
230 //
231 #if HOTENDS < 3 && HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA)
232  #define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA
233  #define SPINDLE_LASER_PWM_PIN 12 // Hardware PWM
234  #define SPINDLE_DIR_PIN 47 // Use E2 DIR
235 #endif