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