Prusa MINI Firmware overview
pins_BIGTREE_SKR_MINI_E3.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 E3"
29 
30 // Release PB3/PB4 (E0 STP/DIR) from JTAG pins
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 uint16(0x800) // 2KB
44 #define EEPROM_START_ADDRESS uint32(0x8000000 + STM32_FLASH_SIZE - 2 * EEPROM_PAGE_SIZE)
45 #undef E2END
46 #define E2END (EEPROM_PAGE_SIZE - 1) // 2KB
47 
48 //
49 // Servos
50 //
51 #define SERVO0_PIN PA1
52 
53 //
54 // Limit Switches
55 //
56 #define X_STOP_PIN PC0
57 #define Y_STOP_PIN PC1
58 #define Z_STOP_PIN PC2
59 
60 //
61 // Z Probe must be this pins
62 //
63 #define Z_MIN_PROBE_PIN PC14
64 
65 //
66 // Filament Runout Sensor
67 //
68 #ifndef FIL_RUNOUT_PIN
69  #define FIL_RUNOUT_PIN PC15
70 #endif
71 
72 //
73 // Steppers
74 //
75 #define X_ENABLE_PIN PB14
76 #define X_STEP_PIN PB13
77 #define X_DIR_PIN PB12
78 
79 #define Y_ENABLE_PIN PB11
80 #define Y_STEP_PIN PB10
81 #define Y_DIR_PIN PB2
82 
83 #define Z_ENABLE_PIN PB1
84 #define Z_STEP_PIN PB0
85 #define Z_DIR_PIN PC5
86 
87 #define E0_ENABLE_PIN PD2
88 #define E0_STEP_PIN PB3
89 #define E0_DIR_PIN PB4
90 
91 #if HAS_DRIVER(TMC2209)
92  /**
93  * TMC2209 stepper drivers
94  * Hardware serial communication ports.
95  */
96  #define X_HARDWARE_SERIAL Serial4
97  #define Y_HARDWARE_SERIAL Serial4
98  #define Z_HARDWARE_SERIAL Serial4
99  #define E0_HARDWARE_SERIAL Serial4
100 #endif
101 
102 //
103 // Temperature Sensors
104 //
105 #define TEMP_0_PIN PA0 // Analog Input
106 #define TEMP_BED_PIN PC3 // Analog Input
107 
108 //
109 // Heaters / Fans
110 //
111 #define HEATER_0_PIN PC8 // EXTRUDER
112 #define HEATER_BED_PIN PC9 // BED
113 #define FAN_PIN PA8
114 
115 //
116 // USB connect control
117 //
118 #define USB_CONNECT_PIN PC13
119 #define USB_CONNECT_INVERTING false
120 
121 #define SD_DETECT_PIN PC4
122 
123 /**
124  * _____
125  * 5V | · · | GND
126  * (LCD_EN) PB7 | · · | PB8 (LCD_RS)
127  * (LCD_D4) PB9 | · · | PA10 (BTN_EN2)
128  * RESET | · · | PA9 (BTN_EN1)
129  * (BTN_ENC) PB6 | · · | PB5 (BEEPER)
130  * -----
131  * EXP1
132  */
133 #if HAS_SPI_LCD
134  #define BEEPER_PIN PB5
135  #define BTN_ENC PB6
136 
137  #if ENABLED(CR10_STOCKDISPLAY)
138  #define LCD_PINS_RS PB8
139 
140  #define BTN_EN1 PA9
141  #define BTN_EN2 PA10
142 
143  #define LCD_PINS_ENABLE PB7
144  #define LCD_PINS_D4 PB9
145 
146  #else
147  #error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_MINI_E3."
148  #endif
149 
150 #endif // HAS_SPI_LCD
151 
152 //
153 // SD Support
154 //
155 #define HAS_ONBOARD_SD
156 
157 #ifndef SDCARD_CONNECTION
158  #define SDCARD_CONNECTION ONBOARD
159 #endif
160 
161 #define ON_BOARD_SPI_DEVICE 1 //SPI1
162 #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card