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.

pins_MIGHTYBOARD_REVE.h 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. * Mightyboard Rev.E pin assignments
  24. * also works for Rev D boards. It's all rev E despite what the silk screen says
  25. */
  26. /**
  27. * Rev B 2 JAN 2017
  28. *
  29. * Added pin definitions for:
  30. * M3, M4 & M5 spindle control commands
  31. * case light
  32. *
  33. * Corrected pin assignment for EX2_HEAT_PIN pin. Changed it from 9 to 11. The port
  34. * number (B5) agrees with the schematic but B5 is assigned to logical pin 11.
  35. */
  36. #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
  37. #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'"
  38. #endif
  39. #define DEFAULT_MACHINE_NAME "MB Replicator"
  40. #define BOARD_NAME "Mightyboard"
  41. //
  42. // Servos
  43. //
  44. #define SERVO0_PIN 36 // C1 (1280-EX1)
  45. #define SERVO1_PIN 37 // C0 (1280-EX2)
  46. #define SERVO2_PIN 40 // G1 (1280-EX3)
  47. #define SERVO3_PIN 41 // G0 (1280-EX4)
  48. //
  49. // Limit Switches
  50. //
  51. #define X_MIN_PIN 49 // L0
  52. #define X_MAX_PIN 48 // L1
  53. #define Y_MIN_PIN 47 // L2
  54. #define Y_MAX_PIN 46 // L3
  55. #define Z_MIN_PIN 43 // L6
  56. #define Z_MAX_PIN 42 // L7
  57. //
  58. // Z Probe (when not Z_MIN_PIN)
  59. //
  60. #ifndef Z_MIN_PROBE_PIN
  61. #define Z_MIN_PROBE_PIN 42
  62. #endif
  63. //
  64. // Steppers
  65. //
  66. #define X_STEP_PIN 55 // F1
  67. #define X_DIR_PIN 54 // F0
  68. #define X_ENABLE_PIN 56 // F2
  69. #define Y_STEP_PIN 59 // F5
  70. #define Y_DIR_PIN 58 // F4
  71. #define Y_ENABLE_PIN 60 // F6
  72. #define Z_STEP_PIN 63 // K1
  73. #define Z_DIR_PIN 62 // K0
  74. #define Z_ENABLE_PIN 64 // K2
  75. #define E0_STEP_PIN 25 // A3
  76. #define E0_DIR_PIN 24 // A2
  77. #define E0_ENABLE_PIN 26 // A4
  78. #define E1_STEP_PIN 29 // A7
  79. #define E1_DIR_PIN 28 // A6
  80. #define E1_ENABLE_PIN 39 // G2
  81. //
  82. // I2C Digipots - MCP4018
  83. // Address 5E (2F << 1)
  84. // Set from 0 - 127 with stop bit.
  85. // (Ex. 3F << 1 | 1)
  86. //
  87. #define DIGIPOTS_I2C_SCL 76 // J5
  88. #define DIGIPOTS_I2C_SDA_X 57 // F3
  89. #define DIGIPOTS_I2C_SDA_Y 61 // F7
  90. #define DIGIPOTS_I2C_SDA_Z 65 // K3
  91. #define DIGIPOTS_I2C_SDA_E0 27 // A5
  92. #define DIGIPOTS_I2C_SDA_E1 77 // J6
  93. #define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1)
  94. //
  95. // Temperature Sensors
  96. //
  97. // K7 - 69 / ADC15 - 15
  98. #define TEMP_BED_PIN 15
  99. // SPI for Max6675 or Max31855 Thermocouple
  100. // Uses a separate SPI bus
  101. //
  102. // 3 E5 DO (SO)
  103. // 5 E3 CS1
  104. // 2 E4 CS2
  105. // 78 E2 SCK
  106. //
  107. #define THERMO_SCK_PIN 78 // E2
  108. #define THERMO_DO_PIN 3 // E5
  109. #define THERMO_CS1_PIN 5 // E3
  110. #define THERMO_CS2_PIN 2 // E4
  111. #define MAX6675_SS_PIN THERMO_CS1_PIN
  112. #define MAX6675_SS2_PIN THERMO_CS2_PIN
  113. #define MAX6675_SCK_PIN THERMO_SCK_PIN
  114. #define MAX6675_DO_PIN THERMO_DO_PIN
  115. //
  116. // Augmentation for auto-assigning plugs
  117. //
  118. // Two thermocouple connectors allows for either
  119. // 2 extruders or 1 extruder and a heated bed.
  120. // With no heated bed, an additional 24V fan is possible.
  121. //
  122. // Labels from the schematic:
  123. #define EX1_HEAT_PIN 6 // H3
  124. #define EX1_FAN_PIN 7 // H4
  125. #define EX2_HEAT_PIN 11 // B5
  126. #define EX2_FAN_PIN 12 // B6
  127. #define HBP_PIN 45 // L4
  128. #define EXTRA_FET_PIN 44 // L5
  129. #if HOTENDS > 1
  130. #if TEMP_SENSOR_BED
  131. #define IS_EEB
  132. #else
  133. #define IS_EEF
  134. #endif
  135. #elif TEMP_SENSOR_BED
  136. #define IS_EFB
  137. #else
  138. #define IS_EFF
  139. #endif
  140. //
  141. // Heaters / Fans (24V)
  142. //
  143. #define HEATER_0_PIN EX1_HEAT_PIN
  144. #if ENABLED(IS_EFB) // Hotend, Fan, Bed
  145. #define HEATER_BED_PIN HBP_PIN
  146. #elif ENABLED(IS_EEF) // Hotend, Hotend, Fan
  147. #define HEATER_1_PIN EX2_HEAT_PIN
  148. #elif ENABLED(IS_EEB) // Hotend, Hotend, Bed
  149. #define HEATER_1_PIN EX2_HEAT_PIN
  150. #define HEATER_BED_PIN HBP_PIN
  151. #elif ENABLED(IS_EFF) // Hotend, Fan, Fan
  152. #define FAN1_PIN HBP_PIN
  153. #endif
  154. #ifndef FAN_PIN
  155. #if ENABLED(IS_EFB) || ENABLED(IS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
  156. #define FAN_PIN EX2_HEAT_PIN
  157. #elif ENABLED(IS_EEF) || ENABLED(IS_SF) // Hotend, Hotend, Fan or Spindle, Fan
  158. #define FAN_PIN HBP_PIN
  159. #else
  160. #define FAN_PIN EXTRA_FET_PIN
  161. #endif
  162. #endif
  163. //
  164. // Extruder Auto Fan Pins
  165. //
  166. #define ORIG_E0_AUTO_FAN_PIN EX1_FAN_PIN
  167. #define ORIG_E1_AUTO_FAN_PIN EX2_FAN_PIN
  168. //
  169. // Misc. Functions
  170. //
  171. #define LED_PIN 13 // B7
  172. #define CUTOFF_RESET_PIN 16 // H1
  173. #define CUTOFF_TEST_PIN 17 // H0
  174. #define CASE_LIGHT_PIN 44 // L5 MUST BE HARDWARE PWM
  175. //
  176. // LCD / Controller
  177. //
  178. #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  179. #define LCD_PINS_RS 33 // C4: LCD-STROBE
  180. #define LCD_PINS_ENABLE 72 // J2: LEFT
  181. #define LCD_PINS_D4 35 // C2: LCD-CLK
  182. #define LCD_PINS_D5 32 // C5: RLED
  183. #define LCD_PINS_D6 34 // C3: LCD-DATA
  184. #define LCD_PINS_D7 31 // C6: GLED
  185. #define BTN_EN2 75 // J4, UP
  186. #define BTN_EN1 73 // J3, DOWN
  187. //STOP button connected as KILL_PIN
  188. #define KILL_PIN 14 // J1, RIGHT
  189. //KILL - not connected
  190. #define BEEPER_PIN 8 // H5, SD_WP
  191. #define BTN_CENTER 15 // J0
  192. #define BTN_ENC BTN_CENTER
  193. //on board leds
  194. #define STAT_LED_RED_LED SERVO0_PIN // C1 (1280-EX1, DEBUG2)
  195. #define STAT_LED_BLUE_PIN SERVO1_PIN // C0 (1280-EX2, DEBUG3)
  196. #else
  197. // Replicator uses a 3-wire SR controller with HD44780
  198. // For now, pretend it's the SAV
  199. //
  200. //#define FF_INTERFACEBOARD
  201. #define SR_DATA_PIN 34 // C3
  202. #define SR_CLK_PIN 35 // C2
  203. #define SR_STROBE_PIN 33 // C4
  204. #define BTN_UP 75 // J4
  205. #define BTN_DWN 73 // J3
  206. #define BTN_LFT 72 // J2
  207. #define BTN_RT 14 // J1
  208. #define BTN_CENTER 15 // J0
  209. #define BTN_ENC BTN_CENTER
  210. // Disable encoder
  211. #undef BTN_EN1
  212. #undef BTN_EN2
  213. #define BEEPER_PIN 4 // G5
  214. #define STAT_LED_RED_PIN 32 // C5
  215. #define STAT_LED_BLUE_PIN 31 // C6 (Actually green)
  216. #endif
  217. //
  218. // SD Card
  219. //
  220. #define SDSS 53 // B0
  221. #define SD_DETECT_PIN 9 // H6
  222. #define MAX_PIN THERMO_SCK_PIN
  223. //
  224. // M3/M4/M5 - Spindle/Laser Control
  225. //
  226. #define SPINDLE_LASER_ENABLE_PIN 66 // K4 Pin should have a pullup!
  227. #define SPINDLE_LASER_PWM_PIN 8 // H5 MUST BE HARDWARE PWM
  228. #define SPINDLE_DIR_PIN 67 // K5
  229. // Check if all pins are defined in mega/pins_arduino.h
  230. #include <Arduino.h>
  231. static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h"
  232. "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below");
  233. /* in [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h
  234. change:
  235. #define NUM_DIGITAL_PINS 70
  236. to:
  237. #define NUM_DIGITAL_PINS 80
  238. to digital_pin_to_port_PGM add at the end:
  239. const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
  240. ....
  241. PG , // PG 4 ** 70 **
  242. PG , // PG 3 ** 71 **
  243. PJ , // PJ 2 ** 72 **
  244. PJ , // PJ 3 ** 73 **
  245. PJ , // PJ 7 ** 74 **
  246. PJ , // PJ 4 ** 75 **
  247. PJ , // PJ 5 ** 76 **
  248. PJ , // PJ 6 ** 77 **
  249. PE , // PE 2 ** 78 **
  250. PE , // PE 6 ** 79 **
  251. };
  252. to digital_pin_to_bit_mask_PGM add at the end:
  253. const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
  254. ....
  255. _BV( 4 ) , // PG 4 ** 70 **
  256. _BV( 3 ) , // PG 3 ** 71 **
  257. _BV( 2 ) , // PJ 2 ** 72 **
  258. _BV( 3 ) , // PJ 3 ** 73 **
  259. _BV( 7 ) , // PJ 7 ** 74 **
  260. _BV( 4 ) , // PJ 4 ** 75 **
  261. _BV( 5 ) , // PJ 5 ** 76 **
  262. _BV( 6 ) , // PJ 6 ** 77 **
  263. _BV( 2 ) , // PE 2 ** 78 **
  264. _BV( 6 ) , // PE 6 ** 79 **
  265. };
  266. to digital_pin_to_timer_PGM add at the end:
  267. const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
  268. ....
  269. NOT_ON_TIMER , // PG 4 ** 70 **
  270. NOT_ON_TIMER , // PG 3 ** 71 **
  271. NOT_ON_TIMER , // PJ 2 ** 72 **
  272. NOT_ON_TIMER , // PJ 3 ** 73 **
  273. NOT_ON_TIMER , // PJ 7 ** 74 **
  274. NOT_ON_TIMER , // PJ 4 ** 75 **
  275. NOT_ON_TIMER , // PJ 5 ** 76 **
  276. NOT_ON_TIMER , // PJ 6 ** 77 **
  277. NOT_ON_TIMER , // PE 2 ** 78 **
  278. NOT_ON_TIMER , // PE 6 ** 79 **
  279. };
  280. */