2019-07-18 12:43:49 +02:00
/**
* Marlin 3 D Printer Firmware
2020-02-03 15:00:57 +01:00
* Copyright ( c ) 2020 MarlinFirmware [ https : //github.com/MarlinFirmware/Marlin]
2019-07-18 12:43:49 +02:00
*
* Based on Sprinter and grbl .
2019-08-02 16:21:28 +02:00
* Copyright ( c ) 2011 Camiel Gubbels / Erik van der Zalm
2019-07-18 12:43:49 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2020-07-23 05:20:14 +02:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
2019-07-18 12:43:49 +02:00
*
*/
# pragma once
2020-09-23 22:06:36 +02:00
# if NOT_TARGET(TARGET_STM32F1)
2019-07-18 12:43:49 +02:00
# error "Oops! Select an STM32F1 board in 'Tools > Board.'"
# endif
2020-06-05 04:29:47 +02:00
# define BOARD_INFO_NAME "BTT SKR E3 DIP V1.0"
2019-07-18 12:43:49 +02:00
// Release PB3/PB4 (TMC_SW Pins) from JTAG pins
# define DISABLE_JTAG
// Ignore temp readings during development.
2020-08-22 08:22:14 +02:00
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
2019-07-18 12:43:49 +02:00
2020-04-29 21:46:33 +02:00
# if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
# define FLASH_EEPROM_EMULATION
2020-06-28 07:12:22 +02:00
# define EEPROM_PAGE_SIZE (0x800U) // 2KB
2020-04-29 21:46:33 +02:00
# define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
2020-05-22 09:15:40 +02:00
# define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
2020-04-29 21:46:33 +02:00
# endif
2019-09-02 09:42:11 +02:00
2019-07-18 12:43:49 +02:00
//
// Servos
//
2020-03-22 03:13:19 +01:00
# define SERVO0_PIN PA1 // SERVOS
2019-07-18 12:43:49 +02:00
//
// Limit Switches
//
2020-04-25 05:35:46 +02:00
# define X_STOP_PIN PC1 // "X-STOP"
# define Y_STOP_PIN PC0 // "Y-STOP"
# define Z_STOP_PIN PC15 // "Z-STOP"
2019-07-18 12:43:49 +02:00
//
// Z Probe must be this pin
//
2020-04-25 05:35:46 +02:00
# define Z_MIN_PROBE_PIN PC14 // "PROBE"
2019-07-18 12:43:49 +02:00
//
// Filament Runout Sensor
//
# ifndef FIL_RUNOUT_PIN
2020-04-25 05:35:46 +02:00
# define FIL_RUNOUT_PIN PC2 // "E0-STOP"
2019-07-18 12:43:49 +02:00
# endif
//
// Steppers
//
2020-03-22 03:13:19 +01:00
# define X_ENABLE_PIN PC7
# define X_STEP_PIN PC6
# define X_DIR_PIN PB15
2019-07-18 12:43:49 +02:00
# ifndef X_CS_PIN
2020-03-22 03:13:19 +01:00
# define X_CS_PIN PC10
2019-07-18 12:43:49 +02:00
# endif
2020-03-22 03:13:19 +01:00
# define Y_ENABLE_PIN PB14
# define Y_STEP_PIN PB13
# define Y_DIR_PIN PB12
2019-07-18 12:43:49 +02:00
# ifndef Y_CS_PIN
2020-03-22 03:13:19 +01:00
# define Y_CS_PIN PC11
2019-07-18 12:43:49 +02:00
# endif
2020-03-22 03:13:19 +01:00
# define Z_ENABLE_PIN PB11
# define Z_STEP_PIN PB10
# define Z_DIR_PIN PB2
2019-07-18 12:43:49 +02:00
# ifndef Z_CS_PIN
2020-03-22 03:13:19 +01:00
# define Z_CS_PIN PC12
2019-07-18 12:43:49 +02:00
# endif
2020-03-22 03:13:19 +01:00
# define E0_ENABLE_PIN PB1
# define E0_STEP_PIN PB0
# define E0_DIR_PIN PC5
2019-07-18 12:43:49 +02:00
# ifndef E0_CS_PIN
2020-03-22 03:13:19 +01:00
# define E0_CS_PIN PD2
2019-07-18 12:43:49 +02:00
# endif
//
// Software SPI pins for TMC2130 stepper drivers
//
# if ENABLED(TMC_USE_SW_SPI)
# ifndef TMC_SW_MOSI
2020-03-22 03:13:19 +01:00
# define TMC_SW_MOSI PB5
2019-07-18 12:43:49 +02:00
# endif
# ifndef TMC_SW_MISO
2020-03-22 03:13:19 +01:00
# define TMC_SW_MISO PB4
2019-07-18 12:43:49 +02:00
# endif
# ifndef TMC_SW_SCK
2020-03-22 03:13:19 +01:00
# define TMC_SW_SCK PB3
2019-07-18 12:43:49 +02:00
# endif
# endif
2020-03-17 21:05:33 +01:00
# if HAS_TMC_UART
2019-07-18 12:43:49 +02:00
/**
* TMC2208 / TMC2209 stepper drivers
*
* Hardware serial communication ports .
* If undefined software serial is used according to the pins below
*/
2020-09-24 02:45:33 +02:00
//#define X_HARDWARE_SERIAL MSerial1
//#define Y_HARDWARE_SERIAL MSerial1
//#define Z_HARDWARE_SERIAL MSerial1
//#define E0_HARDWARE_SERIAL MSerial1
2019-07-18 12:43:49 +02:00
//
// Software serial
//
2020-03-22 03:13:19 +01:00
# define X_SERIAL_TX_PIN PC10
# define X_SERIAL_RX_PIN PC10
2019-07-18 12:43:49 +02:00
2020-03-22 03:13:19 +01:00
# define Y_SERIAL_TX_PIN PC11
# define Y_SERIAL_RX_PIN PC11
2019-07-18 12:43:49 +02:00
2020-03-22 03:13:19 +01:00
# define Z_SERIAL_TX_PIN PC12
# define Z_SERIAL_RX_PIN PC12
2019-07-18 12:43:49 +02:00
2020-03-22 03:13:19 +01:00
# define E0_SERIAL_TX_PIN PD2
# define E0_SERIAL_RX_PIN PD2
2019-07-18 12:43:49 +02:00
2019-11-07 00:08:12 +01:00
// Reduce baud rate to improve software serial reliability
2020-08-22 08:22:14 +02:00
# define TMC_BAUD_RATE 19200
2019-07-18 12:43:49 +02:00
# endif
//
// Temperature Sensors
//
2020-03-22 03:13:19 +01:00
# define TEMP_0_PIN PA0 // Analog Input "TH0"
# define TEMP_BED_PIN PC3 // Analog Input "TB0"
2019-07-18 12:43:49 +02:00
//
// Heaters / Fans
//
2020-04-25 05:35:46 +02:00
# define HEATER_0_PIN PC8 // "HE"
# define HEATER_BED_PIN PC9 // "HB"
# define FAN_PIN PA8 // "FAN0"
2019-07-18 12:43:49 +02:00
//
// USB connect control
//
2020-03-22 03:13:19 +01:00
# define USB_CONNECT_PIN PC13
2020-08-22 08:22:14 +02:00
# define USB_CONNECT_INVERTING false
2019-07-18 12:43:49 +02:00
/**
* _____
2020-02-26 11:18:34 +01:00
* 5 V | 1 2 | GND
* ( LCD_EN ) PB7 | 3 4 | PB8 ( LCD_RS )
* ( LCD_D4 ) PB9 | 5 6 PA10 ( BTN_EN2 )
* RESET | 7 8 | PA9 ( BTN_EN1 )
* ( BTN_ENC ) PB6 | 9 10 | PA15 ( BEEPER )
2019-07-18 12:43:49 +02:00
* - - - - -
* EXP1
*/
2020-02-26 11:18:34 +01:00
2020-09-28 08:13:27 +02:00
# if HAS_WIRED_LCD
2019-07-18 12:43:49 +02:00
# if ENABLED(CR10_STOCKDISPLAY)
2019-11-20 06:21:27 +01:00
2020-05-13 21:22:03 +02:00
# define BEEPER_PIN PA15
2019-07-18 12:43:49 +02:00
2020-05-13 21:22:03 +02:00
# define BTN_ENC PB6
# define BTN_EN1 PA9
# define BTN_EN2 PA10
2020-04-25 05:35:46 +02:00
2020-05-13 21:22:03 +02:00
# define LCD_PINS_RS PB8
# define LCD_PINS_ENABLE PB7
# define LCD_PINS_D4 PB9
2019-07-18 12:43:49 +02:00
2020-04-25 05:35:46 +02:00
# elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
2020-06-20 01:32:05 +02:00
# error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
2020-04-25 05:35:46 +02:00
2020-05-13 21:22:03 +02:00
# define LCD_PINS_RS PB9
# define LCD_PINS_ENABLE PB6
# define LCD_PINS_D4 PB8
# define LCD_PINS_D5 PA10
# define LCD_PINS_D6 PA9
# define LCD_PINS_D7 PA15
2020-04-25 05:35:46 +02:00
# define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
2020-01-04 03:44:16 +01:00
# elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
2019-11-20 06:21:27 +01:00
/** Creality Ender-2 display pinout
* _____
2020-02-26 11:18:34 +01:00
* 5 V | 1 2 | GND
* ( MOSI ) PB7 | 3 4 | PB8 ( LCD_RS )
* ( LCD_A0 ) PB9 | 5 6 PA10 ( BTN_EN2 )
* RESET | 7 8 | PA9 ( BTN_EN1 )
* ( BTN_ENC ) PB6 | 9 10 | PA15 ( SCK )
2019-11-20 06:21:27 +01:00
* - - - - -
* EXP1
*/
2020-05-13 21:22:03 +02:00
# define BTN_ENC PB6
# define BTN_EN1 PA9
# define BTN_EN2 PA10
2020-04-25 05:35:46 +02:00
2020-05-13 21:22:03 +02:00
# define DOGLCD_CS PB8
# define DOGLCD_A0 PB9
# define DOGLCD_SCK PA15
# define DOGLCD_MOSI PB7
2019-11-20 06:21:27 +01:00
# define FORCE_SOFT_SPI
2020-03-22 03:13:19 +01:00
# define LCD_BACKLIGHT_PIN -1
2019-11-20 06:21:27 +01:00
2019-07-18 12:43:49 +02:00
# else
2020-06-16 09:43:09 +02:00
# error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and MKS_LCD12864 are currently supported on the BIGTREE_SKR_E3_DIP."
2019-07-18 12:43:49 +02:00
# endif
2020-09-28 08:13:27 +02:00
# endif // HAS_WIRED_LCD
2019-09-08 09:27:23 +02:00
2020-04-25 05:35:46 +02:00
# if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
# error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. Comment out this line to continue."
2020-05-31 06:28:16 +02:00
/** FYSETC TFT TFT81050 display pinout
2020-04-25 05:35:46 +02:00
*
* Board Display
* _____ _____
* 5 V | 1 2 | GND ( SPI1 - MISO ) MISO | 1 2 | SCK ( SPI1 - SCK )
* ( FREE ) PB7 | 3 4 | PB8 ( LCD_CS ) ( PA9 ) MOD_RESET | 3 4 | SD_CS ( PA10 )
* ( FREE ) PB9 | 5 6 PA10 ( SD_CS ) ( PB8 ) LCD_CS | 5 6 MOSI ( SPI1 - MOSI )
* RESET | 7 8 | PA9 ( MOD_RESET ) ( PA15 ) SD_DET | 7 8 | RESET
* ( BEEPER ) PB6 | 9 10 | PA15 ( SD_DET ) GND | 9 10 | 5 V
* - - - - - - - - - -
* EXP1 EXP1
*
* Needs custom cable :
*
* Board Adapter Display
* _________
* EXP1 - 1 - - - - - - - - - - - EXP1 - 10
* EXP1 - 2 - - - - - - - - - - - EXP1 - 9
* SPI1 - 4 - - - - - - - - - - - EXP1 - 6
* EXP1 - 4 - - - - - - - - - - - EXP1 - 5
* SP11 - 3 - - - - - - - - - - - EXP1 - 2
* EXP1 - 6 - - - - - - - - - - - EXP1 - 4
* EXP1 - 7 - - - - - - - - - - - EXP1 - 8
* EXP1 - 8 - - - - - - - - - - - EXP1 - 3
* SPI1 - 1 - - - - - - - - - - - EXP1 - 1
2020-04-25 18:47:19 +02:00
* EXP1 - 10 - - - - - - - - - - - EXP1 - 7
2020-04-25 05:35:46 +02:00
*/
2020-08-22 08:22:14 +02:00
# define CLCD_SPI_BUS 1 // SPI1 connector
2020-04-25 05:35:46 +02:00
2020-05-13 21:22:03 +02:00
# define BEEPER_PIN PB6
2020-04-25 05:35:46 +02:00
2020-05-13 21:22:03 +02:00
# define CLCD_MOD_RESET PA9
# define CLCD_SPI_CS PA8
2020-04-25 05:35:46 +02:00
# endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
2019-09-08 09:27:23 +02:00
//
// SD Support
//
2020-04-25 05:35:46 +02:00
2019-09-08 09:27:23 +02:00
# ifndef SDCARD_CONNECTION
2020-05-22 09:15:40 +02:00
# define SDCARD_CONNECTION ONBOARD
2019-09-08 09:27:23 +02:00
# endif
2020-04-25 05:35:46 +02:00
# if SD_CONNECTION_IS(ONBOARD)
# define SD_DETECT_PIN PC4
2020-09-28 08:52:38 +02:00
# elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
2020-05-13 21:22:03 +02:00
# define SD_DETECT_PIN PA15
# define SS_PIN PA10
2020-04-25 05:35:46 +02:00
# elif SD_CONNECTION_IS(CUSTOM_CABLE)
# error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP."
# endif
2020-09-23 22:07:34 +02:00
# define ONBOARD_SPI_DEVICE 1 // SPI1
2020-03-22 03:13:19 +01:00
# define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card