LaughingMan

Anthony Hart's CR-10S pins_RAMPS.h 1.1.8

Apr 20th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 15.34 KB | None | 0 0
  1. /**
  2.  * Marlin 3D Printer Firmware
  3.  * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4.  *
  5.  * Based on Sprinter and grbl.
  6.  * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7.  *
  8.  * This program is free software: you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation, either version 3 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20.  *
  21.  */
  22.  
  23. /**
  24.  * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments
  25.  *
  26.  * Applies to the following boards:
  27.  *
  28.  *  RAMPS_14_EFB (Hotend, Fan, Bed)
  29.  *  RAMPS_14_EEB (Hotend0, Hotend1, Bed)
  30.  *  RAMPS_14_EFF (Hotend, Fan0, Fan1)
  31.  *  RAMPS_14_EEF (Hotend0, Hotend1, Fan)
  32.  *  RAMPS_14_SF  (Spindle, Controller Fan)
  33.  *
  34.  *  RAMPS_13_EFB (Hotend, Fan, Bed)
  35.  *  RAMPS_13_EEB (Hotend0, Hotend1, Bed)
  36.  *  RAMPS_13_EFF (Hotend, Fan0, Fan1)
  37.  *  RAMPS_13_EEF (Hotend0, Hotend1, Fan)
  38.  *  RAMPS_13_SF  (Spindle, Controller Fan)
  39.  *
  40.  *  Other pins_MYBOARD.h files may override these defaults
  41.  *
  42.  *  Differences between
  43.  *  RAMPS_13 | RAMPS_14
  44.  *         7 | 11
  45.  */
  46.  
  47. #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
  48.   #error "Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
  49. #endif
  50.  
  51. #ifndef BOARD_NAME
  52.   #define BOARD_NAME "RAMPS 1.4"
  53. #endif
  54.  
  55. #define LARGE_FLASH true
  56.  
  57. //
  58. // Servos
  59. //
  60. #ifdef IS_RAMPS_13
  61.   #define SERVO0_PIN        7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI
  62. #else
  63.   #define SERVO0_PIN       11
  64. #endif
  65. #define SERVO1_PIN          6
  66. #define SERVO2_PIN          5
  67. #ifndef SERVO3_PIN
  68.   #define SERVO3_PIN        4
  69. #endif
  70.  
  71. //
  72. // Limit Switches
  73. //
  74. #define X_MIN_PIN           3
  75. #ifndef X_MAX_PIN
  76.   #define X_MAX_PIN         2
  77. #endif
  78. #define Y_MIN_PIN          14
  79. #define Y_MAX_PIN          15
  80. #define Z_MIN_PIN          18
  81. #define Z_MAX_PIN          19
  82.  
  83. //
  84. // Z Probe (when not Z_MIN_PIN)
  85. //
  86. #ifndef Z_MIN_PROBE_PIN
  87.   #define Z_MIN_PROBE_PIN  19
  88. #endif
  89.  
  90. //
  91. // Steppers
  92. //
  93. #define X_STEP_PIN         54
  94. #define X_DIR_PIN          55
  95. #define X_ENABLE_PIN       38
  96. #define X_CS_PIN           53
  97.  
  98. #define Y_STEP_PIN         60
  99. #define Y_DIR_PIN          61
  100. #define Y_ENABLE_PIN       56
  101. #define Y_CS_PIN           49
  102.  
  103. #define Z_STEP_PIN         46
  104. #define Z_DIR_PIN          48
  105. #define Z_ENABLE_PIN       62
  106. #define Z_CS_PIN           40
  107.  
  108. #define E0_STEP_PIN        26
  109. #define E0_DIR_PIN         28
  110. #define E0_ENABLE_PIN      24
  111. #define E0_CS_PIN          42
  112.  
  113. #define E1_STEP_PIN        36
  114. #define E1_DIR_PIN         34
  115. #define E1_ENABLE_PIN      30
  116. #define E1_CS_PIN          44
  117.  
  118.  
  119. #if ENABLED(HAVE_TMC2208)
  120.   /**
  121.    * TMC2208 stepper drivers
  122.    *
  123.    * Hardware serial communication ports.
  124.    * If undefined software serial is used according to the pins below
  125.    */
  126.   //#define X_HARDWARE_SERIAL  Serial1
  127.   //#define X2_HARDWARE_SERIAL Serial1
  128.   //#define Y_HARDWARE_SERIAL  Serial1
  129.   //#define Y2_HARDWARE_SERIAL Serial1
  130.   //#define Z_HARDWARE_SERIAL  Serial1
  131.   //#define Z2_HARDWARE_SERIAL Serial1
  132.   //#define E0_HARDWARE_SERIAL Serial1
  133.   //#define E1_HARDWARE_SERIAL Serial1
  134.   //#define E2_HARDWARE_SERIAL Serial1
  135.   //#define E3_HARDWARE_SERIAL Serial1
  136.   //#define E3_HARDWARE_SERIAL Serial1
  137.  
  138.   /**
  139.    * Software serial
  140.    */
  141.  
  142.   #define X_SERIAL_TX_PIN    59
  143.   #define X_SERIAL_RX_PIN    63
  144.   #define X2_SERIAL_TX_PIN   -1
  145.   #define X2_SERIAL_RX_PIN   -1
  146.  
  147.   #define Y_SERIAL_TX_PIN    64
  148.   #define Y_SERIAL_RX_PIN    40
  149.   #define Y2_SERIAL_TX_PIN   -1
  150.   #define Y2_SERIAL_RX_PIN   -1
  151.  
  152.   #define Z_SERIAL_TX_PIN    44
  153.   #define Z_SERIAL_RX_PIN    42
  154.   #define Z2_SERIAL_TX_PIN   -1
  155.   #define Z2_SERIAL_RX_PIN   -1
  156.  
  157.   #define E0_SERIAL_TX_PIN   66
  158.   #define E0_SERIAL_RX_PIN   65
  159.   #define E1_SERIAL_TX_PIN   -1
  160.   #define E1_SERIAL_RX_PIN   -1
  161.   #define E2_SERIAL_TX_PIN   -1
  162.   #define E2_SERIAL_RX_PIN   -1
  163.   #define E3_SERIAL_TX_PIN   -1
  164.   #define E3_SERIAL_RX_PIN   -1
  165.   #define E4_SERIAL_TX_PIN   -1
  166.   #define E4_SERIAL_RX_PIN   -1
  167. #endif
  168.  
  169. //
  170. // Temperature Sensors
  171. //
  172. #define TEMP_0_PIN         13   // Analog Input
  173. #define TEMP_1_PIN         15   // Analog Input
  174. #define TEMP_BED_PIN       14   // Analog Input
  175.  
  176. // SPI for Max6675 or Max31855 Thermocouple
  177. #if DISABLED(SDSUPPORT)
  178.   #define MAX6675_SS       66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
  179. #else
  180.   #define MAX6675_SS       66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
  181. #endif
  182.  
  183. //
  184. // Augmentation for auto-assigning RAMPS plugs
  185. //
  186. #if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
  187.   #if HOTENDS > 1
  188.     #if TEMP_SENSOR_BED
  189.       #define IS_RAMPS_EEB
  190.     #else
  191.       #define IS_RAMPS_EEF
  192.     #endif
  193.   #elif TEMP_SENSOR_BED
  194.     #define IS_RAMPS_EFB
  195.   #else
  196.     #define IS_RAMPS_EFF
  197.   #endif
  198. #endif
  199.  
  200. //
  201. // Heaters / Fans
  202. //
  203. #ifndef MOSFET_D_PIN
  204.   #define MOSFET_D_PIN  -1
  205. #endif
  206. #ifndef RAMPS_D8_PIN
  207.   #define RAMPS_D8_PIN   8
  208. #endif
  209. #ifndef RAMPS_D9_PIN
  210.   #define RAMPS_D9_PIN   9
  211. #endif
  212. #ifndef RAMPS_D10_PIN
  213.   #define RAMPS_D10_PIN 10
  214. #endif
  215.  
  216. #define HEATER_0_PIN     RAMPS_D10_PIN
  217.  
  218. #if ENABLED(IS_RAMPS_EFB)                      // Hotend, Fan, Bed
  219.   #define FAN_PIN        RAMPS_D9_PIN
  220.   #define HEATER_BED_PIN RAMPS_D8_PIN
  221. #elif ENABLED(IS_RAMPS_EEF)                    // Hotend, Hotend, Fan
  222.   #define HEATER_1_PIN   RAMPS_D9_PIN
  223.   #define FAN_PIN        RAMPS_D8_PIN
  224. #elif ENABLED(IS_RAMPS_EEB)                    // Hotend, Hotend, Bed
  225.   #define HEATER_1_PIN   RAMPS_D9_PIN
  226.   #define HEATER_BED_PIN RAMPS_D8_PIN
  227. #elif ENABLED(IS_RAMPS_EFF)                    // Hotend, Fan, Fan
  228.   #define FAN_PIN        RAMPS_D9_PIN
  229.   #define FAN1_PIN       RAMPS_D8_PIN
  230. #elif ENABLED(IS_RAMPS_SF)                     // Spindle, Fan
  231.   #define FAN_PIN        RAMPS_D8_PIN
  232. #else                                          // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  233.   #define FAN_PIN        RAMPS_D9_PIN
  234.   #define HEATER_BED_PIN RAMPS_D8_PIN
  235.   #if HOTENDS == 1
  236.     #define FAN1_PIN     MOSFET_D_PIN
  237.   #else
  238.     #define HEATER_1_PIN MOSFET_D_PIN
  239.   #endif
  240. #endif
  241.  
  242. #ifndef FAN_PIN
  243.   #define FAN_PIN 4      // IO pin. Buffer needed
  244. #endif
  245.  
  246. //
  247. // Misc. Functions
  248. //
  249. #define SDSS               53
  250. #define LED_PIN            13
  251.  
  252. #ifndef FILWIDTH_PIN
  253.   #define FILWIDTH_PIN      5   // Analog Input on AUX2
  254. #endif
  255.  
  256. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  257. #define FIL_RUNOUT_PIN      2
  258.  
  259. #ifndef PS_ON_PIN
  260.   #define PS_ON_PIN        12
  261. #endif
  262.  
  263. #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
  264.   #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
  265.     #define CASE_LIGHT_PIN   6      // MUST BE HARDWARE PWM
  266.   #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \
  267.       && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD)))  // try to use AUX 2
  268.     #define CASE_LIGHT_PIN   44     // MUST BE HARDWARE PWM
  269.   #endif
  270. #endif
  271.  
  272. //
  273. // M3/M4/M5 - Spindle/Laser Control
  274. //
  275. #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE)
  276.   #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
  277.     #define SPINDLE_LASER_ENABLE_PIN  4  // Pin should have a pullup/pulldown!
  278.     #define SPINDLE_LASER_PWM_PIN     6  // MUST BE HARDWARE PWM
  279.     #define SPINDLE_DIR_PIN           5
  280.   #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \
  281.       && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD)))  // try to use AUX 2
  282.     #define SPINDLE_LASER_ENABLE_PIN 40  // Pin should have a pullup/pulldown!
  283.     #define SPINDLE_LASER_PWM_PIN    44  // MUST BE HARDWARE PWM
  284.     #define SPINDLE_DIR_PIN          65
  285.   #endif
  286. #endif
  287.  
  288. //
  289. // Průša i3 MK2 Multiplexer Support
  290. //
  291. #ifndef E_MUX0_PIN
  292.   #define E_MUX0_PIN 40   // Z_CS_PIN
  293. #endif
  294. #ifndef E_MUX1_PIN
  295.   #define E_MUX1_PIN 42   // E0_CS_PIN
  296. #endif
  297. #ifndef E_MUX2_PIN
  298.   #define E_MUX2_PIN 44   // E1_CS_PIN
  299. #endif
  300.  
  301. //////////////////////////
  302. // LCDs and Controllers //
  303. //////////////////////////
  304.  
  305. #if ENABLED(ULTRA_LCD)
  306.  
  307.   //
  308.   // LCD Display output pins
  309.   //
  310.   #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  311.  
  312.     #define LCD_PINS_RS         49 // CS chip select /SS chip slave select
  313.     #define LCD_PINS_ENABLE     51 // SID (MOSI)
  314.     #define LCD_PINS_D4         52 // SCK (CLK) clock
  315.  
  316.   #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
  317.  
  318.     #define LCD_PINS_RS         40
  319.     #define LCD_PINS_ENABLE     42
  320.     #define LCD_PINS_D4         65
  321.     #define LCD_PINS_D5         66
  322.     #define LCD_PINS_D6         44
  323.     #define LCD_PINS_D7         64
  324.  
  325.   #else
  326.  
  327.     #if ENABLED(CR10_STOCKDISPLAY)
  328.  
  329.       #define LCD_PINS_RS       27
  330.       #define LCD_PINS_ENABLE   29
  331.       #define LCD_PINS_D4       25
  332.  
  333.       #if DISABLED(NEWPANEL)
  334.         #define BEEPER_PIN      37
  335.       #endif
  336.  
  337.     #else
  338.  
  339.       #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
  340.         #define LCD_PINS_DC     25 // Set as output on init
  341.         #define LCD_PINS_RS     27 // Pull low for 1s to init
  342.         // DOGM SPI LCD Support
  343.         #define DOGLCD_CS       16
  344.         #define DOGLCD_MOSI     17
  345.         #define DOGLCD_SCK      23
  346.         #define DOGLCD_A0       LCD_PINS_DC
  347.       #else
  348.         #define LCD_PINS_RS     16
  349.         #define LCD_PINS_ENABLE 17
  350.         #define LCD_PINS_D4     23
  351.         #define LCD_PINS_D5     25
  352.         #define LCD_PINS_D6     27
  353.       #endif
  354.  
  355.       #define LCD_PINS_D7       29
  356.  
  357.       #if DISABLED(NEWPANEL)
  358.         #define BEEPER_PIN      33
  359.       #endif
  360.  
  361.     #endif
  362.  
  363.     #if DISABLED(NEWPANEL)
  364.       // Buttons are attached to a shift register
  365.       // Not wired yet
  366.       //#define SHIFT_CLK       38
  367.       //#define SHIFT_LD        42
  368.       //#define SHIFT_OUT       40
  369.       //#define SHIFT_EN        17
  370.     #endif
  371.  
  372.   #endif
  373.  
  374.   //
  375.   // LCD Display input pins
  376.   //
  377.   #if ENABLED(NEWPANEL)
  378.  
  379.     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  380.  
  381.       #define BEEPER_PIN        37
  382.  
  383.       #if ENABLED(CR10_STOCKDISPLAY)
  384.         #define BTN_EN1         17
  385.         #define BTN_EN2         23
  386.       #else
  387.         #define BTN_EN1         31
  388.         #define BTN_EN2         33
  389.       #endif
  390.  
  391.       #define BTN_ENC           35
  392.       #define SD_DETECT_PIN     49
  393.       #define KILL_PIN          41
  394.  
  395.       #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  396.         #define LCD_BACKLIGHT_PIN 39
  397.       #endif
  398.  
  399.     #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  400.  
  401.       #define BTN_EN1           64
  402.       #define BTN_EN2           59
  403.       #define BTN_ENC           63
  404.       #define SD_DETECT_PIN     42
  405.  
  406.     #elif ENABLED(LCD_I2C_PANELOLU2)
  407.  
  408.       #define BTN_EN1           47
  409.       #define BTN_EN2           43
  410.       #define BTN_ENC           32
  411.       #define LCD_SDSS          53
  412.       #define KILL_PIN          41
  413.  
  414.     #elif ENABLED(LCD_I2C_VIKI)
  415.  
  416.       #define BTN_EN1           22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
  417.       #define BTN_EN2            7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
  418.       #define BTN_ENC           -1
  419.  
  420.       #define LCD_SDSS          53
  421.       #define SD_DETECT_PIN     49
  422.  
  423.     #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
  424.  
  425.       #define DOGLCD_CS         45
  426.       #define DOGLCD_A0         44
  427.       #define LCD_SCREEN_ROT_180
  428.  
  429.       #define BEEPER_PIN        33
  430.       #define STAT_LED_RED_PIN  32
  431.       #define STAT_LED_BLUE_PIN 35
  432.  
  433.       #define BTN_EN1           22
  434.       #define BTN_EN2            7
  435.       #define BTN_ENC           39
  436.  
  437.       #define SDSS              53
  438.       #define SD_DETECT_PIN     -1 // Pin 49 for display sd interface, 72 for easy adapter board
  439.       #define KILL_PIN          31
  440.  
  441.     #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  442.  
  443.       #define DOGLCD_CS         29
  444.       #define DOGLCD_A0         27
  445.  
  446.       #define BEEPER_PIN        23
  447.       #define LCD_BACKLIGHT_PIN 33
  448.  
  449.       #define BTN_EN1           35
  450.       #define BTN_EN2           37
  451.       #define BTN_ENC           31
  452.  
  453.       #define LCD_SDSS          53
  454.       #define SD_DETECT_PIN     49
  455.       #define KILL_PIN          41
  456.  
  457.     #elif ENABLED(MKS_MINI_12864)  // Added in Marlin 1.1.6
  458.  
  459.       #define DOGLCD_A0         27
  460.       #define DOGLCD_CS         25
  461.  
  462.       // GLCD features
  463.       //#define LCD_CONTRAST   190
  464.       // Uncomment screen orientation
  465.       //#define LCD_SCREEN_ROT_90
  466.       //#define LCD_SCREEN_ROT_180
  467.       //#define LCD_SCREEN_ROT_270
  468.  
  469.       #define BEEPER_PIN        37
  470.       // not connected to a pin
  471.       #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  472.  
  473.       #define BTN_EN1           31
  474.       #define BTN_EN2           33
  475.       #define BTN_ENC           35
  476.  
  477.       #define SDSS              53
  478.       #define SD_DETECT_PIN     49
  479.       #define KILL_PIN          64
  480.  
  481.     #elif ENABLED(MINIPANEL)
  482.  
  483.       #define BEEPER_PIN        42
  484.       // not connected to a pin
  485.       #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  486.  
  487.       #define DOGLCD_A0         44
  488.       #define DOGLCD_CS         66
  489.  
  490.       // GLCD features
  491.       //#define LCD_CONTRAST   190
  492.       // Uncomment screen orientation
  493.       //#define LCD_SCREEN_ROT_90
  494.       //#define LCD_SCREEN_ROT_180
  495.       //#define LCD_SCREEN_ROT_270
  496.  
  497.       #define BTN_EN1           40
  498.       #define BTN_EN2           63
  499.       #define BTN_ENC           59
  500.  
  501.       #define SDSS              53
  502.       #define SD_DETECT_PIN     49
  503.       #define KILL_PIN          64
  504.  
  505.     #else
  506.  
  507.       // Beeper on AUX-4
  508.       #define BEEPER_PIN        33
  509.  
  510.       // Buttons are directly attached using AUX-2
  511.       #if ENABLED(REPRAPWORLD_KEYPAD)
  512.         #define SHIFT_OUT       40
  513.         #define SHIFT_CLK       44
  514.         #define SHIFT_LD        42
  515.         #define BTN_EN1         64
  516.         #define BTN_EN2         59
  517.         #define BTN_ENC         63
  518.       #elif ENABLED(PANEL_ONE)
  519.         #define BTN_EN1         59 // AUX2 PIN 3
  520.         #define BTN_EN2         63 // AUX2 PIN 4
  521.         #define BTN_ENC         49 // AUX3 PIN 7
  522.       #else
  523.         #define BTN_EN1         37
  524.         #define BTN_EN2         35
  525.         #define BTN_ENC         31
  526.       #endif
  527.  
  528.       #if ENABLED(G3D_PANEL)
  529.         #define SD_DETECT_PIN   49
  530.         #define KILL_PIN        41
  531.       #endif
  532.  
  533.     #endif
  534.   #endif // NEWPANEL
  535.  
  536. #endif // ULTRA_LCD
  537.  
  538. #if ENABLED(ZONESTAR_LCD)
  539.   #define LCD_PINS_RS        64
  540.   #define LCD_PINS_ENABLE    44
  541.   #define LCD_PINS_D4        63
  542.   #define LCD_PINS_D5        40
  543.   #define LCD_PINS_D6        42
  544.   #define LCD_PINS_D7        65
  545.   #define ADC_KEYPAD_PIN     12
  546.   #define BTN_EN1            -1
  547.   #define BTN_EN2            -1
  548.   #define BTN_ENC            -1
  549.   // pin 29 N/C
  550. #endif // ZONESTAR_LCD
Advertisement
Add Comment
Please, Sign In to add comment