My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * Arduino DUE Shield Kit (ADSK) pin assignments
  25. */
  26. #define BOARD_NAME "ADSK"
  27. #if !defined(__SAM3X8E__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
  28. #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
  29. #endif
  30. /* CNC shield modifications:
  31. FROM THE BOTTOM CUT THE 5V PIN THAT GOES TO ARDUINO!!!
  32. On the top put jumper between 5V and 3V3 pins,
  33. jumper between D12 and A.STEP, jumper between D13 and A.DIR
  34. */
  35. /* CNC shield 3D printer connections:
  36. X,Y,Z steppers as normal
  37. A stepper for E0 extruder
  38. (X-)&(GND) - X limit
  39. (Y-)&(GND) - Y limit
  40. (Z-)&(GND) - Z limit
  41. (Abort)&(GND) - Extruder thermistor (also require pullup resistor 4.7K between "Abort" and
  42. Vcc (now "5V" on the board but actual 3.3V because of jumper))
  43. (Hold)&(GND) - Bed thermistor (also require pullup resistor 4.7K between "Hold" and
  44. Vcc (now "5V" on the board but actual 3.3V because of jumper))
  45. (CoolEn) - 3.3v signal to controll extruder heater MOSFET
  46. (Resume) - 3.3v signal to control heatbed MOSFET
  47. (SDA) - 3.3v signal to controll extruder fan
  48. (SCL) - 3.3v signal to controll extruder cooling fan
  49. */
  50. /* CNC Shield pinout
  51. "Name on the board": DUE pin
  52. "Abort": Analog pin 0 or Digital pin 54
  53. "Hold": Analog pin 1 or Digital pin 55
  54. "Resume": Analog pin 2 or Digital pin 56
  55. "CoolEn": Analog pin 3 or Digital pin 57
  56. "SDA": Analog pin 4 or Digital pin 58
  57. "SCL": Analog pin 5 or Digital pin 59
  58. "E-STOP": Reset pin
  59. "RX": Digital pin 0
  60. "TX": Digital pin 1
  61. "X.STEP": Digital pin 2
  62. "Y.STEP": Digital pin 3
  63. "Z.STEP": Digital pin 4
  64. "X.DIR": Digital pin 5
  65. "Y.DIR": Digital pin 6
  66. "Z.DIR": Digital pin 7
  67. "EN": Digital pin 8
  68. "X+","X-": Digital pin 9
  69. "Y+","Y-": Digital pin 10
  70. "Z+","Z-": Digital pin 11
  71. "SpinEn": Digital pin 12 -> will be connected to A.STEP with jumper
  72. "SpinDir": Digital pin 13 -> will be connected to A.DIR with jumper
  73. */
  74. //
  75. // Servos
  76. //
  77. #define SERVO0_PIN 61 // Analog pin 7, Digital pin 61
  78. //
  79. // Limit Switches
  80. //
  81. #define X_MIN_PIN 9
  82. #define Y_MIN_PIN 10
  83. #define Z_MIN_PIN 11
  84. #define Z_MIN_PROBE_PIN 62 // Analog pin 8, Digital pin 62
  85. //
  86. // Steppers
  87. //
  88. #define X_STEP_PIN 2
  89. #define X_DIR_PIN 5
  90. #define X_ENABLE_PIN 8
  91. #define Y_STEP_PIN 3
  92. #define Y_DIR_PIN 6
  93. #define Y_ENABLE_PIN 8
  94. #define Z_STEP_PIN 4
  95. #define Z_DIR_PIN 7
  96. #define Z_ENABLE_PIN 8
  97. #define E0_STEP_PIN 12
  98. #define E0_DIR_PIN 13
  99. #define E0_ENABLE_PIN 8
  100. //
  101. // Heaters / Fans
  102. //
  103. #define HEATER_0_PIN 55 // "Hold": Analog pin 1, Digital pin 55
  104. #define HEATER_BED_PIN 57 // "CoolEn": Analog pin 3, Digital pin 57
  105. #define FAN_PIN 54 // "Abort": Analog pin 0, Digital pin 54
  106. #undef E0_AUTO_FAN_PIN
  107. #define E0_AUTO_FAN_PIN 56 // "Resume": Analog pin 2, Digital pin 56
  108. //
  109. // Temperature Sensors
  110. //
  111. #define TEMP_0_PIN 4 // "SDA": Analog pin 4, Digital pin 58
  112. #define TEMP_BED_PIN 5 // "SCL": Analog pin 5, Digital pin 59
  113. //
  114. // Misc. Functions
  115. //
  116. #define SDSS 52
  117. #if ENABLED(ZONESTAR_LCD)
  118. /**
  119. * The 2004 LCD should be powered with 5V.
  120. * The next LCD pins RS,D4,D5,D6,D7 have internal pull-ups to 5V and as result the 5V will be on these pins.
  121. * Luckily these internal pull-ups have really high resistance and adding 33K pull-down resistors will create
  122. * simple voltage divider that will bring the voltage down just slightly bellow 3.3V.
  123. *
  124. * This LCD also has buttons that connected to the same ADC pin with different voltage divider combinations.
  125. * On the LCD panel there is internal pull-up resistor of the 4.7K connected to 5V.
  126. * Connecting another 4.7K pull-down resistor between ADC pin and the GND
  127. * will result in scaled values for voltage dividers and will bring them down to be always below 3.3V.
  128. *
  129. * For 2004 LCD to work with 3.3V board like Arduino DUE the next required:
  130. * Pull-down resistors of 33K between each of LCD pins RS,D4,D5,D6,D7 and the GND.
  131. * Pull-down resistor of 4.7K between ADC_KEYPAD_PIN and the GND
  132. *
  133. * All these modifications will still work with 5V based boards but require proper scaled ADC values
  134. */
  135. #ifdef __SAM3X8E__
  136. #define AREF_VOLTS 3.3
  137. #else
  138. #define AREF_VOLTS 5.0
  139. #endif
  140. //
  141. // LCD / Controller
  142. //
  143. #define LCD_PINS_ENABLE 14
  144. #define LCD_PINS_RS 15
  145. #define LCD_PINS_D4 16
  146. #define LCD_PINS_D5 17
  147. #define LCD_PINS_D6 18
  148. #define LCD_PINS_D7 19
  149. #define ADC_KEYPAD_PIN 6 //60 // Analog pin 6, Digital pin 60
  150. /**
  151. * The below defines will scale all the values to work properly on both
  152. * 5V (Mega) and 3.3V (DUE) boards with all pull-up resistors added for 3.3V
  153. */
  154. #define ADC_BUTTONS_VALUE_SCALE (5.0/AREF_VOLTS) // The LCD module pullup voltage is 5.0V but ADC reference voltage is 3.3V
  155. #define ADC_BUTTONS_R_PULLDOWN 4.7 // Moves voltage down to be bellow 3.3V instead of 5V
  156. // the resistors values will be scaled because of 4.7K pulldown parallel resistor
  157. #define _ADC_BUTTONS_R_SCALED(R) ((R) * (ADC_BUTTONS_R_PULLDOWN) / ((R) + ADC_BUTTONS_R_PULLDOWN))
  158. // buttons pullup resistor
  159. #define ADC_BUTTONS_R_PULLUP 4.7 // the resistor on the 2004 LCD panel
  160. // buttons resistors with scaled values because of parallel pulldown resistor
  161. #define ADC_BUTTONS_LEFT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(0.47)
  162. #define ADC_BUTTONS_RIGHT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(4.7)
  163. #define ADC_BUTTONS_UP_R_PULLDOWN _ADC_BUTTONS_R_SCALED(1.0)
  164. #define ADC_BUTTONS_DOWN_R_PULLDOWN _ADC_BUTTONS_R_SCALED(10.0)
  165. #define ADC_BUTTONS_MIDDLE_R_PULLDOWN _ADC_BUTTONS_R_SCALED(2.2)
  166. #endif // ZONESTAR_LCD
  167. /**
  168. * RJ45 8 pins extruder connector
  169. *
  170. * 1 - GND (Please do not connect to the same GND as extruder heater to prevent ground offset voltage)
  171. * 2 - thermistor
  172. * 3 - SERVO PWM
  173. * 4 - extruder heater
  174. * 5 - FAN (print cooling)
  175. * 6 - FAN (extruder cooling)
  176. * 7 - Probe signal
  177. * 8 - 5V
  178. *
  179. * Standard ethernet pairs: 1&2, 3&6, 4&5, 7&8
  180. * Use CAT7 cable to have all pairs shielded
  181. *
  182. */