2017-07-06 16:43:00 +02:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 15:00:57 +01:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2017-07-06 16:43:00 +02:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 06:57:50 +02:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2017-07-06 16:43:00 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2020-07-23 05:20:14 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2017-07-06 16:43:00 +02:00
|
|
|
*
|
|
|
|
*/
|
2019-07-05 05:44:12 +02:00
|
|
|
#pragma once
|
2017-07-06 16:43:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Melzi (Creality) pin assignments
|
2017-08-26 09:11:47 +02:00
|
|
|
*
|
|
|
|
* The Creality board needs a bootloader installed before Marlin can be uploaded.
|
|
|
|
* If you don't have a chip programmer you can use a spare Arduino plus a few
|
|
|
|
* electronic components to write the bootloader.
|
|
|
|
*
|
2020-07-23 05:20:14 +02:00
|
|
|
* See https://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/
|
2020-06-11 00:19:39 +02:00
|
|
|
*
|
|
|
|
* Schematic: https://bit.ly/2XOnsWb
|
2017-07-06 16:43:00 +02:00
|
|
|
*/
|
|
|
|
|
2019-08-21 02:08:58 +02:00
|
|
|
#define BOARD_INFO_NAME "Melzi (Creality)"
|
2017-08-26 09:11:47 +02:00
|
|
|
|
2020-06-05 02:55:39 +02:00
|
|
|
// Alter timing for graphical display
|
2021-08-28 22:27:52 +02:00
|
|
|
#if ENABLED(U8GLIB_ST7920)
|
2021-09-06 02:21:25 +02:00
|
|
|
#define BOARD_ST7920_DELAY_1 125
|
|
|
|
#define BOARD_ST7920_DELAY_2 125
|
|
|
|
#define BOARD_ST7920_DELAY_3 125
|
2020-06-05 02:55:39 +02:00
|
|
|
#endif
|
|
|
|
|
2018-02-10 21:44:14 +01:00
|
|
|
#include "pins_MELZI.h"
|
2017-07-06 16:43:00 +02:00
|
|
|
|
2020-01-04 03:44:16 +01:00
|
|
|
//
|
|
|
|
// For the stock CR-10 enable CR10_STOCKDISPLAY in Configuration.h
|
|
|
|
//
|
2017-07-06 16:43:00 +02:00
|
|
|
#undef LCD_SDSS
|
|
|
|
#undef LED_PIN
|
|
|
|
#undef LCD_PINS_RS
|
|
|
|
#undef LCD_PINS_ENABLE
|
|
|
|
#undef LCD_PINS_D4
|
|
|
|
#undef LCD_PINS_D5
|
|
|
|
#undef LCD_PINS_D6
|
|
|
|
#undef LCD_PINS_D7
|
|
|
|
|
2020-11-07 23:53:37 +01:00
|
|
|
#define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi)
|
|
|
|
#define LCD_PINS_RS 28 // ST9720 CS
|
|
|
|
#define LCD_PINS_ENABLE 17 // ST9720 DAT
|
|
|
|
#define LCD_PINS_D4 30 // ST9720 CLK
|
2017-08-26 09:11:47 +02:00
|
|
|
|
2019-09-10 06:58:57 +02:00
|
|
|
#if ENABLED(BLTOUCH)
|
2021-02-08 05:44:49 +01:00
|
|
|
#ifndef SERVO0_PIN
|
|
|
|
#define SERVO0_PIN 27
|
|
|
|
#endif
|
|
|
|
#if SERVO0_PIN == BEEPER_PIN
|
|
|
|
#undef BEEPER_PIN
|
|
|
|
#endif
|
2020-07-03 02:32:06 +02:00
|
|
|
#elif ENABLED(FILAMENT_RUNOUT_SENSOR)
|
|
|
|
#ifndef FIL_RUNOUT_PIN
|
2020-11-07 23:53:37 +01:00
|
|
|
#define FIL_RUNOUT_PIN 27
|
2020-07-03 02:32:06 +02:00
|
|
|
#endif
|
|
|
|
#if FIL_RUNOUT_PIN == BEEPER_PIN
|
|
|
|
#undef BEEPER_PIN
|
|
|
|
#endif
|
2018-10-26 23:09:04 +02:00
|
|
|
#endif
|
|
|
|
|
2017-12-05 08:57:00 +01:00
|
|
|
#if ENABLED(MINIPANEL)
|
2017-12-06 20:54:58 +01:00
|
|
|
#undef DOGLCD_CS
|
2020-11-07 23:53:37 +01:00
|
|
|
#define DOGLCD_CS LCD_PINS_RS
|
2017-12-05 08:57:00 +01:00
|
|
|
#endif
|
|
|
|
|
2017-07-06 16:43:00 +02:00
|
|
|
/**
|
|
|
|
PIN: 0 Port: B0 E0_DIR_PIN protected
|
|
|
|
PIN: 1 Port: B1 E0_STEP_PIN protected
|
|
|
|
PIN: 2 Port: B2 Z_DIR_PIN protected
|
|
|
|
PIN: 3 Port: B3 Z_STEP_PIN protected
|
|
|
|
PIN: 4 Port: B4 AVR_SS_PIN protected
|
|
|
|
. FAN_PIN protected
|
2021-01-01 21:31:15 +01:00
|
|
|
. SD_SS_PIN protected
|
2017-07-06 16:43:00 +02:00
|
|
|
PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1
|
2021-01-01 21:31:15 +01:00
|
|
|
. SD_MOSI_PIN Output = 1
|
2017-07-06 16:43:00 +02:00
|
|
|
PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0
|
2021-01-01 21:31:15 +01:00
|
|
|
. SD_MISO_PIN Input = 0
|
2017-07-06 16:43:00 +02:00
|
|
|
PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0
|
2021-01-01 21:31:15 +01:00
|
|
|
. SD_SCK_PIN Output = 0
|
2017-07-06 16:43:00 +02:00
|
|
|
PIN: 8 Port: D0 RXD Input = 1
|
|
|
|
PIN: 9 Port: D1 TXD Input = 0
|
|
|
|
PIN: 10 Port: D2 BTN_EN2 Input = 1
|
|
|
|
PIN: 11 Port: D3 BTN_EN1 Input = 1
|
|
|
|
PIN: 12 Port: D4 HEATER_BED_PIN protected
|
|
|
|
PIN: 13 Port: D5 HEATER_0_PIN protected
|
|
|
|
PIN: 14 Port: D6 E0_ENABLE_PIN protected
|
|
|
|
. X_ENABLE_PIN protected
|
|
|
|
. Y_ENABLE_PIN protected
|
|
|
|
PIN: 15 Port: D7 X_STEP_PIN protected
|
|
|
|
PIN: 16 Port: C0 BTN_ENC Input = 1
|
|
|
|
. SCL Input = 1
|
|
|
|
PIN: 17 Port: C1 LCD_PINS_ENABLE Output = 0
|
|
|
|
. SDA Output = 0
|
|
|
|
PIN: 18 Port: C2 X_MIN_PIN protected
|
|
|
|
. X_STOP_PIN protected
|
|
|
|
PIN: 19 Port: C3 Y_MIN_PIN protected
|
|
|
|
. Y_STOP_PIN protected
|
|
|
|
PIN: 20 Port: C4 Z_MIN_PIN protected
|
|
|
|
. Z_STOP_PIN protected
|
|
|
|
PIN: 21 Port: C5 X_DIR_PIN protected
|
|
|
|
PIN: 22 Port: C6 Y_STEP_PIN protected
|
|
|
|
PIN: 23 Port: C7 Y_DIR_PIN protected
|
|
|
|
PIN: 24 Port: A7 TEMP_0_PIN protected
|
|
|
|
PIN: 25 Port: A6 TEMP_BED_PIN protected
|
|
|
|
PIN: 26 Port: A5 Z_ENABLE_PIN protected
|
|
|
|
PIN: 27 Port: A4 BEEPER_PIN Output = 0
|
|
|
|
PIN: 28 Port: A3 LCD_PINS_RS Output = 0
|
|
|
|
PIN: 29 Port: A2 <unused/unknown> Input = 0
|
|
|
|
PIN: 30 Port: A1 LCD_PINS_D4 Output = 1
|
|
|
|
PIN: 31 Port: A0 SDSS Output = 1
|
|
|
|
*/
|
2020-06-11 00:19:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* EXP1 Connector EXP1 as CR10 STOCKDISPLAY
|
2021-08-28 22:27:52 +02:00
|
|
|
* ------ ------
|
|
|
|
* PA4 |10 9 | PC0 BEEPER_PIN |10 9 | BTN_ENC
|
|
|
|
* PD3 | 8 7 | RESET BTN_EN1 | 8 7 | RESET
|
|
|
|
* PD2 6 5 | PA1 BTN_EN2 6 5 | LCD_PINS_D4 (ST9720 CLK)
|
|
|
|
* PA3 | 4 3 | PC1 (ST9720 CS) LCD_PINS_RS | 4 3 | LCD_PINS_ENABLE (ST9720 DAT)
|
|
|
|
* GND | 2 1 | 5V GND | 2 1 | 5V
|
|
|
|
* ------ ------
|
2020-06-11 00:19:39 +02:00
|
|
|
*/
|