Prusa MINI Firmware overview
pins_MKS_ROBIN.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  * MKS Robin (STM32F130ZET6) board pin assignments
26  *
27  * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
28  */
29 
30 #ifndef __STM32F1__
31  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
32 #elif HOTENDS > 2 || E_STEPPERS > 2
33  #error "MKS Robin supports up to 2 hotends / E-steppers. Comment out this line to continue."
34 #endif
35 
36 #define BOARD_INFO_NAME "MKS Robin"
37 
38 //
39 // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
40 //
41 #define DISABLE_JTAG
42 
43 //
44 // Servos
45 //
46 #define SERVO0_PIN PC3 // XS1 - 5
47 #define SERVO1_PIN PA1 // XS1 - 6
48 #define SERVO2_PIN PF9 // XS2 - 5
49 #define SERVO3_PIN PF8 // XS2 - 6
50 
51 //
52 // Limit Switches
53 //
54 #define X_MIN_PIN PB12
55 #define X_MAX_PIN PB0
56 #define Y_MIN_PIN PC5
57 #define Y_MAX_PIN PC4
58 #define Z_MIN_PIN PA4
59 #define Z_MAX_PIN PF7
60 
61 //
62 // Steppers
63 //
64 #define X_ENABLE_PIN PB9
65 #define X_STEP_PIN PB8
66 #define X_DIR_PIN PB5
67 
68 #define Y_ENABLE_PIN PB4
69 #define Y_STEP_PIN PG15
70 #define Y_DIR_PIN PG10
71 
72 #define Z_ENABLE_PIN PD7
73 #define Z_STEP_PIN PD3
74 #define Z_DIR_PIN PG14
75 
76 #define E0_ENABLE_PIN PG13
77 #define E0_STEP_PIN PG8
78 #define E0_DIR_PIN PA15
79 
80 #define E1_ENABLE_PIN PA12
81 #define E1_STEP_PIN PA11
82 #define E1_DIR_PIN PA8
83 
84 //
85 // Temperature Sensors
86 //
87 #define TEMP_0_PIN PC1 // TH1
88 #define TEMP_1_PIN PC2 // TH2
89 #define TEMP_BED_PIN PC0 // TB1
90 
91 //
92 // Heaters / Fans
93 //
94 #define HEATER_0_PIN PC7 // HEATER1
95 #define HEATER_1_PIN PA6 // HEATER2
96 #define HEATER_BED_PIN PC6 // HOT BED
97 
98 #define FAN_PIN PA7 // FAN
99 
100 /**
101  * Note: MKS Robin board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
102  */
103 //#define MAX6675_SS_PIN PE5 // TC1 - CS1
104 //#define MAX6675_SS_PIN PE6 // TC2 - CS2
105 
106 #define POWER_LOSS_PIN PA2 // PW_DET
107 #define PS_ON_PIN PA3 // PW_OFF
108 #define FIL_RUNOUT_PIN PF11 // MT_DET
109 
110 #define BEEPER_PIN PC13
111 #define LED_PIN PB2
112 
113 /**
114  * Note: MKS Robin TFT screens use various TFT controllers. Supported screens
115  * are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for
116  * other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
117  *
118  * If the screen stays white, disable 'LCD_RESET_PIN'
119  * to let the bootloader init the screen.
120  *
121  * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
122  * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
123  */
124 //#define LCD_RESET_PIN PF6
125 #define LCD_BACKLIGHT_PIN PG11
126 #define FSMC_CS_PIN PG12 // NE4
127 #define FSMC_RS_PIN PF0 // A0
128 
129 #if ENABLED(TOUCH_BUTTONS)
130  #define TOUCH_CS_PIN PB1 // SPI2_NSS
131  #define TOUCH_SCK_PIN PB13 // SPI2_SCK
132  #define TOUCH_MISO_PIN PB14 // SPI2_MISO
133  #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
134 #endif
135 
136 // SPI1(PA7) & SPI3(PB5) not available
137 #define ENABLE_SPI2
138 
139 #if ENABLED(SDIO_SUPPORT)
140  #define SCK_PIN PB13 // SPI2
141  #define MISO_PIN PB14 // SPI2
142  #define MOSI_PIN PB15 // SPI2
143  #define SS_PIN -1 // PB12 is X-
144  #define SD_DETECT_PIN PF12 // SD_CD
145 #else
146  // SD as custom software SPI (SDIO pins)
147  #define SCK_PIN PC12
148  #define MISO_PIN PC8
149  #define MOSI_PIN PD2
150  #define SS_PIN -1
151  #define ONBOARD_SD_CS_PIN PC11
152  #define SDSS PD2
153  #define SD_DETECT_PIN -1
154 #endif