Prusa MINI Firmware overview
pins_FORMBOT_TREX2PLUS.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  * Formbot pin assignments
26  */
27 
28 #ifndef __AVR_ATmega2560__
29  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30 #elif HOTENDS > 2 || E_STEPPERS > 2
31  #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 #endif
33 
34 #define BOARD_INFO_NAME "Formbot"
35 #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
36 
37 //
38 // Servos
39 //
40 #define SERVO0_PIN 11
41 #define SERVO1_PIN -1 // was 6
42 #define SERVO2_PIN -1 // was 5
43 #define SERVO3_PIN -1
44 
45 //
46 // Limit Switches
47 //
48 #define X_MIN_PIN 3
49 #ifndef X_MAX_PIN
50  #define X_MAX_PIN 2
51 #endif
52 #define Y_MIN_PIN 14
53 #define Y_MAX_PIN 15
54 #define Z_MIN_PIN 18
55 #define Z_MAX_PIN 19
56 
57 //
58 // Z Probe (when not Z_MIN_PIN)
59 //
60 #ifndef Z_MIN_PROBE_PIN
61  #define Z_MIN_PROBE_PIN 32
62 #endif
63 
64 //
65 // Steppers
66 //
67 #define X_STEP_PIN 54
68 #define X_DIR_PIN 55
69 #define X_ENABLE_PIN 38
70 #ifndef X_CS_PIN
71  #define X_CS_PIN 53
72 #endif
73 
74 #define Y_STEP_PIN 60
75 #define Y_DIR_PIN 61
76 #define Y_ENABLE_PIN 56
77 #ifndef Y_CS_PIN
78  #define Y_CS_PIN 49
79 #endif
80 
81 #define Z_STEP_PIN 46
82 #define Z_DIR_PIN 48
83 #define Z_ENABLE_PIN 62
84 #ifndef Z_CS_PIN
85  #define Z_CS_PIN 40
86 #endif
87 
88 #define E0_STEP_PIN 26
89 #define E0_DIR_PIN 28
90 #define E0_ENABLE_PIN 24
91 #ifndef E0_CS_PIN
92  #define E0_CS_PIN 42
93 #endif
94 
95 #define E1_STEP_PIN 36
96 #define E1_DIR_PIN 34
97 #define E1_ENABLE_PIN 30
98 #ifndef E1_CS_PIN
99  #define E1_CS_PIN 44
100 #endif
101 
102 #define E2_STEP_PIN 42
103 #define E2_DIR_PIN 43
104 #define E2_ENABLE_PIN 44
105 
106 //
107 // Temperature Sensors
108 //
109 #define TEMP_0_PIN 13 // Analog Input
110 #define TEMP_1_PIN 15 // Analog Input
111 #define TEMP_BED_PIN 3 // Analog Input
112 
113 // SPI for Max6675 or Max31855 Thermocouple
114 #if DISABLED(SDSUPPORT)
115  #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card
116 #else
117  #define MAX6675_SS_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
118 #endif
119 
120 //
121 // Augmentation for auto-assigning RAMPS plugs
122 //
123 #if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
124  #if HOTENDS > 1
125  #if TEMP_SENSOR_BED
126  #define IS_RAMPS_EEB
127  #else
128  #define IS_RAMPS_EEF
129  #endif
130  #elif TEMP_SENSOR_BED
131  #define IS_RAMPS_EFB
132  #else
133  #define IS_RAMPS_EFF
134  #endif
135 #endif
136 
137 //
138 // Heaters / Fans
139 //
140 #define HEATER_0_PIN 10
141 #define HEATER_1_PIN 7
142 #define HEATER_BED_PIN 58
143 
144 #define FAN_PIN 9
145 
146 #if HAS_FILAMENT_SENSOR
147  #define FIL_RUNOUT_PIN 4
148  //#define FIL_RUNOUT2_PIN -1
149 #else
150  // Though defined as a fan pin, it is utilized as a dedicated laser pin by Formbot.
151  #define FAN1_PIN 4
152 #endif
153 
154 //
155 // Misc. Functions
156 //
157 #define SDSS 53
158 #ifndef LED_PIN
159  #define LED_PIN 13 // The Formbot v 1 board has almost no unassigned pins on it. The Board's LED
160 #endif // is a good place to get a signal to control the Max7219 LED Matrix.
161 
162 // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
163 #define FILWIDTH_PIN 5 // Analog Input
164 
165 #ifndef PS_ON_PIN
166  #define PS_ON_PIN 12
167 #endif
168 
169 #define CASE_LIGHT_PIN 8
170 
171 //
172 // LCD / Controller
173 //
174 // Formbot only supports REPRAP_DISCOUNT_SMART_CONTROLLER
175 //
176 #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
177  #ifndef BEEPER_PIN
178  #define BEEPER_PIN 37
179  #endif
180  #define BTN_EN1 31
181  #define BTN_EN2 33
182  #define BTN_ENC 35
183  #define SD_DETECT_PIN 49
184 
185  // Allow MAX7219 to steal the KILL pin
186  #if !defined(KILL_PIN) && MAX7219_CLK_PIN != 41 && MAX7219_DIN_PIN != 41 && MAX7219_LOAD_PIN != 41
187  #define KILL_PIN 41
188  #endif
189 
190  #define LCD_PINS_RS 16
191  #define LCD_PINS_ENABLE 17
192  #define LCD_PINS_D4 23
193  #define LCD_PINS_D5 25
194  #define LCD_PINS_D6 27
195  #define LCD_PINS_D7 29
196 #endif