diff options
Diffstat (limited to 'Marlin/src/pins/stm32f4')
24 files changed, 5174 insertions, 0 deletions
diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h new file mode 100644 index 0000000..487080f --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -0,0 +1,222 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ + +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "Anet ET4 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Anet ET4 1.x" +#endif + +// +// EEPROM +// + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation + //#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4KB, PageSize 16B) +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#elif ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PB11 + #define IIC_EEPROM_SCL PB10 + #define EEPROM_DEVICE_ADDRESS 0xA0 + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PC13 +#define Y_STOP_PIN PE12 +#define Z_STOP_PIN PE11 + +// +// Z Probe +// +#if ENABLED(BLTOUCH) + #error "You will need to use 24V to 5V converter and remove one resistor and capacitor from the motherboard. See https://github.com/davidtgbe/Marlin/blob/bugfix-2.0.x/docs/Tutorials/bltouch-en.md for more information. Comment out this line to proceed at your own risk." + #define SERVO0_PIN PC3 +#elif !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PC3 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA2 +#endif + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PA8 +#endif + +// +// LED PIN +// +#define LED_PIN PD12 + +// +// Steppers +// +#define X_STEP_PIN PB6 +#define X_DIR_PIN PB5 +#define X_ENABLE_PIN PB7 + +#define Y_STEP_PIN PB3 +#define Y_DIR_PIN PD6 +#define Y_ENABLE_PIN PB4 + +#define Z_STEP_PIN PA12 +#define Z_DIR_PIN PA11 +#define Z_ENABLE_PIN PA15 + +#define E0_STEP_PIN PB9 +#define E0_DIR_PIN PB8 +#define E0_ENABLE_PIN PE0 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA1 +#define TEMP_BED_PIN PA4 + +// +// Heaters +// +#define HEATER_0_PIN PA0 +#define HEATER_BED_PIN PE2 + +// +// Fans +// +#define FAN_PIN PE3 // Layer fan +#define FAN1_PIN PE1 // Hotend fan + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN FAN1_PIN +#endif + +// +// LCD / Controller +// +#define TFT_RESET_PIN PE6 +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD13 +#define TFT_INTERFACE_FSMC_8BIT + +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT +#define FSMC_CS_PIN TFT_CS_PIN +#define FSMC_RS_PIN TFT_RS_PIN + +// +// Touch Screen +// https://ldm-systems.ru/f/doc/catalog/HY-TFT-2,8/XPT2046.pdf +// +#if NEED_TOUCH_PINS + #define TOUCH_CS_PIN PB2 + #define TOUCH_SCK_PIN PB0 + #define TOUCH_MOSI_PIN PE5 + #define TOUCH_MISO_PIN PE4 + #define TOUCH_INT_PIN PB1 +#endif + +#if ENABLED(ANET_ET5_TFT35) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17125 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -11307 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -26 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 337 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_PORTRAIT + #endif +#elif ENABLED(ANET_ET4_TFT28) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11838 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8776 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 333 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -17 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_PORTRAIT + #endif +#endif + +// +// SD Card +// +//#define SDIO_SUPPORT + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION CUSTOM_CABLE +#endif + +#if ENABLED(SDSUPPORT) + + #define SDIO_D0_PIN PC8 + #define SDIO_D1_PIN PC9 + #define SDIO_D2_PIN PC10 + #define SDIO_D3_PIN PC11 + #define SDIO_CK_PIN PC12 + #define SDIO_CMD_PIN PD2 + + #if DISABLED(SDIO_SUPPORT) + #define SOFTWARE_SPI + #define SDSS SDIO_D3_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN + #endif + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN PD3 + #endif + +#endif diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h new file mode 100644 index 0000000..f5ebf82 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4P.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ + +#pragma once + +#define BOARD_INFO_NAME "Anet ET4P 1.x" + +// +// TMC2208 Configuration_adv defaults for Anet ET4P-MB_V1.x +// +#if !AXIS_DRIVER_TYPE_X(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_Y(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_Z(TMC2208_STANDALONE) || !AXIS_DRIVER_TYPE_E0(TMC2208_STANDALONE) + #error "ANET_ET4P requires ([XYZ]|E0)_DRIVER_TYPE set to TMC2208_STANDALONE." +#endif + +#include "pins_ANET_ET4.h" diff --git a/Marlin/src/pins/stm32f4/pins_ARMED.h b/Marlin/src/pins/stm32f4/pins_ARMED.h new file mode 100644 index 0000000..db57db1 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_ARMED.h @@ -0,0 +1,229 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ + +// https://github.com/ktand/Armed + +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Arm'ed supports up to 2 hotends / E-steppers." +#endif + +#ifndef ARMED_V1_0 + #define ARMED_V1_1 +#endif + +#undef BOARD_INFO_NAME // Defined on the command line by Arduino Core STM32 +#define BOARD_INFO_NAME "Arm'ed" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +// +// Limit Switches +// +#define X_STOP_PIN PE0 +#define Y_STOP_PIN PE1 +#define Z_STOP_PIN PE14 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PA4 +//#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA3 +#endif + +// +// Steppers +// + +#ifdef ARMED_SWAP_X_E1 + #define X_STEP_PIN PE4 + #define X_DIR_PIN PE2 + #define X_ENABLE_PIN PE3 + #define X_CS_PIN PE5 +#else + #define X_STEP_PIN PD3 + #define X_DIR_PIN PD2 + #define X_ENABLE_PIN PD0 + #define X_CS_PIN PD1 +#endif + +#define Y_STEP_PIN PE11 +#define Y_DIR_PIN PE10 +#define Y_ENABLE_PIN PE13 +#define Y_CS_PIN PE12 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD7 +#define Z_ENABLE_PIN PD4 +#define Z_CS_PIN PD5 + +#define E0_STEP_PIN PB5 +#define E0_DIR_PIN PB6 +#ifdef ARMED_V1_1 + #define E0_ENABLE_PIN PC12 +#else + #define E0_ENABLE_PIN PB3 +#endif +#define E0_CS_PIN PB4 + +#ifdef ARMED_SWAP_X_E1 + #define E1_STEP_PIN PD3 + #define E1_DIR_PIN PD2 + #define E1_ENABLE_PIN PD0 + #define E1_CS_PIN PD1 +#else + #define E1_STEP_PIN PE4 + #define E1_DIR_PIN PE2 + #define E1_ENABLE_PIN PE3 + #define E1_CS_PIN PE5 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN PC1 // Analog Input +#define TEMP_BED_PIN PC2 // Analog Input + +#if HOTENDS == 1 && TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN PC1 +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 // Hardware PWM +#define HEATER_1_PIN PA2 // Hardware PWM +#define HEATER_BED_PIN PA0 // Hardware PWM + +#define FAN_PIN PC6 // Hardware PWM, Part cooling fan +#define FAN1_PIN PC7 // Hardware PWM, Extruder fan +#define FAN2_PIN PC8 // Hardware PWM, Controller fan + +// +// Misc functions +// +#define SDSS PE7 +#define LED_PIN PB7 // Heart beat +#define PS_ON_PIN PA10 +#define KILL_PIN PA8 +#define PWR_LOSS PA4 // Power loss / nAC_FAULT + +// +// LCD / Controller +// +#define SD_DETECT_PIN PA15 +#define BEEPER_PIN PC9 + +#if ENABLED(FYSETC_MINI_12864) + // + // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // + #define DOGLCD_A0 PE9 + #define DOGLCD_CS PE8 + + #define LCD_BACKLIGHT_PIN -1 + + #define LCD_RESET_PIN PB12 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB13 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB14 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB15 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PB13 + #endif +#else + #define LCD_PINS_RS PE9 + #define LCD_PINS_ENABLE PE8 + #define LCD_PINS_D4 PB12 + #define LCD_PINS_D5 PB13 + #define LCD_PINS_D6 PB14 + #define LCD_PINS_D7 PB15 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS PB13 + #define DOGLCD_A0 PB14 + #endif +#endif + +#define BTN_EN1 PC4 +#define BTN_EN2 PC5 +#define BTN_ENC PC3 + +// +// Extension pins +// +#define EXT0_PIN PB0 +#define EXT1_PIN PB1 +#define EXT2_PIN PB2 +#define EXT3_PIN PD8 +#define EXT4_PIN PD9 +#define EXT5_PIN PD10 +#define EXT6_PIN PD11 +#define EXT7_PIN PD12 +#define EXT8_PIN PB10 +#define EXT9_PIN PB11 + +#if HAS_TMC_UART + // TMC2208/TMC2209 stepper drivers + // + // Software serial + // + #define X_SERIAL_TX_PIN EXT0_PIN + #define X_SERIAL_RX_PIN EXT0_PIN + + #define Y_SERIAL_TX_PIN EXT1_PIN + #define Y_SERIAL_RX_PIN EXT1_PIN + + #define Z_SERIAL_TX_PIN EXT2_PIN + #define Z_SERIAL_RX_PIN EXT2_PIN + + #define E0_SERIAL_TX_PIN EXT3_PIN + #define E0_SERIAL_RX_PIN EXT3_PIN + + #define E1_SERIAL_RX_PIN EXT4_PIN + #define E1_SERIAL_TX_PIN EXT4_PIN + + #define Z2_SERIAL_RX_PIN EXT4_PIN + #define Z2_SERIAL_TX_PIN EXT4_PIN + + #define TMC_BAUD_RATE 19200 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h new file mode 100644 index 0000000..c2ad907 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -0,0 +1,163 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * STM32F407VET6 with RAMPS-like shield + * 'Black' STM32F407VET6 board - https://www.stm32duino.com/viewtopic.php?t=485 + * Shield - https://github.com/jmz52/Hardware + */ + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Black STM32F4VET6 supports up to 2 hotends / E-steppers." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Black STM32F4VET6" +#endif + +#define DEFAULT_MACHINE_NAME "STM32F407VET6" + +//#define I2C_EEPROM +#define SRAM_EEPROM_EMULATION +#define MARLIN_EEPROM_SIZE 0x2000 // 8KB + +// +// Servos +// +#define SERVO0_PIN PC6 +#define SERVO1_PIN PC7 + +// +// Limit Switches +// +#define X_MIN_PIN PC13 +#define X_MAX_PIN PA15 +#define Y_MIN_PIN PA5 +#define Y_MAX_PIN PD12 +#define Z_MIN_PIN PD14 +#define Z_MAX_PIN PD15 + +// +// Steppers +// +#define X_STEP_PIN PC4 +#define X_DIR_PIN PA4 +#define X_ENABLE_PIN PE7 + +#define Y_STEP_PIN PE5 +#define Y_DIR_PIN PE2 +#define Y_ENABLE_PIN PE6 + +#define Z_STEP_PIN PD5 +#define Z_DIR_PIN PD3 +#define Z_ENABLE_PIN PD6 + +#define E0_STEP_PIN PD7 +#define E0_DIR_PIN PD0 +#define E0_ENABLE_PIN PB9 + +#define E1_STEP_PIN PE0 +#define E1_DIR_PIN PE1 +#define E1_ENABLE_PIN PB8 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // T0 +#define TEMP_1_PIN PC1 // T1 +#define TEMP_BED_PIN PC2 // TB + +#ifndef TEMP_CHAMBER_PIN + #define TEMP_CHAMBER_PIN PC3 // TC +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA2 // Heater0 +#define HEATER_1_PIN PA3 // Heater1 +#define HEATER_BED_PIN PA1 // Hotbed + +#define FAN_PIN PE9 // Fan0 +#define FAN1_PIN PE11 // Fan1 +#define FAN2_PIN PE13 // Fan2 +#define FAN3_PIN PE14 // Fan3 + +// +// Misc. Functions +// +#define LED_PIN PA6 +//#define LED_PIN PA7 +#define KILL_PIN PB1 + +// +// LCD / Controller +// +//#define SD_DETECT_PIN PC5 +//#define SD_DETECT_PIN PA8 // SDIO SD_DETECT_PIN, external SDIO card reader only + +#define BEEPER_PIN PD10 +#define LCD_PINS_RS PE15 +#define LCD_PINS_ENABLE PD8 +#define LCD_PINS_D4 PE10 +#define LCD_PINS_D5 PE12 +#define LCD_PINS_D6 PD1 +#define LCD_PINS_D7 PE8 +#define BTN_ENC PD9 +#define BTN_EN1 PD4 +#define BTN_EN2 PD13 + +#define DOGLCD_CS LCD_PINS_D5 +#define DOGLCD_A0 LCD_PINS_D6 + +#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder +#endif + +// +// Onboard SD support +// +#define SDIO_D0_PIN PC8 +#define SDIO_D1_PIN PC9 +#define SDIO_D2_PIN PC10 +#define SDIO_D3_PIN PC11 +#define SDIO_CK_PIN PC12 +#define SDIO_CMD_PIN PD2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT // Use SDIO for onboard SD + + #ifndef SDIO_SUPPORT + #define SOFTWARE_SPI // Use soft SPI for onboard SD + #define SDSS SDIO_D3_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN + #endif +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h new file mode 100644 index 0000000..939bc1e --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -0,0 +1,273 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "BIGTREE BTT002 V1.0 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "BTT BTT002 V1.0" + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Limit Switches +// +#define X_STOP_PIN PD3 +#define Y_STOP_PIN PD2 +#define Z_STOP_PIN PD1 // Shares J4 connector with PC3 + +// +// Z Probe must be this pin +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PD1 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA15 +#endif + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PD4 +#endif + +// +// Steppers +// +#define X_STEP_PIN PA9 +#define X_DIR_PIN PA10 +#define X_ENABLE_PIN PA8 +#ifndef X_CS_PIN + #define X_CS_PIN PE2 +#endif + +#define Y_STEP_PIN PC8 +#define Y_DIR_PIN PC9 +#define Y_ENABLE_PIN PC7 + #ifndef Y_CS_PIN + #define Y_CS_PIN PE3 +#endif + +#define Z_STEP_PIN PD15 +#define Z_DIR_PIN PC6 +#define Z_ENABLE_PIN PD14 +#ifndef Z_CS_PIN + #define Z_CS_PIN PE4 +#endif + +#define E0_STEP_PIN PD12 +#define E0_DIR_PIN PD13 +#define E0_ENABLE_PIN PD11 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD7 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB14 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB13 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial ## + // + #define X_SERIAL_TX_PIN PE2 + #define X_SERIAL_RX_PIN PE2 + + #define Y_SERIAL_TX_PIN PE3 + #define Y_SERIAL_RX_PIN PE3 + + #define Z_SERIAL_TX_PIN PE4 + #define Z_SERIAL_RX_PIN PE4 + + #define E0_SERIAL_TX_PIN PD7 + #define E0_SERIAL_RX_PIN PD7 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA2 // T0 <-> E0 +#define TEMP_1_PIN PA0 // T1 <-> E1 +#define TEMP_BED_PIN PA1 // T2 <-> Bed +#define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PE6 // Heater0 +#define HEATER_BED_PIN PE5 // Hotbed +#define FAN_PIN PB8 // Fan1 +#define FAN1_PIN PB9 // Fan0 + +// HAL SPI1 pins +#define CUSTOM_SPI_PINS +#if ENABLED(CUSTOM_SPI_PINS) + #define SD_SCK_PIN PA5 // SPI1 SCLK + #define SD_SS_PIN PA4 // SPI1 SSEL + #define SD_MISO_PIN PA6 // SPI1 MISO + #define SD_MOSI_PIN PA7 // SPI1 MOSI +#endif + +// +// Misc. Functions +// +#define SDSS PA4 + +/** + * -------------------------------------BTT002 V1.0-------------------------------------------- + * ----- ----- | + * PA3 | · · | GND 5V | · · | GND | + * NRESET | · · | PC4(SD_DET) (LCD_D7) PE13 | · · | PE12 (LCD_D6) | + * (MOSI)PA7 | · · | PB0(BTN_EN2) (LCD_D5) PE11 | · · | PE10 (LCD_D4) | + * (SD_SS)PA4 | · · | PC5(BTN_EN1) (LCD_RS) PE8 | · · | PE9 (LCD_EN) | + * (SCK)PA5 | · · | PA6(MISO) (BTN_ENC) PB1 | · · | PE7 (BEEPER) | + * ----- ----- | + * EXP2 EXP1 | + * -------------------------------------------------------------------------------------------- + */ + +// +// LCDs and Controllers +// +#if HAS_WIRED_LCD + #define BEEPER_PIN PE7 + #define BTN_ENC PB1 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PE12 + + #define BTN_EN1 PE9 + #define BTN_EN2 PE10 + + #define LCD_PINS_ENABLE PE13 + #define LCD_PINS_D4 PE11 + + #else + + #define LCD_PINS_RS PE8 + + #define BTN_EN1 PC5 + #define BTN_EN2 PB0 + #define SD_DETECT_PIN PC4 + + #define LCD_SDSS PA4 + + #define LCD_PINS_ENABLE PE9 + #define LCD_PINS_D4 PE10 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 PE11 + #define LCD_PINS_D6 PE12 + #define LCD_PINS_D7 PE13 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + + // Alter timing for graphical display + #if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif + #endif + +#endif // HAS_WIRED_LCD + +// +// RGB LEDs +// +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB5 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB4 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB3 +#endif +#ifndef RGB_LED_W_PIN + #define RGB_LED_W_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h new file mode 100644 index 0000000..cd9d60d --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -0,0 +1,474 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 8 || E_STEPPERS > 8 + #error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers." +#elif HOTENDS > MAX_E_STEPPERS || E_STEPPERS > MAX_E_STEPPERS + #error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue." +#endif + +#define BOARD_INFO_NAME "BTT GTR V1.0" + +// Onboard I2C EEPROM +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24C64 ... 64Kb = 8KB) + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +#define TP // Enable to define servo and probe pins +#define M5_EXTENDER // The M5 extender is attached + +// +// Servos +// +#if ENABLED(TP) + #define SERVO0_PIN PB11 +#endif + +#define PS_ON_PIN PH6 + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PF2 // X- +#define Y_DIAG_PIN PC13 // Y- +#define Z_DIAG_PIN PE0 // Z- +#define E0_DIAG_PIN PG14 // X+ +#define E1_DIAG_PIN PG9 // Y+ +#define E2_DIAG_PIN PD3 // Z+ + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN E0_DIAG_PIN // X+ + #else + #define X_MIN_PIN E0_DIAG_PIN // X+ + #endif +#else + #define X_MIN_PIN X_DIAG_PIN // X- + #define X_MAX_PIN E0_DIAG_PIN // X+ +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN E1_DIAG_PIN // Y+ + #else + #define Y_MIN_PIN E1_DIAG_PIN // Y+ + #endif +#else + #define Y_MIN_PIN Y_DIAG_PIN // Y- + #define Y_MAX_PIN E1_DIAG_PIN // Y+ +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN E2_DIAG_PIN // Z+ + #else + #define Z_MIN_PIN E2_DIAG_PIN // Z+ + #endif +#else + #define Z_MIN_PIN Z_DIAG_PIN // Z- + #define Z_MAX_PIN E2_DIAG_PIN // Z+ +#endif + +// +// Pins on the extender +// +#if ENABLED(M5_EXTENDER) + #define X2_STOP_PIN PI4 // M5 M1_STOP + #define Y2_STOP_PIN PF12 // M5 M5_STOP + #define Z2_STOP_PIN PF4 // M5 M2_STOP + #define Z3_STOP_PIN PI7 // M5 M4_STOP + #define Z4_STOP_PIN PF6 // M5 M3_STOP +#endif + +#if ENABLED(TP) && !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PH11 // Z Probe must be PH11 +#endif + +// +// Steppers +// +#define X_STEP_PIN PC15 +#define X_DIR_PIN PF0 +#define X_ENABLE_PIN PF1 +#ifndef X_CS_PIN + #define X_CS_PIN PC14 +#endif + +#define Y_STEP_PIN PE3 +#define Y_DIR_PIN PE2 +#define Y_ENABLE_PIN PE4 +#ifndef Y_CS_PIN + #define Y_CS_PIN PE1 +#endif + +#define Z_STEP_PIN PB8 +#define Z_DIR_PIN PB7 // PB7 +#define Z_ENABLE_PIN PB9 +#ifndef Z_CS_PIN + #define Z_CS_PIN PB5 +#endif + +#define E0_STEP_PIN PG12 +#define E0_DIR_PIN PG11 +#define E0_ENABLE_PIN PG13 +#ifndef E0_CS_PIN + #define E0_CS_PIN PG10 +#endif + +#define E1_STEP_PIN PD6 +#define E1_DIR_PIN PD5 +#define E1_ENABLE_PIN PD7 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD4 +#endif + +#define E2_STEP_PIN PD1 +#define E2_DIR_PIN PD0 +#define E2_ENABLE_PIN PD2 +#ifndef E2_CS_PIN + #define E2_CS_PIN PC12 +#endif + +#if ENABLED(M5_EXTENDER) + + #define E3_STEP_PIN PF3 + #define E3_DIR_PIN PG3 + #define E3_ENABLE_PIN PF8 + #ifndef E3_CS_PIN + #define E3_CS_PIN PG4 + #endif + + #define E4_STEP_PIN PD14 + #define E4_DIR_PIN PD11 + #define E4_ENABLE_PIN PG2 + #ifndef E4_CS_PIN + #define E4_CS_PIN PE15 + #endif + + #define E5_STEP_PIN PE12 + #define E5_DIR_PIN PE10 + #define E5_ENABLE_PIN PF14 + #ifndef E5_CS_PIN + #define E5_CS_PIN PE7 + #endif + + #define E6_STEP_PIN PG0 + #define E6_DIR_PIN PG1 + #define E6_ENABLE_PIN PE8 + #ifndef E6_CS_PIN + #define E6_CS_PIN PF15 + #endif + + #define E7_STEP_PIN PH12 + #define E7_DIR_PIN PH15 + #define E7_ENABLE_PIN PI0 + #ifndef E7_CS_PIN + #define E7_CS_PIN PH14 + #endif + +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PG15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB6 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB3 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 // M5 MOTOR 1 + //#define E4_HARDWARE_SERIAL Serial1 // M5 MOTOR 2 + //#define E5_HARDWARE_SERIAL Serial1 // M5 MOTOR 3 + //#define E6_HARDWARE_SERIAL Serial1 // M5 MOTOR 4 + //#define E7_HARDWARE_SERIAL Serial1 // M5 MOTOR 5 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC14 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PE1 + #define Y_SERIAL_RX_PIN PE1 + + #define Z_SERIAL_TX_PIN PB5 + #define Z_SERIAL_RX_PIN PB5 + + #define E0_SERIAL_TX_PIN PG10 + #define E0_SERIAL_RX_PIN PG10 + + #define E1_SERIAL_TX_PIN PD4 + #define E1_SERIAL_RX_PIN PD4 + + #define E2_SERIAL_TX_PIN PC12 + #define E2_SERIAL_RX_PIN PC12 + + #if ENABLED(M5_EXTENDER) + #define E3_SERIAL_TX_PIN PG4 + #define E3_SERIAL_RX_PIN PG4 + + #define E4_SERIAL_TX_PIN PE15 + #define E4_SERIAL_RX_PIN PE15 + + #define E5_SERIAL_TX_PIN PE7 + #define E5_SERIAL_RX_PIN PE7 + + #define E6_SERIAL_TX_PIN PF15 + #define E6_SERIAL_RX_PIN PF15 + + #define E7_SERIAL_TX_PIN PH14 + #define E7_SERIAL_RX_PIN PH14 + #endif + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // T1 <-> E0 +#define TEMP_1_PIN PC2 // T2 <-> E1 +#define TEMP_2_PIN PC3 // T3 <-> E2 + +#if ENABLED(M5_EXTENDER) + #define TEMP_3_PIN PA3 // M5 TEMP1 + #define TEMP_4_PIN PF9 // M5 TEMP2 + #define TEMP_5_PIN PF10 // M5 TEMP3 + #define TEMP_6_PIN PF7 // M5 TEMP4 + #define TEMP_7_PIN PF5 // M5 TEMP5 +#endif + +#define TEMP_BED_PIN PC0 // T0 <-> Bed + +// SPI for Max6675 or Max31855 Thermocouple +// Uses a separate SPI bus +// If you have a two-way thermocouple, you can customize two THERMO_CSx_PIN pins (x:1~2) + +#define THERMO_SCK_PIN PI1 // SCK +#define THERMO_DO_PIN PI2 // MISO +#define THERMO_CS1_PIN PH9 // GTR K-TEMP +#define THERMO_CS2_PIN PH2 // M5 K-TEMP + +#define MAX6675_SS_PIN THERMO_CS1_PIN +#define MAX6675_SS2_PIN THERMO_CS2_PIN +#define MAX6675_SCK_PIN THERMO_SCK_PIN +#define MAX6675_DO_PIN THERMO_DO_PIN + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB1 // Heater0 +#define HEATER_1_PIN PA1 // Heater1 +#define HEATER_2_PIN PB0 // Heater2 + +#if ENABLED(M5_EXTENDER) + #define HEATER_3_PIN PD15 // M5 HEAT1 + #define HEATER_4_PIN PD13 // M5 HEAT2 + #define HEATER_5_PIN PD12 // M5 HEAT3 + #define HEATER_6_PIN PE13 // M5 HEAT4 + #define HEATER_7_PIN PI6 // M5 HEAT5 +#endif + +#define HEATER_BED_PIN PA2 // Hotbed + +#define FAN_PIN PE5 // Fan0 +#define FAN1_PIN PE6 // Fan1 +#define FAN2_PIN PC8 // Fan2 + +#if ENABLED(M5_EXTENDER) + #define FAN3_PIN PI5 // M5 FAN1 + #define FAN4_PIN PE9 // M5 FAN2 + #define FAN5_PIN PE11 // M5 FAN3 + //#define FAN6_PIN PC9 // M5 FAN4 + //#define FAN7_PIN PE14 // M5 FAN5 +#endif + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// +// By default the LCD SD (SPI2) is enabled +// Onboard SD is on a completely separate SPI bus, and requires +// overriding pins to access. +// +#if SD_CONNECTION_IS(LCD) + + #define SD_DETECT_PIN PB10 + #define SDSS PB12 + +#elif SD_CONNECTION_IS(ONBOARD) + + // Instruct the STM32 HAL to override the default SPI pins from the variant.h file + #define CUSTOM_SPI_PINS + #define SDSS PA4 + #define SD_SS_PIN SDSS + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_DETECT_PIN PC4 + +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board" +#endif + +/** + * ----- ----- + * NC | · · | GND 5V | · · | GND + * RESET | · · | PB10(SD_DETECT) (LCD_D7) PG5 | · · | PG6 (LCD_D6) + * (MOSI)PB15 | · · | PH10(BTN_EN2) (LCD_D5) PG7 | · · | PG8 (LCD_D4) + * (SD_SS)PB12 | · · | PD10(BTN_EN1) (LCD_RS) PA8 | · · | PC10 (LCD_EN) + * (SCK)PB13 | · · | PB14(MISO) (BTN_ENC) PA15 | · · | PC11 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +// +// LCDs and Controllers +// +#if HAS_WIRED_LCD + #define BEEPER_PIN PC11 + #define BTN_ENC PA15 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PG6 + + #define BTN_EN1 PC10 + #define BTN_EN2 PG8 + + #define LCD_PINS_ENABLE PG5 + #define LCD_PINS_D4 PG7 + + // CR10_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 + + #elif ENABLED(MKS_MINI_12864) + #define DOGLCD_A0 PG6 + #define DOGLCD_CS PG7 + #define BTN_EN1 PD10 + #define BTN_EN2 PH10 + + #if SD_CONNECTION_IS(ONBOARD) + #define SOFTWARE_SPI + #endif + #else + + #define LCD_PINS_RS PA8 + + #define BTN_EN1 PD10 + #define BTN_EN2 PH10 + + #define LCD_PINS_ENABLE PC10 + #define LCD_PINS_D4 PG8 + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS PC10 + #define DOGLCD_A0 PA8 + + #if SD_CONNECTION_IS(ONBOARD) + #define SOFTWARE_SPI + #endif + + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PG8 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PG7 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PG6 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PG5 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PG7 + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 PG7 + #define LCD_PINS_D6 PG6 + #define LCD_PINS_D7 PG5 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + + // Alter timing for graphical display + #if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif + #endif + +#endif // HAS_WIRED_LCD + +#undef TP +#undef M5_EXTENDER diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h new file mode 100644 index 0000000..fb4b17b --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if HOTENDS > 3 || E_STEPPERS > 3 + #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "BTT SKR Pro V1.1" + +#include "pins_BTT_SKR_PRO_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h new file mode 100644 index 0000000..615751b --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if HOTENDS > 3 || E_STEPPERS > 3 + #error "BIGTREE SKR Pro V1.2 supports up to 3 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "BTT SKR Pro V1.2" + +#include "pins_BTT_SKR_PRO_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h new file mode 100644 index 0000000..54153be --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -0,0 +1,474 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#endif + +// BigTreeTech driver expansion module https://bit.ly/3ptRRoj +//#define BTT_MOTOR_EXPANSION + +#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION) + #error "It's not possible to have both LCD and motor expansion module on EXP1/EXP2." +#endif + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// +// Servos +// +#define SERVO0_PIN PA1 +#define SERVO1_PIN PC9 + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PB10 // X- +#define Y_DIAG_PIN PE12 // Y- +#define Z_DIAG_PIN PG8 // Z- +#define E0_DIAG_PIN PE15 // E0 +#define E1_DIAG_PIN PE10 // E1 +#define E2_DIAG_PIN PG5 // E2 + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN PE15 // E0 + #else + #define X_MIN_PIN PE15 // E0 + #endif +#else + #define X_MIN_PIN PB10 // X- + #define X_MAX_PIN PE15 // E0 +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN PE10 // E1 + #else + #define Y_MIN_PIN PE10 // E1 + #endif +#else + #define Y_MIN_PIN PE12 // Y- + #define Y_MAX_PIN PE10 // E1 +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN PG5 // E2 + #else + #define Z_MIN_PIN PG5 // E2 + #endif +#else + #define Z_MIN_PIN PG8 // Z- + #define Z_MAX_PIN PG5 // E2 +#endif + +// +// Z Probe must be this pin +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA2 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PE15 +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN PE10 +#endif +#ifndef FIL_RUNOUT3_PIN + #define FIL_RUNOUT3_PIN PG5 +#endif + +// +// Steppers +// +#define X_STEP_PIN PE9 +#define X_DIR_PIN PF1 +#define X_ENABLE_PIN PF2 +#ifndef X_CS_PIN + #define X_CS_PIN PA15 +#endif + +#define Y_STEP_PIN PE11 +#define Y_DIR_PIN PE8 +#define Y_ENABLE_PIN PD7 + #ifndef Y_CS_PIN + #define Y_CS_PIN PB8 +#endif + +#define Z_STEP_PIN PE13 +#define Z_DIR_PIN PC2 +#define Z_ENABLE_PIN PC0 +#ifndef Z_CS_PIN + #define Z_CS_PIN PB9 +#endif + +#define E0_STEP_PIN PE14 +#define E0_DIR_PIN PA0 +#define E0_ENABLE_PIN PC3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PB3 +#endif + +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PE7 +#define E1_ENABLE_PIN PA3 +#ifndef E1_CS_PIN + #define E1_CS_PIN PG15 +#endif + +#define E2_STEP_PIN PD13 +#define E2_DIR_PIN PG9 +#define E2_ENABLE_PIN PF0 +#ifndef E2_CS_PIN + #define E2_CS_PIN PG12 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PC12 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PC11 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PC10 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC13 + #define X_SERIAL_RX_PIN PC13 + + #define Y_SERIAL_TX_PIN PE3 + #define Y_SERIAL_RX_PIN PE3 + + #define Z_SERIAL_TX_PIN PE1 + #define Z_SERIAL_RX_PIN PE1 + + #define E0_SERIAL_TX_PIN PD4 + #define E0_SERIAL_RX_PIN PD4 + + #define E1_SERIAL_TX_PIN PD1 + #define E1_SERIAL_RX_PIN PD1 + + #define E2_SERIAL_TX_PIN PD6 + #define E2_SERIAL_RX_PIN PD6 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PF4 // T1 <-> E0 +#define TEMP_1_PIN PF5 // T2 <-> E1 +#define TEMP_2_PIN PF6 // T3 <-> E2 +#define TEMP_BED_PIN PF3 // T0 <-> Bed + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB1 // Heater0 +#define HEATER_1_PIN PD14 // Heater1 +#define HEATER_2_PIN PB0 // Heater1 +#define HEATER_BED_PIN PD12 // Hotbed +#define FAN_PIN PC8 // Fan0 +#define FAN1_PIN PE5 // Fan1 +#define FAN2_PIN PE6 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN FAN1_PIN +#endif + +// +// Misc. Functions +// + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION LCD +#endif + +/** + * ----- ----- + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | PF12(SD_DETECT) (LCD_D7) PG7 | 3 4 | PG6 (LCD_D6) + * (MOSI)PB15 | 5 6 PF11(BTN_EN2) (LCD_D5) PG3 | 5 6 PG2 (LCD_D4) + * (SD_SS)PB12 | 7 8 | PG10(BTN_EN1) (LCD_RS) PD10 | 7 8 | PD11 (LCD_EN) + * (SCK)PB13 | 9 10| PB14(MISO) (BTN_ENC) PA8 | 9 10| PG4 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +#define EXPA1_03_PIN PG7 +#define EXPA1_04_PIN PG6 +#define EXPA1_05_PIN PG3 +#define EXPA1_06_PIN PG2 +#define EXPA1_07_PIN PD10 +#define EXPA1_08_PIN PD11 +#define EXPA1_09_PIN PA8 +#define EXPA1_10_PIN PG4 + +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN PF12 +#define EXPA2_05_PIN PB15 +#define EXPA2_06_PIN PF11 +#define EXPA2_07_PIN PB12 +#define EXPA2_08_PIN PG10 +#define EXPA2_09_PIN PB13 +#define EXPA2_10_PIN PB14 + +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(LCD) + + #define SD_DETECT_PIN EXPA2_04_PIN + #define SDSS EXPA2_07_PIN + +#elif SD_CONNECTION_IS(ONBOARD) + + // The SKR Pro's ONBOARD SD interface is on SPI1. + // Due to a pull resistor on the clock line, it needs to use SPI Data Mode 3 to + // function with Hardware SPI. This is not currently configurable in the HAL, + // so force Software SPI to work around this issue. + #define SOFTWARE_SPI + #define SDSS PA4 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PB5 + #define SD_DETECT_PIN PB11 + +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board" +#endif + +#if ENABLED(BTT_MOTOR_EXPANSION) + /** + * _____ _____ + * NC | · · | GND NC | · · | GND + * NC | · · | PF12 (M1EN) (M2EN) PG7 | · · | PG6 (M3EN) + * (M1STP) PB15 | · · PF11 (M1DIR) (M1RX) PG3 | · · PG2 (M1DIAG) + * (M2DIR) PB12 | · · | PG10 (M2STP) (M2RX) PD10 | · · | PD11 (M2DIAG) + * (M3DIR) PB13 | · · | PB14 (M3STP) (M3RX) PA8 | · · | PG4 (M3DIAG) + * ----- ----- + * EXP2 EXP1 + */ + + // M1 on Driver Expansion Module + #define E3_STEP_PIN EXPA2_05_PIN + #define E3_DIR_PIN EXPA2_06_PIN + #define E3_ENABLE_PIN EXPA2_04_PIN + #define E3_DIAG_PIN EXPA1_06_PIN + #define E3_CS_PIN EXPA1_05_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXPA1_05_PIN + #define E3_SERIAL_RX_PIN EXPA1_05_PIN + #endif + + // M2 on Driver Expansion Module + #define E4_STEP_PIN EXPA2_08_PIN + #define E4_DIR_PIN EXPA2_07_PIN + #define E4_ENABLE_PIN EXPA1_03_PIN + #define E4_DIAG_PIN EXPA1_08_PIN + #define E4_CS_PIN EXPA1_07_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXPA1_07_PIN + #define E4_SERIAL_RX_PIN EXPA1_07_PIN + #endif + + // M3 on Driver Expansion Module + #define E5_STEP_PIN EXPA2_10_PIN + #define E5_DIR_PIN EXPA2_09_PIN + #define E5_ENABLE_PIN EXPA1_04_PIN + #define E5_DIAG_PIN EXPA1_10_PIN + #define E5_CS_PIN EXPA1_09_PIN + #if HAS_TMC_UART + #define E5_SERIAL_TX_PIN EXPA1_09_PIN + #define E5_SERIAL_RX_PIN EXPA1_09_PIN + #endif + +#endif // BTT_MOTOR_EXPANSION + +// +// LCDs and Controllers +// +#if IS_TFTGLCD_PANEL + + #if ENABLED(TFTGLCD_PANEL_SPI) + #define TFTGLCD_CS EXPA2_08_PIN + #endif + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN EXPA1_10_PIN + #define BTN_ENC EXPA1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXPA1_04_PIN + + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN + + // CR10_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_CS EXPA1_05_PIN + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN + + #else + + #define LCD_PINS_RS EXPA1_07_PIN + + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN + + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXPA1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXPA1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXPA1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXPA1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif +#endif + +// +// WIFI +// + +/** + * ----- + * TX | 1 2 | GND Enable PG1 // Must be high for module to run + * Enable | 3 4 | GPIO2 Reset PG0 // active low, probably OK to leave floating + * Reset | 5 6 | GPIO0 GPIO2 PF15 // must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * 3.3V | 7 8 | RX GPIO0 PF14 // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * ----- + * W1 + */ +#define ESP_WIFI_MODULE_COM 6 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this +#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 +#define ESP_WIFI_MODULE_RESET_PIN PG0 +#define ESP_WIFI_MODULE_ENABLE_PIN PG1 +#define ESP_WIFI_MODULE_GPIO0_PIN PF14 +#define ESP_WIFI_MODULE_GPIO2_PIN PF15 diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h new file mode 100644 index 0000000..7965d26 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -0,0 +1,296 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 6 || E_STEPPERS > 6 + #error "FLYF407ZG supports up to 6 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "FLYF407ZG" +#define BOARD_WEBSITE_URL "github.com/FLYmaker/FLYF407ZG" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// Avoid conflict with fans and TIMER_TONE +#define TEMP_TIMER 3 +#define STEP_TIMER 5 + +// +// EEPROM Emulation +// +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define SRAM_EEPROM_EMULATION + //#define I2C_EEPROM +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across + // the 128kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#elif ENABLED(I2C_EEPROM) + #define MARLIN_EEPROM_SIZE 0x2000 // 8KB +#endif + +#ifndef MARLIN_EEPROM_SIZE + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Servos +// +#define SERVO0_PIN PE11 + +// +// Limit Switches +// +#define X_MIN_PIN PC3 +#define X_MAX_PIN PC2 +#define Y_MIN_PIN PF2 +#define Y_MAX_PIN PF1 +#define Z_MIN_PIN PF0 +#define Z_MAX_PIN PC15 + +// +// Z Probe (when not Z_MIN_PIN) +// +#define Z_MIN_PROBE_PIN PC14 // Z3_PIN + +// +// Steppers +// + +#define X_STEP_PIN PB9 +#define X_DIR_PIN PE0 +#define X_ENABLE_PIN PE1 +#ifndef X_CS_PIN + #define X_CS_PIN PG13 +#endif + +#define Y_STEP_PIN PB8 +#define Y_DIR_PIN PG11 +#define Y_ENABLE_PIN PG12 +#ifndef Y_CS_PIN + #define Y_CS_PIN PG10 +#endif + +#define Z_STEP_PIN PA8 +#define Z_DIR_PIN PD6 +#define Z_ENABLE_PIN PD7 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD5 +#endif + +#define E0_STEP_PIN PC7 +#define E0_DIR_PIN PD3 +#define E0_ENABLE_PIN PD4 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD1 +#endif + +#define E1_STEP_PIN PC6 +#define E1_DIR_PIN PA15 +#define E1_ENABLE_PIN PD0 +#ifndef E1_CS_PIN + #define E1_CS_PIN PA14 +#endif + +#define E2_STEP_PIN PD15 +#define E2_DIR_PIN PG7 +#define E2_ENABLE_PIN PG8 +#ifndef E2_CS_PIN + #define E2_CS_PIN PG6 +#endif + +#define E3_STEP_PIN PD14 +#define E3_DIR_PIN PG4 +#define E3_ENABLE_PIN PG5 +#ifndef E3_CS_PIN + #define E3_CS_PIN PG3 +#endif + +#define E4_STEP_PIN PD13 +#define E4_DIR_PIN PD11 +#define E4_ENABLE_PIN PG2 +#ifndef E4_CS_PIN + #define E4_CS_PIN PD10 +#endif + +#define E5_STEP_PIN PD12 +#define E5_DIR_PIN PD8 +#define E5_ENABLE_PIN PD9 +#ifndef E5_CS_PIN + #define E5_CS_PIN PB12 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // Analog Input +#define TEMP_1_PIN PC1 // Analog Input +#define TEMP_2_PIN PC0 // Analog Input +#define TEMP_3_PIN PF10 // Analog Input +#define TEMP_4_PIN PF5 // Analog Input +#define TEMP_5_PIN PF4 // Analog Input +#define TEMP_BED_PIN PF3 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PF7 +#define HEATER_1_PIN PF6 +#define HEATER_2_PIN PE6 +#define HEATER_3_PIN PE5 +#define HEATER_4_PIN PE4 +#define HEATER_5_PIN PE3 +#define HEATER_BED_PIN PE2 + +#ifndef FAN_PIN + #define FAN_PIN PF8 +#endif +#define FAN1_PIN PF9 +#define FAN2_PIN PA2 +#define FAN3_PIN PA1 +#define FAN4_PIN PE13 +#define FAN5_PIN PB11 + +// +// Onboard SD support +// + +#define SDIO_D0_PIN PC8 +#define SDIO_D1_PIN PC9 +//#define SD_CARD_DETECT_PIN PC13 +#define SDIO_D2_PIN PC10 +#define SDIO_D3_PIN PC11 +#define SDIO_CK_PIN PC12 +#define SDIO_CMD_PIN PD2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + + #define SDIO_SUPPORT // Use SDIO for onboard SD + #ifndef SDIO_SUPPORT + #define SOFTWARE_SPI // Use soft SPI for onboard SD + #define SDSS SDIO_D3_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN + #endif + +#elif SD_CONNECTION_IS(LCD) + + #define SD_SCK_PIN PB13 + #define SD_MISO_PIN PB14 + #define SD_MOSI_PIN PB15 + #define SDSS PF11 + #define SD_DETECT_PIN PB2 + +#endif + +// +// Trinamic Software SPI +// + +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB14 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB13 + #endif +#endif + +// +// Trinamic Software Serial +// + +#if HAS_TMC_UART + #define X_SERIAL_TX_PIN PG13 + #define X_SERIAL_RX_PIN PG13 + + #define Y_SERIAL_TX_PIN PG10 + #define Y_SERIAL_RX_PIN PG10 + + #define Z_SERIAL_TX_PIN PD5 + #define Z_SERIAL_RX_PIN PD5 + + #define E0_SERIAL_TX_PIN PD1 + #define E0_SERIAL_RX_PIN PD1 + + #define E1_SERIAL_TX_PIN PA14 + #define E1_SERIAL_RX_PIN PA14 + + #define E2_SERIAL_TX_PIN PG6 + #define E2_SERIAL_RX_PIN PG6 + + #define E3_SERIAL_TX_PIN PG3 + #define E3_SERIAL_RX_PIN PG3 + + #define E4_SERIAL_TX_PIN PD10 + #define E4_SERIAL_RX_PIN PD10 + + #define E5_SERIAL_TX_PIN PB12 + #define E5_SERIAL_RX_PIN PB12 + +#endif + +// +// LCD / Controller +// + +#define BEEPER_PIN PB10 +#define LCD_PINS_RS PE12 +#define LCD_PINS_ENABLE PE14 +#define LCD_PINS_D4 PE10 +#define LCD_PINS_D5 PE9 +#define LCD_PINS_D6 PE8 +#define LCD_PINS_D7 PE7 +#define BTN_EN1 PC4 +#define BTN_EN2 PC5 +#define BTN_ENC PE15 + +// +// Filament runout +// + +#define FIL_RUNOUT_PIN PA3 + +// +// ST7920 Delays +// +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) +#endif +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) +#endif +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h new file mode 100644 index 0000000..18e689d --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -0,0 +1,271 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#endif + +#define DEFAULT_MACHINE_NAME "3D Printer" + +#define BOARD_INFO_NAME "FYSETC Cheetah V2.0" +#define BOARD_WEBSITE_URL "fysetc.com" + +// USB Flash Drive support +//#define HAS_OTG_USB_HOST_SUPPORT + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define FLASH_EEPROM_LEVELING + + #define FLASH_SECTOR 2 + #define FLASH_UNIT_SIZE 0x4000 // 16k + #define FLASH_ADDRESS_START 0x8008000 +#endif + +// +// Z Probe +// +#if ENABLED(BLTOUCH) + #error "You need to set jumper to 5v for Bltouch, then comment out this line to proceed." + #define SERVO0_PIN PA0 +#elif !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PA0 +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PB4 +#define Y_STOP_PIN PB3 +#define Z_STOP_PIN PB1 + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PB5 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PC1 +#define X_ENABLE_PIN PA8 + +#define Y_STEP_PIN PC14 +#define Y_DIR_PIN PC13 +#define Y_ENABLE_PIN PC15 + +#define Z_STEP_PIN PB9 +#define Z_DIR_PIN PB8 +#define Z_ENABLE_PIN PC2 + +#define E0_STEP_PIN PB2 +#define E0_DIR_PIN PA15 +#define E0_ENABLE_PIN PD2 + +#if HAS_TMC_UART + #define X_HARDWARE_SERIAL Serial2 + #define Y_HARDWARE_SERIAL Serial2 + #define Z_HARDWARE_SERIAL Serial2 + #define E0_HARDWARE_SERIAL Serial2 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC6 +#define HEATER_BED_PIN PC7 +#ifndef FAN_PIN + #define FAN_PIN PA1 +#endif +#define FAN1_PIN PC8 + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PC5 // Analog Input +#define TEMP_0_PIN PC4 // Analog Input + +// +// Misc. Functions +// +#define SDSS PA4 +#define SD_DETECT_PIN PC3 + +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB0 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB7 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB6 +#endif + +/** + * _____ _____ + * 5V | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | PC3 (SD_DETECT) (LCD_D7) PB7 | 3 4 | PB6 (LCD_D6) + * (SD_MOSI) PA7 5 6 | PC11 (BTN_EN2) (LCD_D5) PB14 5 6 | PB13 (LCD_D4) + * (SD_SS) PA4 | 7 8 | PC10 (BTN_EN1) (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN) + * (SD_SCK) PA5 | 9 10| PA6 (SD_MISO) (BTN_ENC) PC12 | 9 10| PC9 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +/** +* _____ +* (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) +* (BTN_EN1) PC10 | 3 4 | PB14 (LCD_D5/MISO) +* (BTN_EN2) PC11 5 6 | PB13 (LCD_D4/SCK) +* (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN/MOSI) +* GND | 9 10| 5V +* ----- +* EXP3 +*/ + +#define EXPA1_03_PIN PB7 +#define EXPA1_04_PIN PB6 +#define EXPA1_05_PIN PB14 +#define EXPA1_06_PIN PB13 +#define EXPA1_07_PIN PB12 +#define EXPA1_08_PIN PB15 +#define EXPA1_09_PIN PC12 +#define EXPA1_10_PIN PC9 + +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN PC3 +#define EXPA2_05_PIN PA7 +#define EXPA2_06_PIN PC11 +#define EXPA2_07_PIN PA4 +#define EXPA2_08_PIN PC10 +#define EXPA2_09_PIN PA5 +#define EXPA2_10_PIN PA6 + +#if HAS_WIRED_LCD + + #define BEEPER_PIN EXPA1_10_PIN + #define BTN_ENC EXPA1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXPA1_07_PIN + + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN + + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN + + // CR10_STOCKDISPLAY default timing is too fast + #undef BOARD_ST7920_DELAY_1 + #undef BOARD_ST7920_DELAY_2 + #undef BOARD_ST7920_DELAY_3 + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_CS EXPA1_05_PIN + #define BTN_EN1 EXPA2_08_PIN + #define BTN_EN2 EXPA2_06_PIN + + #else + + #define LCD_PINS_RS EXPA1_07_PIN + + #define BTN_EN1 EXPA2_06_PIN + #define BTN_EN2 EXPA2_08_PIN + + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXPA1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXPA1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXPA1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXPA1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif +#endif + +#if ENABLED(TOUCH_UI_FTDI_EVE) + #define BEEPER_PIN EXPA1_10_PIN + #define CLCD_MOD_RESET EXPA2_08_PIN + #define CLCD_SPI_CS EXPA2_06_PIN +#endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h new file mode 100644 index 0000000..a280775 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -0,0 +1,306 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "RUMBA32 supports up to 3 hotends / E-steppers." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "FYSETC S6" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +#endif + +// Avoid conflict with TIMER_TONE defined in variant +#define STEP_TIMER 10 + +// +// EEPROM Emulation +// +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define I2C_EEPROM +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#elif ENABLED(I2C_EEPROM) + #define MARLIN_EEPROM_SIZE 0x0800 // 2KB +#endif + +// +// Servos +// +#define SERVO0_PIN PA3 + +// +// Limit Switches +// +#define X_MIN_PIN PB14 +#define X_MAX_PIN PA1 +#define Y_MIN_PIN PB13 +#define Y_MAX_PIN PA2 +#define Z_MIN_PIN PA0 +#define Z_MAX_PIN PA3 + +// +// Filament Sensor +// share with X_MAX_PIN +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA1 +#endif + +// +// Steppers +// +#define X_STEP_PIN PE11 +#define X_DIR_PIN PE10 +#ifndef X_ENABLE_PIN + #define X_ENABLE_PIN PE12 +#endif +#define X_CS_PIN PE7 + +#define Y_STEP_PIN PD8 +#define Y_DIR_PIN PB12 +#define Y_ENABLE_PIN PD9 +#define Y_CS_PIN PE15 + +#define Z_STEP_PIN PD14 +#define Z_DIR_PIN PD13 +#define Z_ENABLE_PIN PD15 +#define Z_CS_PIN PD10 + +#define E0_STEP_PIN PD5 +#define E0_DIR_PIN PD6 +#define E0_ENABLE_PIN PD4 +#define E0_CS_PIN PD7 + +#define E1_STEP_PIN PE6 +#define E1_DIR_PIN PC13 +#define E1_ENABLE_PIN PE5 +#define E1_CS_PIN PC14 + +#define E2_STEP_PIN PE2 +#define E2_DIR_PIN PE4 +#define E2_ENABLE_PIN PE3 +#define E2_CS_PIN PC15 + +#if HAS_TMC_UART + // + // TMC2208/TMC2209 stepper drivers + // + + // + // Software serial + // + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN PE9 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN PE8 + #endif + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN PE14 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN PE13 + #endif + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN PD11 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN PD12 + #endif + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN PD3 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN PA15 + #endif + #ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN PC4 + #endif + #ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN PC5 + #endif + #ifndef E2_SERIAL_TX_PIN + #define E2_SERIAL_TX_PIN PE1 + #endif + #ifndef E2_SERIAL_RX_PIN + #define E2_SERIAL_RX_PIN PE0 + #endif +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 +#define TEMP_1_PIN PC1 +#define TEMP_2_PIN PC2 +#define TEMP_BED_PIN PC3 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB3 +#define HEATER_1_PIN PB4 +#define HEATER_2_PIN PB15 +#define HEATER_BED_PIN PC8 + +#define FAN_PIN PB0 +#define FAN1_PIN PB1 +#define FAN2_PIN PB2 + +// +// SPI +// +#define SD_SCK_PIN PA5 +#define SD_MISO_PIN PA6 +#define SD_MOSI_PIN PA7 + +// +// Misc. Functions +// +//#define LED_PIN PB14 +//#define BTN_PIN PC10 +//#define PS_ON_PIN PE11 +//#define KILL_PIN PC5 + +#define SDSS PA4 +#define SD_DETECT_PIN PB10 + +// +// LCD / Controller +// +#if ENABLED(FYSETC_242_OLED_12864) + + #define BTN_EN1 PC9 + #define BTN_EN2 PD1 + #define BTN_ENC PA8 + + #define BEEPER_PIN PC6 + + #define LCD_PINS_DC PC12 + #define LCD_PINS_RS PC7 // LCD_RST + #define DOGLCD_CS PD2 + #define DOGLCD_MOSI PC10 + #define DOGLCD_SCK PC11 + #define DOGLCD_A0 LCD_PINS_DC + #define FORCE_SOFT_SPI + + #define KILL_PIN -1 // NC + #define NEOPIXEL_PIN PD0 + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN PC9 + #define BTN_ENC PA8 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PD0 + + #define BTN_EN1 PC11 + #define BTN_EN2 PC10 + + #define LCD_PINS_ENABLE PD1 + #define LCD_PINS_D4 PC12 + + #else + + #define LCD_PINS_RS PD2 + + #define BTN_EN1 PC6 + #define BTN_EN2 PC7 + + #define LCD_SDSS PA4 + + #define LCD_PINS_ENABLE PC11 + #define LCD_PINS_D4 PC10 + + #if ENABLED(FYSETC_MINI_12864) + // See https://wiki.fysetc.com/Mini12864_Panel + #define DOGLCD_CS PC11 + #define DOGLCD_A0 PD2 + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN PD0 + #endif + #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PC12 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PD0 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PD1 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PC12 + #endif + #endif + + #if IS_ULTIPANEL + #define LCD_PINS_D5 PC12 + #define LCD_PINS_D6 PD0 + #define LCD_PINS_D7 PD1 + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) + #endif +#endif + +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB6 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB5 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB7 +#endif +#ifndef RGB_LED_W_PIN + #define RGB_LED_W_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h new file mode 100644 index 0000000..641805d --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h @@ -0,0 +1,66 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#define BOARD_INFO_NAME "FYSETC S6 2.0" + +// +// EEPROM Emulation +// +#if NO_EEPROM_SELECTED + #undef NO_EEPROM_SELECTED + //#define FLASH_EEPROM_EMULATION + #define I2C_EEPROM +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PE9 + +#if HAS_TMC_UART + #define X_SERIAL_TX_PIN PE8 + #define Y_SERIAL_TX_PIN PC4 + #define Y_SERIAL_RX_PIN PC4 + #define Z_SERIAL_TX_PIN PD12 + #define E0_SERIAL_TX_PIN PA15 + #define E1_SERIAL_TX_PIN PC5 + #define E2_SERIAL_TX_PIN PE0 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#define TMC_USE_SW_SPI +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PE14 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PE13 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PE12 + #endif +#endif + +#include "pins_FYSETC_S6.h" diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h new file mode 100644 index 0000000..bf6df03 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -0,0 +1,184 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE K supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge K" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define I2C_EEPROM + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// +// Servos +// +//#define SERVO0_PIN PB11 + +// +// Limit Switches +// +#define X_STOP_PIN PG3 +#define Y_STOP_PIN PG4 +#define Z_STOP_PIN PG5 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PG6 +//#endif + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE5 +#define FIL_RUNOUT2_PIN PE6 + +// +// Steppers +// +#define X_STEP_PIN PG1 +#define X_DIR_PIN PB10 +#define X_ENABLE_PIN PG0 +//#ifndef X_CS_PIN +// #define X_CS_PIN PE0 +//#endif + +#define Y_STEP_PIN PF14 +#define Y_DIR_PIN PF15 +#define Y_ENABLE_PIN PF13 +//#ifndef Y_CS_PIN +// #define Y_CS_PIN PE1 +//#endif + +#define Z_STEP_PIN PF11 +#define Z_DIR_PIN PF12 +#define Z_ENABLE_PIN PC5 +//#ifndef Z_CS_PIN +// #define Z_CS_PIN PE2 +//#endif + +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 +//#ifndef E0_CS_PIN +// #define E0_CS_PIN PE3 +//#endif + +#define E1_STEP_PIN PF1 +#define E1_DIR_PIN PF0 +#define E1_ENABLE_PIN PF2 +//#ifndef E1_CS_PIN +// #define E1_CS_PIN PE4 +//#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // Analog Input +#define TEMP_1_PIN PC2 // Analog Input +#define TEMP_BED_PIN PC0 // Analog Input + +// Lergde-K can choose thermocouple/thermistor mode in software. +// For use with thermistors, these pins must be OUT/LOW. +// This is done automatically. +#define TEMP_0_TR_ENABLE_PIN PF10 +#define TEMP_1_TR_ENABLE_PIN PF9 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN PA0 +#define HEATER_BED_PIN PA2 + +#ifndef FAN_PIN + #define FAN_PIN PF7 +#endif +#define FAN1_PIN PF6 +#define FAN2_PIN PF8 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PF6 +#endif + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB7 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB8 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB9 +#endif + +// +// SD support +// +#define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PA15 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT + +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 + +#define SD_DETECT_PIN PA8 +#define BEEPER_PIN PC7 + +// +// LCD / Controller +// + +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 + +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD11 + +#define TOUCH_CS_PIN PG15 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 + +#define BTN_EN1 PG10 +#define BTN_EN2 PG11 +#define BTN_ENC PG9 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h new file mode 100644 index 0000000..c6cfa98 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -0,0 +1,212 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE S supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge S" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define STEP_TIMER 4 +#define TEMP_TIMER 2 + +//#define I2C_EEPROM + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// +// Servos +// +#define SERVO0_PIN PD12 +//#define SERVO1_PIN -1 + +// +// Limit Switches +// +#define X_MIN_PIN PG9 +#define Y_MIN_PIN PG10 +#define Z_MIN_PIN PG11 + +#define X_MAX_PIN PG12 +#define Y_MAX_PIN PG13 +#define Z_MAX_PIN PG14 + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PC5 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PG8 +#endif + +// +// Steppers +// +#define X_STEP_PIN PF7 +#define X_DIR_PIN PF8 +#define X_ENABLE_PIN PF6 + +#define Y_STEP_PIN PF10 +#define Y_DIR_PIN PF11 +#define Y_ENABLE_PIN PF9 + +#define Z_STEP_PIN PF13 +#define Z_DIR_PIN PF14 +#define Z_ENABLE_PIN PF12 + +#define E0_STEP_PIN PG0 +#define E0_DIR_PIN PG1 +#define E0_ENABLE_PIN PF15 + +#define E1_STEP_PIN PG3 +#define E1_DIR_PIN PG4 +#define E1_ENABLE_PIN PG2 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // See below for activation of thermistor readings +#define TEMP_1_PIN PC1 // See below for activation of thermistor readings +#define TEMP_BED_PIN PC3 + +// Lergde-S can choose thermocouple/thermistor mode in software. +// For use with thermistors, these pins must be OUT/LOW. +// This is done automatically. +#define TEMP_0_TR_ENABLE_PIN PF3 +#define TEMP_1_TR_ENABLE_PIN PF4 + +// MAX6675 Cold-Junction-Compensated K-Thermocouple to Digital Converter (0°C to +1024°C) +// https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf + +#define MAX6675_SCK_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested +#define MAX6675_DO_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested +#define MAX6675_SS_PIN PC4 // max6675 datasheet: /CS pin, found with multimeter, not tested and likely wrong + +// Expansion board with second max6675 +// Warning: Some boards leave the slot unpopulated. + +//#define MAX6675_SCK2_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested +//#define MAX6675_DO2_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested +//#define MAX6675_SS2_PIN PF1 // max6675 datasheet: /CS pin, found with multimeter, not tested + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA0 +#define HEATER_1_PIN PA1 +#define HEATER_BED_PIN PA3 + +#define FAN_PIN PA15 // heater 0 fan 1 +#define FAN1_PIN PB10 // heater 1 fan 2 +#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PF5 +#endif + +// +// Průša i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// LED / Lighting +// +//Lerdge-S board has two LED connectors (this is the one on the mainboard) +#define CASE_LIGHT_PIN PC7 + +//on the dual extrusion addon board is a RGB connector +#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN) +#define RGB_LED_G_PIN PB0 +#define RGB_LED_B_PIN PB1 + +// +// Misc. Functions +// +#define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed? +#define LED_PIN PC6 // Mainboard soldered green LED +#define PS_ON_PIN PB2 // Board has a power module connector +#define KILL_PIN -1 // There is no reset button on the LCD +#define POWER_LOSS_PIN -1 // PB2 could be used for this as well + +// +// SD support +// +#define SDIO_SUPPORT +#define SDIO_CLOCK 4800000 + +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 + +#define SD_DETECT_PIN PG15 + +// +// Persistent Storage +// If no option is selected below the SD Card will be used +// (this section modelled after pins_LONGER3D_LK.h) +// Warning: Not tested yet! Pins traced with multimeter, mistakes are possible +//#define SPI_EEPROM + +#if ENABLED(SPI_EEPROM) + // Lerdge has an SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf + #define SPI_CHAN_EEPROM1 1 + #define SPI_EEPROM1_CS PB12 // datasheet: /CS pin, found with multimeter, not tested + #define EEPROM_SCK PB13 // datasheet: CLK pin, found with multimeter, not tested + #define EEPROM_MISO PB14 // datasheet: DO pin, found with multimeter, not tested + #define EEPROM_MOSI PB15 // datasheet: DI pin, found with multimeter, not tested + #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now... +#else + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM +#endif + +// +// LCD / Controller +// + +// The LCD is initialized in FSMC mode +#define BEEPER_PIN PD13 + +#define BTN_EN1 PC14 +#define BTN_EN2 PC15 +#define BTN_ENC PC13 + +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 + +#define TFT_CS_PIN PD7 // TFT works +#define TFT_RS_PIN PD11 // TFT works + +// There is touch, but calibration is off +#define TOUCH_CS_PIN PB6 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h new file mode 100644 index 0000000..606d932 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -0,0 +1,155 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "LERDGE X only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Lerdge X" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define STEP_TIMER 4 +#define TEMP_TIMER 2 + +#define I2C_EEPROM + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// +// Servos +// +//#define SERVO0_PIN PD13 + +// +// Limit Switches +// +#define X_STOP_PIN PB12 +#define Y_STOP_PIN PB13 +#define Z_STOP_PIN PB14 + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE1 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PB15 +//#endif + +// +// Steppers +// +#define X_STEP_PIN PB10 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PB11 + +#define Y_STEP_PIN PB0 +#define Y_DIR_PIN PC5 +#define Y_ENABLE_PIN PB1 + +#define Z_STEP_PIN PA7 +#define Z_DIR_PIN PA6 +#define Z_ENABLE_PIN PC4 + +#define E0_STEP_PIN PA4 +#define E0_DIR_PIN PA3 +#define E0_ENABLE_PIN PA5 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN -1 // Analog Input +#define TEMP_BED_PIN PC1 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN -1 +#define HEATER_BED_PIN PA2 + +//#ifndef FAN_PIN +// #define FAN_PIN PC15 +//#endif +#define FAN1_PIN PC15 +#define FAN2_PIN PA0 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PC15 // FAN1_PIN +#endif + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PC7 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 + +// Lerdge supports auto-power off and power loss sense through a single pin. +#define POWER_LOSS_PIN PC14 // Power-loss / nAC_FAULT + +#define SD_SCK_PIN PC12 +#define SD_MISO_PIN PC8 +#define SD_MOSI_PIN PD2 +#define SD_SS_PIN PC11 + +// +// SD support +// +#define SDIO_SUPPORT +#define SD_DETECT_PIN PA8 +#define SDIO_CLOCK 4800000 + +// +// LCD / Controller +// + +// The LCD is initialized in FSMC mode +#define BEEPER_PIN PD12 + +#define BTN_EN1 PE3 +#define BTN_EN2 PE4 +#define BTN_ENC PE2 + +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 + +#define TFT_CS_PIN PD7 +#define TFT_RS_PIN PD11 + +#define TOUCH_CS_PIN PB6 +#define TOUCH_SCK_PIN PB3 +#define TOUCH_MOSI_PIN PB5 +#define TOUCH_MISO_PIN PB4 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h new file mode 100644 index 0000000..c2f5f32 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h @@ -0,0 +1,101 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS_ROBIN2 supports up to 2 hotends / E-steppers." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS_ROBIN2" +#endif + +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +#endif + +#define SRAM_EEPROM_EMULATION + +// +// Limit Switches +// +#define X_MIN_PIN PG8 +#define X_MAX_PIN PG7 +#define Y_MIN_PIN PG6 +#define Y_MAX_PIN PG5 +#define Z_MIN_PIN PG4 +#define Z_MAX_PIN PG3 + +// +// Servos +// +#define SERVO0_PIN PB0 // XS2-5 +#define SERVO1_PIN PF7 // XS1-5 +#define SERVO2_PIN PF8 // XS1-6 + +// +// Steppers +// +#define X_STEP_PIN PE6 +#define X_DIR_PIN PE5 +#define X_ENABLE_PIN PC13 + +#define Y_STEP_PIN PE3 +#define Y_DIR_PIN PE2 +#define Y_ENABLE_PIN PE4 + +#define Z_STEP_PIN PE0 +#define Z_DIR_PIN PB9 +#define Z_ENABLE_PIN PE1 + +#define E0_STEP_PIN PG10 +#define E0_DIR_PIN PG9 +#define E0_ENABLE_PIN PB8 + +#define E1_STEP_PIN PD3 +#define E1_DIR_PIN PA15 +#define E1_ENABLE_PIN PD6 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // T1 <-> E0 +#define TEMP_1_PIN PC2 // T2 <-> E1 +#define TEMP_BED_PIN PC0 // T0 <-> Bed + +// +// Heaters / Fans +// +#define HEATER_0_PIN PF3 // Heater0 +#define HEATER_1_PIN PF2 // Heater1 +#define HEATER_BED_PIN PF4 // Hotbed +#define FAN_PIN PA7 // Fan0 + +// +// Misc. Functions +// +#define SDSS -1 // PB12 + +#define SD_DETECT_PIN PF9 +#define BEEPER_PIN PG2 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h new file mode 100644 index 0000000..425b95b --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -0,0 +1,374 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Robin Nano V3 supports up to 2 hotends / E-steppers." +#elif HAS_FSMC_TFT + #error "MKS Robin Nano V3 doesn't support FSMC-based TFT displays." +#endif + +#define BOARD_INFO_NAME "MKS Robin Nano V3" + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 10 + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +#define I2C_SCL_PIN PB6 +#define I2C_SDA_PIN PB7 + +// +// Release PB4 (Z_DIR_PIN) from JTAG NRST role +// +//#define DISABLE_DEBUG + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + +// +// Limit Switches +// +#define X_DIAG_PIN PD15 +#define Y_DIAG_PIN PD2 +#define Z_DIAG_PIN PC8 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +// +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PD2 +#define Z_MIN_PIN PC8 +#define Z_MAX_PIN PC4 + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD7 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD4 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD9 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD8 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// This board only supports SW SPI for stepper drivers +// +#if HAS_TMC_SPI + #define TMC_USE_SW_SPI +#endif +#if ENABLED(TMC_USE_SW_SPI) + #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1 + #define TMC_SW_MOSI PD14 + #endif + #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1 + #define TMC_SW_MISO PD1 + #endif + #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1 + #define TMC_SW_SCK PD0 + #endif +#endif + +#if HAS_TMC_UART + // + // Software serial + // No Hardware serial for steppers + // + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN PD5 + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN PD7 + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN PD4 + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN PD9 + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN PD8 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PA2 // TH2 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PE5 // HEATER1 +#define HEATER_1_PIN PB0 // HEATER2 +#define HEATER_BED_PIN PA0 // HOT BED + +#define FAN_PIN PB1 // FAN +#define FAN1_PIN PC14 // FAN1 + +// +// Thermocouples +// +//#define MAX6675_SS_PIN HEATER_0_PIN // TC1 - CS1 +//#define MAX6675_SS_PIN HEATER_1_PIN // TC2 - CS2 + +// +// Misc. Functions +// +#define MT_DET_1_PIN PA4 +#define MT_DET_2_PIN PE6 +#define MT_DET_PIN_INVERTING false // LVGL UI filament RUNOUT PIN STATE +#define PW_DET PA13 +#define PW_OFF PB2 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN MT_DET_1_PIN +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN MT_DET_2_PIN +#endif + +//#define MKSPWC +#ifdef MKSPWC + #define SUICIDE_PIN PW_OFF // Enable MKSPWC SUICIDE PIN + #define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE + #define KILL_PIN PW_DET // Enable MKSPWC DET PIN + #define KILL_PIN_STATE true // Enable MKSPWC PIN STATE +#endif + +//#define MKS_TEST + +#if ENABLED(MKS_TEST) + #define MKS_TEST_POWER_LOSS_PIN PW_DET // PW_DET + #define MKS_TEST_PS_ON_PIN PW_OFF // PW_OFF +#endif + +//#define POWER_LOSS_PIN PW_DET +//#define PS_ON_PIN PW_OFF + +//#define LED_PIN PB2 + +// Random Info +#define USB_SERIAL -1 // USB Serial +#define WIFI_SERIAL 3 // USART3 +#define MKS_WIFI_MODULE_SERIAL 1 // USART1 +#define MKS_WIFI_MODULE_SPI 2 // SPI2 + +#define WIFI_IO0_PIN PC13 // MKS ESP WIFI IO0 PIN +#define WIFI_IO1_PIN PC7 // MKS ESP WIFI IO1 PIN +#define WIFI_RESET_PIN PE9 // MKS ESP WIFI RESET PIN + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// +// Onboard SD card +// +// detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled +#if SD_CONNECTION_IS(ONBOARD) + #define CUSTOM_SPI_PINS // TODO: needed because is the only way to set SPI3 for SD on STM32 (by now) + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI3 + #define SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #define SD_DETECT_PIN PD12 + #endif +#endif + +// +// LCD SD +// +#if SD_CONNECTION_IS(LCD) + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 + #endif +#endif + +// +// LCD / Controller +#define SPI_FLASH +#define HAS_SPI_FLASH 1 +#define SPI_DEVICE 2 +#define SPI_FLASH_SIZE 0x1000000 +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PC3 + #define W25QXX_MISO_PIN PC2 + #define W25QXX_SCK_PIN PB13 +#endif + +/** + * _____ _____ + * (BEEPER)PC5 | · · | PE13(BTN_ENC) (SPI1 MISO) PA6 | · · | PA5 (SPI1 SCK) + * (LCD_EN)PD13 | · · | PC6(LCD_RS) (BTN_EN1) PE8 | · · | PE10 (SPI1 CS) + * (LCD_D4)PE14 | · · PE15(LCD_D5) (BTN_EN2) PE11 | · · PA7 (SPI1 MOSI) + * (LCD_D6)PD11 | · · | PD10(LCD_D7) (SPI1_RS) PE12 | · · | RESET + * GND | · · | 5V GND | · · | 3.3V + *  ̄ ̄ ̄  ̄ ̄ ̄ + * EXP1 EXP2 + */ + +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #define TFT_CS_PIN PD11 + #define TFT_SCK_PIN PA5 + #define TFT_MISO_PIN PA6 + #define TFT_MOSI_PIN PA7 + #define TFT_DC_PIN PD10 + #define TFT_RST_PIN PC6 + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN PC6 + #define TFT_BACKLIGHT_PIN PD13 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define LCD_BACKLIGHT_PIN PD13 + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + #define TFT_BUFFER_SIZE 14400 + +#elif HAS_SPI_LCD + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + //#define DOGLCD_SCK PA5 + //#define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + //#undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + + #endif // !MKS_MINI_12864 +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h new file mode 100644 index 0000000..5533e35 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -0,0 +1,371 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Robin Nano V3 supports up to 1 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "MKS Robin PRO V2" + +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 10 + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +//#define DISABLE_DEBUG + +// +// Note: MKS Robin board is using SPI2 interface. +// +//#define SPI_MODULE 2 + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + +// +// Limit Switches +// +#define X_DIAG_PIN PA15 +#define Y_DIAG_PIN PA12 +#define Z_DIAG_PIN PA11 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PA12 +#define Z_MIN_PIN PA11 +#define Z_MAX_PIN PC4 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA4 // MT_DET +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD7 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD4 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD9 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD8 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PD14 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PD1 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PD0 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN PD5 + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN PD7 + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN PD4 + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN PD9 + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN PD8 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif // HAS_TMC_UART + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PC2 // TH2 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC3 // HEATER1 +#define HEATER_1_PIN PB0 // HEATER2 +#define HEATER_BED_PIN PA0 // HOT BED + +#define FAN_PIN PB1 // FAN + +// +// Thermocouples +// +//#define MAX6675_SS_PIN PE5 // TC1 - CS1 +//#define MAX6675_SS_PIN PE6 // TC2 - CS2 + +// +// Misc. Functions +// +//#define POWER_LOSS_PIN PA2 // PW_DET +//#define PS_ON_PIN PA3 // PW_OFF +//#define SUICIDE_PIN PB2 // Enable MKSPWC support +//#define KILL_PIN PA2 // Enable MKSPWC support +//#define KILL_PIN_INVERTING true // Enable MKSPWC support +//#define LED_PIN PB2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +//#define USE_NEW_SPI_API 1 + +// +// Onboard SD card +// NOT compatible with LCD +// +// detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled +#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + + #if USE_NEW_SPI_API + #define SD_SPI MARLIN_SPI(HardwareSPI3, PC9) + #else + #define ENABLE_SPI3 + #define SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #endif + #define SD_DETECT_PIN PD12 + #endif +#endif + +/* +// +// LCD SD +// +#if SDCARD_CONNECTION == LCD + #define CUSTOM_SPI_PINS + #if ENABLED(CUSTOM_SPI_PINS) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 + #endif +#endif +*/ + +// +// LCD / Controller +#define SPI_FLASH +#define HAS_SPI_FLASH 1 +#define SPI_DEVICE 2 +#define SPI_FLASH_SIZE 0x1000000 +#if ENABLED(SPI_FLASH) + #define W25QXX_CS_PIN PB12 + #define W25QXX_MOSI_PIN PB15 + #define W25QXX_MISO_PIN PB14 + #define W25QXX_SCK_PIN PB13 +#endif + +/** + * _____ _____ + * (BEEPER)PC5 | · · | PE13(BTN_ENC) (SPI1 MISO) PA6 | · · | PA5 (SPI1 SCK) + * (LCD_EN)PD13 | · · | PC6(LCD_RS) (BTN_EN1) PE8 | · · | PE10 (SPI1 CS) + * (LCD_D4)PE14 | · · | PE15(LCD_D5) (BTN_EN2) PE11 | · · | PA7 (SPI1 MOSI) + * (LCD_D6)PD11 | · · | PD10(LCD_D7) (SPI DET) PE12 | · · | RESET + * GND | · · | 5V GND | · · | 3.3V + *  ̄ ̄ ̄  ̄ ̄ ̄ + * EXP1 EXP2 + */ + +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #define TFT_CS_PIN PD11 + #define TFT_SCK_PIN PA5 + #define TFT_MISO_PIN PA6 + #define TFT_MOSI_PIN PA7 + #define TFT_DC_PIN PD10 + #define TFT_RST_PIN PC6 + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN PC6 + #define TFT_BACKLIGHT_PIN PD13 + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define LCD_BACKLIGHT_PIN PD13 + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TOUCH_CS_PIN PE14 // SPI1_NSS + #define TOUCH_SCK_PIN PA5 // SPI1_SCK + #define TOUCH_MISO_PIN PA6 // SPI1_MISO + #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + //#define TFT_DRIVER ST7796 + #define TFT_BUFFER_SIZE 14400 + +#elif HAS_SPI_LCD + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + #define DOGLCD_A0 PD11 + #define DOGLCD_CS PE15 + //#define DOGLCD_SCK PA5 + //#define DOGLCD_MOSI PA7 + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + //#undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PE14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE15 + #define LCD_PINS_D6 PD11 + #define LCD_PINS_D7 PD10 + #endif + + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(600) + #endif + + #endif // !MKS_MINI_12864 +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h new file mode 100644 index 0000000..a60a278 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h @@ -0,0 +1,78 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * Pin assignments for the RUMBA32 + * + * https://aus3d.com.au/rumba32 + * https://github.com/Aus3D/RUMBA32 + */ + +#define BOARD_INFO_NAME "RUMBA32" + +#if NO_EEPROM_SELECTED + #if MB(RUMBA32_V1_0) + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #elif MB(RUMBA32_V1_1) + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24LC64T-I/OT) + #endif +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +#include "pins_RUMBA32_common.h" + +#if MB(RUMBA32_V1_1) + + #define SERVO0_PIN PA15 + #undef BTN_PIN + + #if HAS_TMC_UART + // + // TMC2208/TMC2209 stepper drivers - Software Serial is used according to below pins + // + #define X_SERIAL_TX_PIN PA14 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PA13 + #define Y_SERIAL_RX_PIN PE4 + + #define Z_SERIAL_TX_PIN PB10 + #define Z_SERIAL_RX_PIN PE0 + + #define E0_SERIAL_TX_PIN PD11 + #define E0_SERIAL_RX_PIN PC13 + + #define E1_SERIAL_TX_PIN PB3 + #define E1_SERIAL_RX_PIN PD5 + + #define E2_SERIAL_TX_PIN PB4 + #define E2_SERIAL_RX_PIN PD1 + #endif +#endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h new file mode 100644 index 0000000..4dce7b7 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h @@ -0,0 +1,90 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * Pin assignments for the MKS RUMBA32 + * + * https://github.com/makerbase-mks/MKS-RUMBA32 + * + * The MKS and Aus3D versions have the same pinout but the MKS version + * has some added resistors and LEDs. The resistors needed for the + * TMC2208/9 UART interface are among the additions. Also added were + * connectors and resistors dedicated to the TMC2130 sensorless homing + * interface. + */ + +#define BOARD_INFO_NAME "MKS RUMBA32" + +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +#include "pins_RUMBA32_common.h" + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PA3 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PA4 + #define Y_SERIAL_RX_PIN PE4 + + #define Z_SERIAL_TX_PIN PD13 + #define Z_SERIAL_RX_PIN PE0 + + #define E0_SERIAL_TX_PIN PD14 + #define E0_SERIAL_RX_PIN PC13 + + #define E1_SERIAL_TX_PIN PD15 + #define E1_SERIAL_RX_PIN PD5 + + #define E2_SERIAL_TX_PIN PD12 + #define E2_SERIAL_RX_PIN PD1 +#endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h new file mode 100644 index 0000000..2a0cfa8 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -0,0 +1,187 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * Common pin assignments for all RUMBA32 boards + */ + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "RUMBA32 boards support up to 3 hotends / E-steppers." +#endif + +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0 +// This can be removed when Core version is updated and PWM behaviour is fixed. +#define FAN_SOFT_PWM + +// +// Configure Timers +// TIM6 is used for TONE +// TIM7 is used for SERVO +// TIMER_SERIAL defaults to TIM7 and must be overridden in the platformio.h file if SERVO will also be used. +// This will be difficult to solve from the Arduino IDE, without modifying the RUMBA32 variant +// included with the STM32 framework. + +#define STEP_TIMER 10 +#define TEMP_TIMER 14 + +// +// Limit Switches +// +#define X_MIN_PIN PB12 +#define X_MAX_PIN PB13 +#define Y_MIN_PIN PB15 +#define Y_MAX_PIN PD8 +#define Z_MIN_PIN PD9 +#define Z_MAX_PIN PD10 + +// +// Steppers +// +#define X_STEP_PIN PA0 +#define X_DIR_PIN PC15 +#define X_ENABLE_PIN PC11 +#define X_CS_PIN PC14 + +#define Y_STEP_PIN PE5 +#define Y_DIR_PIN PE6 +#define Y_ENABLE_PIN PE3 +#define Y_CS_PIN PE4 + +#define Z_STEP_PIN PE1 +#define Z_DIR_PIN PE2 +#define Z_ENABLE_PIN PB7 +#define Z_CS_PIN PE0 + +#define E0_STEP_PIN PB5 +#define E0_DIR_PIN PB6 +#define E0_ENABLE_PIN PC12 +#define E0_CS_PIN PC13 + +#define E1_STEP_PIN PD6 +#define E1_DIR_PIN PD7 +#define E1_ENABLE_PIN PD4 +#define E1_CS_PIN PD5 + +#define E2_STEP_PIN PD2 +#define E2_DIR_PIN PD3 +#define E2_ENABLE_PIN PD0 +#define E2_CS_PIN PD1 + +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PA7 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PA6 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PA5 + #endif +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC4 +#define TEMP_1_PIN PC3 +#define TEMP_2_PIN PC2 +#define TEMP_3_PIN PC1 +#define TEMP_BED_PIN PC0 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC6 +#define HEATER_1_PIN PC7 +#define HEATER_2_PIN PC8 +#define HEATER_BED_PIN PA1 + +#define FAN_PIN PC9 +#define FAN1_PIN PA8 + +// +// SPI +// +#define SD_SCK_PIN PA5 +#define SD_MISO_PIN PA6 +#define SD_MOSI_PIN PA7 + +// +// Misc. Functions +// +#define LED_PIN PB14 +#define BTN_PIN PC10 +#define PS_ON_PIN PE11 +#define KILL_PIN PC5 + +#define SDSS PA2 +#define SD_DETECT_PIN PB0 +#define BEEPER_PIN PE8 + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + + #define BTN_EN1 PB2 + #define BTN_EN2 PB1 + #define BTN_ENC PE7 + + #define LCD_PINS_RS PE10 + #define LCD_PINS_ENABLE PE9 + #define LCD_PINS_D4 PE12 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS PE13 + #define DOGLCD_A0 PE14 + #endif + + #if IS_ULTIPANEL + #define LCD_PINS_D5 PE13 + #define LCD_PINS_D6 PE14 + #define LCD_PINS_D7 PE15 + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + // Alter timing for graphical display + #if HAS_MARLINUI_U8GLIB + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) + #endif + #endif + +#endif diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h new file mode 100644 index 0000000..2567951 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h @@ -0,0 +1,359 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ + +// Source: https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/ST3DP001_EVAL/variant.cpp + +/** + * HOW TO COMPILE + * + * PlatformIO - Use the STM32F401VE_STEVAL environment (or the "Auto Build Marlin" extension). + * + * Arduino - Tested with 1.8.10 + * Install library per https://github.com/stm32duino/Arduino_Core_STM32 + * Make the following selections under the TOOL menu in the Arduino IDE + * Board: "3D printer boards" + * Board part number: "STEVAL-3DP001V1" + * U(S)ART support: "Enabled (generic "Serial")" + * USB support (if available): "CDC (no generic "Serial")" + * Optimize: "Smallest (-Os default)" + * C Runtime Library: "newlib Nano (default)" + */ + +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#endif + +#ifndef MACHINE_NAME + #define MACHINE_NAME "STEVAL-3DP001V1" +#endif + +// +// Limit Switches +// +#define X_MIN_PIN 39 // PD8 X_STOP +#define Y_MIN_PIN 40 // PD9 Y_STOP +#define Z_MIN_PIN 41 // PD10 Z_STOP + +#define X_MAX_PIN 44 // PD0 W_STOP +#define Y_MAX_PIN 43 // PA8 V_STOP +#define Z_MAX_PIN 42 // PD11 U_STOP + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN 16 // PA4 +//#endif + +// +// Filament runout +// +//#define FIL_RUNOUT_PIN 53 // PA3 BED_THE + +// +// Steppers +// + +#define X_STEP_PIN 61 // PE14 X_PWM +#define X_DIR_PIN 62 // PE15 X_DIR +#define X_ENABLE_PIN 60 // PE13 X_RES +#define X_CS_PIN 16 // PA4 SPI_CS + +#define Y_STEP_PIN 64 // PB10 Y_PWM +#define Y_DIR_PIN 65 // PE9 Y_DIR +#define Y_ENABLE_PIN 63 // PE10 Y_RES +#define Y_CS_PIN 16 // PA4 SPI_CS + +#define Z_STEP_PIN 67 // PC6 Z_PWM +#define Z_DIR_PIN 68 // PC0 Z_DIR +#define Z_ENABLE_PIN 66 // PC15 Z_RES +#define Z_CS_PIN 16 // PA4 SPI_CS + +#define E0_STEP_PIN 71 // PD12 E1_PW +#define E0_DIR_PIN 70 // PC13 E1_DIR +#define E0_ENABLE_PIN 69 // PC14 E1_RE +#define E0_CS_PIN 16 // PA4 SPI_CS + +#define E1_STEP_PIN 73 // PE5 E2_PWM +#define E1_DIR_PIN 74 // PE6 E2_DIR +#define E1_ENABLE_PIN 72 // PE4 E2_RESE +#define E1_CS_PIN 16 // PA4 SPI_CS + +#define E2_STEP_PIN 77 // PB8 E3_PWM +#define E2_DIR_PIN 76 // PE2 E3_DIR +#define E2_ENABLE_PIN 75 // PE3 E3_RESE +#define E2_CS_PIN 16 // PA4 SPI_CS + +// needed to pass a sanity check +#define X2_CS_PIN 16 // PA4 SPI_CS +#define Y2_CS_PIN 16 // PA4 SPI_CS +#define Z2_CS_PIN 16 // PA4 SPI_CS +#define Z3_CS_PIN 16 // PA4 SPI_CS +#define E3_CS_PIN 16 // PA4 SPI_CS +#define E4_CS_PIN 16 // PA4 SPI_CS +#define E5_CS_PIN 16 // PA4 SPI_CS + +#if HAS_L64XX + #define L6470_CHAIN_SCK_PIN 17 // PA5 + #define L6470_CHAIN_MISO_PIN 18 // PA6 + #define L6470_CHAIN_MOSI_PIN 19 // PA7 + #define L6470_CHAIN_SS_PIN 16 // PA4 + + //#define SD_SCK_PIN L6470_CHAIN_SCK_PIN + //#define SD_MISO_PIN L6470_CHAIN_MISO_PIN + //#define SD_MOSI_PIN L6470_CHAIN_MOSI_PIN +#else + //#define SD_SCK_PIN 13 // PB13 SPI_S + //#define SD_MISO_PIN 12 // PB14 SPI_M + //#define SD_MOSI_PIN 11 // PB15 SPI_M +#endif + +/** + * Macro to reset/enable L6474 stepper drivers + * + * IMPORTANT - To disable (bypass) L6474s, install the corresponding + * resistors (R11 - R17) and change the "V" to "0" for the + * corresponding pins here: + */ +#define ENABLE_RESET_L64XX_CHIPS(V) do{ OUT_WRITE(X_ENABLE_PIN, V); \ + OUT_WRITE(Y_ENABLE_PIN, V); \ + OUT_WRITE(Z_ENABLE_PIN, V); \ + OUT_WRITE(E0_ENABLE_PIN,V); \ + OUT_WRITE(E1_ENABLE_PIN,V); \ + OUT_WRITE(E2_ENABLE_PIN,V); \ + }while(0) + +// +// Temperature Sensors +// +#define TEMP_0_PIN 3 // Analog input 3, digital pin 54 PA0 E1_THERMISTOR +#define TEMP_1_PIN 4 // Analog input 4, digital pin 55 PA1 E2_THERMISTOR +#define TEMP_2_PIN 5 // Analog input 5, digital pin 56 PA2 E3_THERMISTOR +#define TEMP_BED_PIN 0 // Analog input 0, digital pin 51 PC2 BED_THERMISTOR_1 +#define TEMP_BED_1_PIN 1 // Analog input 1, digital pin 52 PC3 BED_THERMISTOR_2 +#define TEMP_BED_2_PIN 2 // Analog input 2, digital pin 53 PA3 BED_THERMISTOR_3 + +// +// Heaters / Fans +// +#define HEATER_0_PIN 48 // PC7 E1_HEAT_PWM +#define HEATER_1_PIN 49 // PB0 E2_HEAT_PWM +#define HEATER_2_PIN 50 // PB1 E3_HEAT_PWM +#define HEATER_BED_PIN 46 // PD14 (BED_HEAT_1 FET +#define HEATER_BED_1_PIN 45 // PD13 (BED_HEAT_2 FET +#define HEATER_BED_2_PIN 47 // PD15 (BED_HEAT_3 FET + +#define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET +#define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET +#define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 58 // FAN1_PIN +#endif + +// +// Misc functions +// +#define SDSS 16 // PA4 SPI_CS +#define LED_PIN -1 // 9 // PE1 green LED Heart beat +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT + +// +// LCD / Controller +// +//#define SD_DETECT_PIN 66 // PA15 SD_CA +//#define BEEPER_PIN 24 // PC9 SDIO_D1 +//#define LCD_PINS_RS 65 // PE9 Y_DIR +//#define LCD_PINS_ENABLE 59 // PE8 E3_FAN +//#define LCD_PINS_D4 10 // PB12 SPI_C +//#define LCD_PINS_D5 13 // PB13 SPI_S +//#define LCD_PINS_D6 12 // PB14 SPI_M +//#define LCD_PINS_D7 11 // PB15 SPI_M +//#define BTN_EN1 57 // PC4 E1_FAN +//#define BTN_EN2 58 // PC5 E2_FAN +//#define BTN_ENC 52 // PC3 BED_THE + +// +// Extension pins +// +//#define EXT0_PIN 49 // PB0 E2_HEAT +//#define EXT1_PIN 50 // PB1 E3_HEAT +//#define EXT2_PIN // PB2 not used (tied to ground +//#define EXT3_PIN 39 // PD8 X_STOP +//#define EXT4_PIN 40 // PD9 Y_STOP +//#define EXT5_PIN 41 // PD10 Z_STOP +//#define EXT6_PIN 42 // PD11 +//#define EXT7_PIN 71 // PD12 E1_PW +//#define EXT8_PIN 64 // PB10 Y_PWM + +// WIFI +// 2 // PD3 CTS +// 3 // PD4 RTS +// 4 // PD5 TX +// 5 // PD6 RX +// 6 // PB5 WIFI_WAKEUP +// 7 // PE11 WIFI_RESET +// 8 // PE12 WIFI_BOOT + +// I2C USER +// 14 // PB7 SDA +// 15 // PB6 SCL + +// JTAG +// 20 // PA13 JTAG_TMS/SWDIO +// 21 // PA14 JTAG_TCK/SWCLK +// 22 // PB3 JTAG_TDO/SWO + +// +// Onboard SD support +// +#define SDIO_D0_PIN 23 // PC8 SDIO_D0 +#define SDIO_D1_PIN 24 // PC9 SDIO_D1 +//#define SD_CARD_DETECT_PIN 25 // PA15 SD_CARD_DETECT +#define SDIO_D2_PIN 26 // PC10 SDIO_D2 +#define SDIO_D3_PIN 27 // PC11 SDIO_D3 +#define SDIO_CK_PIN 28 // PC12 SDIO_CK +#define SDIO_CMD_PIN 29 // PD2 SDIO_CMD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT // Use SDIO for onboard SD + + #ifndef SDIO_SUPPORT + #define SOFTWARE_SPI // Use soft SPI for onboard SD + #undef SDSS + #define SDSS SDIO_D3_PIN + #define SD_SCK_PIN SDIO_CK_PIN + #define SD_MISO_PIN SDIO_D0_PIN + #define SD_MOSI_PIN SDIO_CMD_PIN + #endif +#endif + +// OTG +// 30 // PA11 OTG_DM +// 31 // PA12 OTG_DP + +// USER_PINS +// 34 // PD7 USER3 +// 35 // PB9 USER1 +// 36 // PE0 USER2 +// 37 // PB4 USER4 + +// USERKET +// 38 // PE7 USER_BUTTON + +// 0 // PA9 TX +// 1 // PA10 RX + +// IR/PROBE +// 32 // PD1 IR_OUT +// 33 // PC1 IR_ON + +/** + * Logical pin vs. port/pin cross reference + * + * PA0 54 // E1_THERMISTOR PA9 0 // TX + * PA1 55 // E2_THERMISTOR PA10 1 // RX + * PA2 56 // E3_THERMISTOR PD3 2 // CTS + * PA3 53 // BED_THERMISTOR_3 PD4 3 // RTS + * PA4 16 // SPI_CS PD5 4 // TX + * PA5 17 // SPI_SCK PD6 5 // RX + * PA6 18 // SPI_MISO PB5 6 // WIFI_WAKEUP + * PA7 19 // SPI_MOSI PE11 7 // WIFI_RESET + * PA8 43 // V_STOP PE12 8 // WIFI_BOOT + * PA9 0 // TX PE1 9 // STATUS_LED + * PA10 1 // RX PB12 10 // SPI_CS + * PA11 30 // OTG_DM PB15 11 // SPI_MOSI + * PA12 31 // OTG_DP PB14 12 // SPI_MISO + * PA13 20 // JTAG_TMS/SWDIO PB13 13 // SPI_SCK + * PA14 21 // JTAG_TCK/SWCLK PB7 14 // SDA + * PA15 25 // SD_CARD_DETECT PB6 15 // SCL + * PB0 49 // E2_HEAT_PWM PA4 16 // SPI_CS + * PB1 50 // E3_HEAT_PWM PA5 17 // SPI_SCK + * PB3 22 // JTAG_TDO/SWO PA6 18 // SPI_MISO + * PB4 37 // USER4 PA7 19 // SPI_MOSI + * PB5 6 // WIFI_WAKEUP PA13 20 // JTAG_TMS/SWDIO + * PB6 15 // SCL PA14 21 // JTAG_TCK/SWCLK + * PB7 14 // SDA PB3 22 // JTAG_TDO/SWO + * PB8 77 // E3_PWM PC8 23 // SDIO_D0 + * PB9 35 // USER1 PC9 24 // SDIO_D1 + * PB10 64 // Y_PWM PA15 25 // SD_CARD_DETECT + * PB12 10 // SPI_CS PC10 26 // SDIO_D2 + * PB13 13 // SPI_SCK PC11 27 // SDIO_D3 + * PB14 12 // SPI_MISO PC12 28 // SDIO_CK + * PB15 11 // SPI_MOSI PD2 29 // SDIO_CMD + * PC0 68 // Z_DIR PA11 30 // OTG_DM + * PC1 33 // IR_ON PA12 31 // OTG_DP + * PC2 51 // BED_THERMISTOR_1 PD1 32 // IR_OUT + * PC3 52 // BED_THERMISTOR_2 PC1 33 // IR_ON + * PC4 57 // E1_FAN PD7 34 // USER3 + * PC5 58 // E2_FAN PB9 35 // USER1 + * PC6 67 // Z_PWM PE0 36 // USER2 + * PC7 48 // E1_HEAT_PWM PB4 37 // USER4 + * PC8 23 // SDIO_D0 PE7 38 // USER_BUTTON + * PC9 24 // SDIO_D1 PD8 39 // X_STOP + * PC10 26 // SDIO_D2 PD9 40 // Y_STOP + * PC11 27 // SDIO_D3 PD10 41 // Z_STOP + * PC12 28 // SDIO_CK PD11 42 // U_STOP + * PC13 70 // E1_DIR PA8 43 // V_STOP + * PC14 69 // E1_RESET PD0 44 // W_STOP + * PC15 66 // Z_RESET PD13 45 // BED_HEAT_2 + * PD0 44 // W_STOP PD14 46 // BED_HEAT_1 + * PD1 32 // IR_OUT PD15 47 // BED_HEAT_3 + * PD2 29 // SDIO_CMD PC7 48 // E1_HEAT_PWM + * PD3 2 // CTS PB0 49 // E2_HEAT_PWM + * PD4 3 // RTS PB1 50 // E3_HEAT_PWM + * PD5 4 // TX PC2 51 // BED_THERMISTOR_1 + * PD6 5 // RX PC3 52 // BED_THERMISTOR_2 + * PD7 34 // USER3 PA3 53 // BED_THERMISTOR_3 + * PD8 39 // X_STOP PA0 54 // E1_THERMISTOR + * PD9 40 // Y_STOP PA1 55 // E2_THERMISTOR + * PD10 41 // Z_STOP PA2 56 // E3_THERMISTOR + * PD11 42 // U_STOP PC4 57 // E1_FAN + * PD12 71 // E1_PWM PC5 58 // E2_FAN + * PD13 45 // BED_HEAT_2 PE8 59 // E3_FAN + * PD14 46 // BED_HEAT_1 PE13 60 // X_RESET + * PD15 47 // BED_HEAT_3 PE14 61 // X_PWM + * PE0 36 // USER2 PE15 62 // X_DIR + * PE1 9 // STATUS_LED PE10 63 // Y_RESET + * PE2 76 // E3_DIR PB10 64 // Y_PWM + * PE3 75 // E3_RESET PE9 65 // Y_DIR + * PE4 72 // E2_RESET PC15 66 // Z_RESET + * PE5 73 // E2_PWM PC6 67 // Z_PWM + * PE6 74 // E2_DIR PC0 68 // Z_DIR + * PE7 38 // USER_BUTTON PC14 69 // E1_RESET + * PE8 59 // E3_FAN PC13 70 // E1_DIR + * PE9 65 // Y_DIR PD12 71 // E1_PWM + * PE10 63 // Y_RESET PE4 72 // E2_RESET + * PE11 7 // WIFI_RESET PE5 73 // E2_PWM + * PE12 8 // WIFI_BOOT PE6 74 // E2_DIR + * PE13 60 // X_RESET PE3 75 // E3_RESET + * PE14 61 // X_PWM PE2 76 // E3_DIR + * PE15 62 // X_DIR PB8 77 // E3_PWM + */ diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h new file mode 100644 index 0000000..1135af8 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -0,0 +1,195 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +#if NOT_TARGET(STM32F4, STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "STM32F4 supports up to 2 hotends / E-steppers." +#endif + +#define DEFAULT_MACHINE_NAME "STM32F446VET6" +#define BOARD_INFO_NAME "STM32F4 VAkE" + +//#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB + +// +// Servos +// +//#define SERVO0_PIN PE13 +//#define SERVO1_PIN PE14 + +// +// Limit Switches +// +#define X_STOP_PIN PE10 +#define Y_STOP_PIN PE9 +#define Z_STOP_PIN PE8 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA4 +#endif + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PA3 + +// +// Steppers +// + +#define STEPPER_ENABLE_PIN PB2 + +#define X_STEP_PIN PC6 // X_STEP +#define X_DIR_PIN PC7 // X_DIR +#define X_ENABLE_PIN PB2 // +#ifndef X_CS_PIN + #define X_CS_PIN PC8 // X_CS +#endif + +#define Y_STEP_PIN PD9 // Y_STEP +#define Y_DIR_PIN PD10 // Y_DIR +#define Y_ENABLE_PIN PB2 // +#ifndef Y_CS_PIN + #define Y_CS_PIN PD11 // Y_CS +#endif + +#define Z_STEP_PIN PE15 // Z_STEP +#define Z_DIR_PIN PB10 // Z_DIR +#define Z_ENABLE_PIN PB2 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD8 +#endif + +#define E0_STEP_PIN PB1 +#define E0_DIR_PIN PB13 +#define E0_ENABLE_PIN PB2 +#ifndef E0_CS_PIN + #define E0_CS_PIN PE11 +#endif + +#define E1_STEP_PIN PC4 +#define E1_DIR_PIN PC5 +#define E1_ENABLE_PIN PB2 +#ifndef E1_CS_PIN + #define E1_CS_PIN PB0 +#endif + +#define SD_SCK_PIN PE12 // PA5 // SPI1 for SD card +#define SD_MISO_PIN PE13 // PA6 +#define SD_MOSI_PIN PE14 // PA7 + +// added for SD card : optional or not ??? +//#define SD_CHIP_SELECT_PIN SDSS // The default chip select pin for the SD card is SS. +// The following three pins must not be redefined for hardware SPI. +//#define SPI_MOSI_PIN SD_MOSI_PIN // SPI Master Out Slave In pin +//#define SPI_MISO_PIN SD_MISO_PIN // SPI Master In Slave Out pin +//#define SPI_SCK_PIN SD_SCK_PIN // SPI Clock pin + +// +// Temperature Sensors (Analog inputs) +// + +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN PC1 // Analog Input +#define TEMP_2_PIN PC2 // Analog Input +#define TEMP_3_PIN PC3 // Analog Input +#define TEMP_BED_PIN PC3 // Analog Input + +// +// Heaters / Fans +// + +#define HEATER_0_PIN PD15 +#define HEATER_1_PIN PD14 +#define HEATER_BED_PIN PD12 + +#ifndef FAN_PIN + #define FAN_PIN PD13 +#endif +#define FAN1_PIN PB5 // PA0 +#define FAN2_PIN PB4 // PA1 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PD13 +#endif + +// +// Misc. Functions +// + +//#define CASE_LIGHT_PIN_CI PF13 +//#define CASE_LIGHT_PIN_DO PF14 +//#define NEOPIXEL_PIN PF13 + +// +// Průša i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN PG3 +//#define E_MUX1_PIN PG4 + +#define LED_PIN PB14 // Alive +#define PS_ON_PIN PE0 +#define KILL_PIN PD5 +#define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT + +#if ENABLED(SDSUPPORT) + #define SD_DETECT_PIN PB7 + #define SD_SS_PIN PB_15 // USD_CS -> CS for onboard SD +#endif + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + #if ENABLED(SDSUPPORT) + #define SDSS PB6 // CS for SD card in LCD + #endif + #define BEEPER_PIN PC9 + #define LCD_PINS_RS PC12 + #define LCD_PINS_ENABLE PD7 + #define LCD_PINS_D4 PD1 + #define LCD_PINS_D5 PD2 + #define LCD_PINS_D6 PD3 + #define LCD_PINS_D7 PD4 + #define BTN_EN1 PD6 + #define BTN_EN2 PD0 + #define BTN_ENC PB12 +#endif + +// +// ST7920 Delays +// +#ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) +#endif +#ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) +#endif +#ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) +#endif |