Prusa MINI Firmware overview
pins_BIGTREE_SKR_MINI_V1_1.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 TARGET_STM32F1
25  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26 #endif
27 
28 #define BOARD_INFO_NAME "BIGTREE SKR Mini 1.1"
29 
30 //#define DISABLE_DEBUG
31 #define DISABLE_JTAG
32 
33 // Ignore temp readings during development.
34 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
35 
36 #ifdef MCU_STM32F103RE
37  #define STM32_FLASH_SIZE (512 * 1024)
38 #else
39  #define STM32_FLASH_SIZE (256 * 1024)
40 #endif
41 
42 #define FLASH_EEPROM_EMULATION
43 #define EEPROM_PAGE_SIZE (0x800) // 2KB
44 #define EEPROM_START_ADDRESS (0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
45 #define E2END (EEPROM_PAGE_SIZE - 1)
46 
47 //
48 // Limit Switches
49 //
50 #define X_MIN_PIN PC2
51 #define X_MAX_PIN PA2
52 #define Y_MIN_PIN PC1
53 #define Y_MAX_PIN PA1
54 #define Z_MIN_PIN PC0
55 #define Z_MAX_PIN PC3
56 
57 //
58 // Steppers
59 //
60 
61 #define X_STEP_PIN PC6
62 #define X_DIR_PIN PC7
63 #define X_ENABLE_PIN PB15
64 
65 #define Y_STEP_PIN PB13
66 #define Y_DIR_PIN PB14
67 #define Y_ENABLE_PIN PB12
68 
69 #define Z_STEP_PIN PB10
70 #define Z_DIR_PIN PB11
71 #define Z_ENABLE_PIN PB2
72 
73 #define E0_STEP_PIN PC5
74 #define E0_DIR_PIN PB0
75 #define E0_ENABLE_PIN PC4
76 
77 #if ENABLED(TMC_USE_SW_SPI)
78  #ifndef TMC_SW_MOSI
79  #define TMC_SW_SCK PB3
80  #endif
81  #ifndef TMC_SW_MISO
82  #define TMC_SW_MISO PB4
83  #endif
84  #ifndef TMC_SW_SCK
85  #define TMC_SW_MOSI PB5
86  #endif
87 #endif
88 
89 //
90 // Heaters / Fans
91 //
92 #define HEATER_0_PIN PA8
93 #define FAN_PIN PC8
94 #define HEATER_BED_PIN PC9
95 
96 //
97 // Temperature Sensors
98 //
99 #define TEMP_BED_PIN PB1 // Analog Input
100 #define TEMP_0_PIN PA0 // Analog Input
101 
102 //
103 // LCD Pins
104 //
105 
106 /**
107  * _____ _____
108  * NC | · · | GND 5V | · · | GND
109  * RESET | · · | PB9 (SD_DETECT) (LCD_D7) PC14 | · · | PC15 (LCD_D6)
110  * (MOSI) PB5 | · · | PB8 (BTN_EN2) (LCD_D5) PB7 | · · | PC13 (LCD_D4)
111  * (SD_SS) PA15 | · · | PD2 (BTN_EN1) (LCD_RS) PC12 | · · | PB6 (LCD_EN)
112  * (SCK) PB3 | · · | PB4 (MISO) (BTN_ENC) PC11 | · · | PC10 (BEEPER)
113  * ----- -----
114  * EXP2 EXP1
115  */
116 
117 #if HAS_SPI_LCD
118  #define BEEPER_PIN PC10
119  #define BTN_ENC PC11
120 
121  #if ENABLED(CR10_STOCKDISPLAY)
122  #define LCD_PINS_RS PC15
123 
124  #define BTN_EN1 PB6
125  #define BTN_EN2 PC13
126 
127  #define LCD_PINS_ENABLE PC14
128  #define LCD_PINS_D4 PB7
129 
130  #else
131 
132  #define LCD_PINS_RS PC12
133 
134  #define BTN_EN1 PD2
135  #define BTN_EN2 PB8
136 
137  #define LCD_PINS_ENABLE PB6
138 
139  #if ENABLED(FYSETC_MINI_12864)
140 
141  #define LCD_BACKLIGHT_PIN -1
142  #define LCD_RESET_PIN PC13
143  #define DOGLCD_A0 PC12
144  #define DOGLCD_CS PB6
145  #define DOGLCD_SCK PB3
146  #define DOGLCD_MOSI PB5
147 
148  #define FORCE_SOFT_SPI // SPI MODE3
149 
150  #define LED_PIN PB7 // red pwm
151  //#define LED_PIN PC15 // green
152  //#define LED_PIN PC14 // blue
153 
154  //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
155  // #ifndef RGB_LED_R_PIN
156  // #define RGB_LED_R_PIN PB7
157  // #endif
158  // #ifndef RGB_LED_G_PIN
159  // #define RGB_LED_G_PIN PC15
160  // #endif
161  // #ifndef RGB_LED_B_PIN
162  // #define RGB_LED_B_PIN PC14
163  // #endif
164  //#elif ENABLED(FYSETC_MINI_12864_2_1)
165  // #define NEOPIXEL_PIN PB7
166  //#endif
167 
168  #else // !FYSETC_MINI_12864
169 
170  #define LCD_PINS_D4 PC13
171  #if ENABLED(ULTIPANEL)
172  #define LCD_PINS_D5 PB7
173  #define LCD_PINS_D6 PC15
174  #define LCD_PINS_D7 PC14
175  #endif
176 
177  #endif // !FYSETC_MINI_12864
178 
179  #endif
180 
181 #endif // HAS_SPI_LCD
182 
183 //
184 // SD Card
185 //
186 
187 // By default the onboard SD is enabled.
188 // set SDCARD_CONNECTION form 'ONBOARD' to 'LCD' and use an external SD (connected to LCD)
189 #define HAS_ONBOARD_SD
190 #ifndef SDCARD_CONNECTION
191  #define SDCARD_CONNECTION ONBOARD
192 #endif
193 
194 #if SD_CONNECTION_IS(LCD)
195  #define ENABLE_SPI3
196  #define SD_DETECT_PIN PB9
197  #define SCK_PIN PB3
198  #define MISO_PIN PB4
199  #define MOSI_PIN PB5
200  #define SS_PIN PA15
201 #elif SD_CONNECTION_IS(ONBOARD)
202  #define ENABLE_SPI1
203  #define SD_DETECT_PIN PA3
204  #define SCK_PIN PA5
205  #define MISO_PIN PA6
206  #define MOSI_PIN PA7
207  #define SS_PIN PA4
208 #endif
209 #define ON_BOARD_SPI_DEVICE 1 //SPI1
210 #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
211 
212 #ifndef ST7920_DELAY_1
213  #define ST7920_DELAY_1 DELAY_NS(125)
214 #endif
215 #ifndef ST7920_DELAY_2
216  #define ST7920_DELAY_2 DELAY_NS(125)
217 #endif
218 #ifndef ST7920_DELAY_3
219  #define ST7920_DELAY_3 DELAY_NS(125)
220 #endif
221