Prusa MINI Firmware overview
pins_STM3R_MINI.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 #if !defined(__STM32F1__) && !defined(__STM32F4__)
25  #error "Oops! Select an STM32F1/4 board in 'Tools > Board.'"
26 #endif
27 
28 /**
29  * 21017 Victor Perez Marlin for stm32f1 test
30  */
31 
32 #define BOARD_INFO_NAME "STM3R Mini"
33 #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
34 
35 // Enable I2C_EEPROM for testing
36 #define I2C_EEPROM
37 
38 // Ignore temp readings during development.
39 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
40 
41 //
42 // Limit Switches
43 //
44 #define X_STOP_PIN PD0
45 #define Y_STOP_PIN PD1
46 #define Z_STOP_PIN PD4
47 
48 //
49 // Steppers
50 //
51 #define X_STEP_PIN PE1
52 #define X_DIR_PIN PE0
53 #define X_ENABLE_PIN PC0
54 
55 #define Y_STEP_PIN PE3
56 #define Y_DIR_PIN PE2
57 #define Y_ENABLE_PIN PC1
58 
59 #define Z_STEP_PIN PE5
60 #define Z_DIR_PIN PE4
61 #define Z_ENABLE_PIN PC2
62 
63 #define E0_STEP_PIN PE7
64 #define E0_DIR_PIN PE6
65 #define E0_ENABLE_PIN PC3
66 
67 #define E1_STEP_PIN PE9
68 #define E1_DIR_PIN PE8
69 #define E1_ENABLE_PIN PC4
70 
71 #define E2_STEP_PIN PE11
72 #define E2_DIR_PIN PE10
73 #define E2_ENABLE_PIN PC5
74 
75 //
76 // Misc. Functions
77 //
78 #define SDSS PA15
79 #define LED_PIN PB2
80 
81 //
82 // Heaters / Fans
83 //
84 #define HEATER_0_PIN PD12 // EXTRUDER 1
85 //#define HEATER_1_PIN PD13
86 
87 #define HEATER_BED_PIN PB9 // BED
88 //#define HEATER_BED2_PIN -1 // BED2
89 //#define HEATER_BED3_PIN -1 // BED3
90 
91 #ifndef FAN_PIN
92  #define FAN_PIN PD14
93 #endif
94 #define FAN1_PIN PD13
95 
96 #define FAN_SOFT_PWM
97 
98 //
99 // Temperature Sensors
100 //
101 #define TEMP_BED_PIN PA0
102 #define TEMP_0_PIN PA1
103 #define TEMP_1_PIN PA2
104 #define TEMP_2_PIN PA3
105 
106 // Laser control
107 #if HAS_CUTTER
108  #define SPINDLE_LASER_PWM_PIN PB8
109  #define SPINDLE_LASER_ENA_PIN PD5
110 #endif
111 
112 //
113 // LCD Pins
114 //
115 #if HAS_SPI_LCD
116 
117  #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
118  #define LCD_PINS_RS 49 // CS chip select /SS chip slave select
119  #define LCD_PINS_ENABLE 51 // SID (MOSI)
120  #define LCD_PINS_D4 52 // SCK (CLK) clock
121  #elif BOTH(NEWPANEL, PANEL_ONE)
122  #define LCD_PINS_RS PB8
123  #define LCD_PINS_ENABLE PD2
124  #define LCD_PINS_D4 PB12
125  #define LCD_PINS_D5 PB13
126  #define LCD_PINS_D6 PB14
127  #define LCD_PINS_D7 PB15
128  #else
129  #define LCD_PINS_RS PB8
130  #define LCD_PINS_ENABLE PD2
131  #define LCD_PINS_D4 PB12
132  #define LCD_PINS_D5 PB13
133  #define LCD_PINS_D6 PB14
134  #define LCD_PINS_D7 PB15
135  #if DISABLED(NEWPANEL)
136  #define BEEPER_PIN 33
137  // Buttons attached to a shift register
138  // Not wired yet
139  //#define SHIFT_CLK 38
140  //#define SHIFT_LD 42
141  //#define SHIFT_OUT 40
142  //#define SHIFT_EN 17
143  #endif
144  #endif
145 
146  #if ENABLED(TOUCH_BUTTONS)
147 
148  #define TOUCH_CS_PIN PB12 // SPI2_NSS
149  #define TOUCH_SCK_PIN PB13
150  #define TOUCH_MOSI_PIN PB14
151  #define TOUCH_MISO_PIN PB15
152  #define TOUCH_INT_PIN PC6 // (PenIRQ coming from ADS7843)
153 
154  #elif ENABLED(NEWPANEL)
155 
156  #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
157 
158  #define BEEPER_PIN 37
159 
160  #define BTN_EN1 31
161  #define BTN_EN2 33
162  #define BTN_ENC 35
163 
164  #define SD_DETECT_PIN 49
165  #define KILL_PIN 41
166 
167  #if ENABLED(BQ_LCD_SMART_CONTROLLER)
168  #define LCD_BACKLIGHT_PIN 39
169  #endif
170 
171  #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
172 
173  #define BTN_EN1 64
174  #define BTN_EN2 59
175  #define BTN_ENC 63
176  #define SD_DETECT_PIN 42
177 
178  #elif ENABLED(LCD_I2C_PANELOLU2)
179 
180  #define BTN_EN1 47
181  #define BTN_EN2 43
182  #define BTN_ENC 32
183  #define LCD_SDSS 53
184  #define SD_DETECT_PIN -1
185  #define KILL_PIN 41
186 
187  #elif ENABLED(LCD_I2C_VIKI)
188 
189  #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
190  #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
191 
192  #define BTN_ENC -1
193  #define LCD_SDSS 53
194  #define SD_DETECT_PIN 49
195 
196  #elif ANY(VIKI2, miniVIKI)
197 
198  #define BEEPER_PIN 33
199 
200  // Pins for DOGM SPI LCD Support
201  #define DOGLCD_A0 44
202  #define DOGLCD_CS 45
203  #define LCD_SCREEN_ROT_180
204 
205  #define BTN_EN1 22
206  #define BTN_EN2 7
207  #define BTN_ENC 39
208 
209  #define SDSS 53
210  #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board
211 
212  #define KILL_PIN 31
213 
214  #define STAT_LED_RED_PIN 32
215  #define STAT_LED_BLUE_PIN 35
216 
217  #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
218 
219  #define BTN_EN1 35
220  #define BTN_EN2 37
221  #define BTN_ENC 31
222  #define SD_DETECT_PIN 49
223  #define LCD_SDSS 53
224  #define KILL_PIN 41
225  #define BEEPER_PIN 23
226  #define DOGLCD_CS 29
227  #define DOGLCD_A0 27
228  #define LCD_BACKLIGHT_PIN 33
229 
230  #elif ENABLED(MINIPANEL)
231 
232  #define BEEPER_PIN 42
233  // Pins for DOGM SPI LCD Support
234  #define DOGLCD_A0 44
235  #define DOGLCD_CS 66
236  #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
237  #define SDSS 53
238 
239  #define KILL_PIN 64
240  // GLCD features
241  // Uncomment screen orientation
242  //#define LCD_SCREEN_ROT_90
243  //#define LCD_SCREEN_ROT_180
244  //#define LCD_SCREEN_ROT_270
245  // The encoder and click button
246  #define BTN_EN1 40
247  #define BTN_EN2 63
248  #define BTN_ENC 59
249  // not connected to a pin
250  #define SD_DETECT_PIN 49
251 
252  #else
253 
254  // Beeper on AUX-4
255  #define BEEPER_PIN 33
256 
257  // Buttons directly attached to AUX-2
258  #if ENABLED(REPRAPWORLD_KEYPAD)
259  #define BTN_EN1 64
260  #define BTN_EN2 59
261  #define BTN_ENC 63
262  #define SHIFT_OUT 40
263  #define SHIFT_CLK 44
264  #define SHIFT_LD 42
265  #elif ENABLED(PANEL_ONE)
266  #define BTN_EN1 59 // AUX2 PIN 3
267  #define BTN_EN2 63 // AUX2 PIN 4
268  #define BTN_ENC 49 // AUX3 PIN 7
269  #else
270  #define BTN_EN1 37
271  #define BTN_EN2 35
272  #define BTN_ENC 31
273  #endif
274 
275  #if ENABLED(G3D_PANEL)
276  #define SD_DETECT_PIN 49
277  #define KILL_PIN 41
278  #else
279  //#define SD_DETECT_PIN -1 // Ramps doesn't use this
280  #endif
281 
282  #endif
283  #endif // NEWPANEL
284 
285 #endif // HAS_SPI_LCD