pins.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. #ifndef PINS_H
  2. #define PINS_H
  3. #include "boards.h"
  4. #if !MB(5DPRINT)
  5. #define X_MS1_PIN -1
  6. #define X_MS2_PIN -1
  7. #define Y_MS1_PIN -1
  8. #define Y_MS2_PIN -1
  9. #define Z_MS1_PIN -1
  10. #define Z_MS2_PIN -1
  11. #define E0_MS1_PIN -1
  12. #define E0_MS2_PIN -1
  13. #define E1_MS1_PIN -1
  14. #define E1_MS2_PIN -1
  15. #define DIGIPOTSS_PIN -1
  16. #endif
  17. #define LARGE_FLASH true
  18. /*****************************************************************
  19. * Rambo Pin Assignments 1.3
  20. ******************************************************************/
  21. #if MOTHERBOARD == 302
  22. #define MINI_RAMBO
  23. #endif
  24. #if MOTHERBOARD == 301 || MOTHERBOARD == 302
  25. #define KNOWN_BOARD
  26. #ifndef __AVR_ATmega2560__
  27. #error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
  28. #endif
  29. #define FR_SENS 21
  30. #define X_STEP_PIN 37
  31. #define X_DIR_PIN 48
  32. #define X_MIN_PIN 12
  33. #define X_MAX_PIN 30
  34. #define X_ENABLE_PIN 29
  35. #define X_MS1_PIN 40
  36. #define X_MS2_PIN 41
  37. #define Y_STEP_PIN 36
  38. #define Y_DIR_PIN 49
  39. #define Y_MIN_PIN 11
  40. #define Y_MAX_PIN 24
  41. #define Y_ENABLE_PIN 28
  42. #define Y_MS1_PIN 69
  43. #define Y_MS2_PIN 39
  44. #define Z_STEP_PIN 35
  45. #define Z_DIR_PIN 47
  46. #define Z_MIN_PIN 10
  47. #define Z_MAX_PIN 23
  48. #define Z_ENABLE_PIN 27
  49. #define Z_MS1_PIN 68
  50. #define Z_MS2_PIN 67
  51. #define TEMP_BED_PIN 2
  52. #define TEMP_0_PIN 0
  53. #define HEATER_1_PIN 7
  54. #define TEMP_1_PIN 1
  55. #define TEMP_2_PIN -1
  56. #ifdef SNMM
  57. #define E_MUX0_PIN 17
  58. #define E_MUX1_PIN 16
  59. #define E_MUX2_PIN 84
  60. #endif
  61. #ifdef DIS
  62. #define D_REQUIRE 30
  63. #define D_DATA 20
  64. #define D_DATACLOCK 21
  65. #endif
  66. // The SDSS pin uses a different pin mapping from file Sd2PinMap.h
  67. #define SDSS 53
  68. #ifndef SDSUPPORT
  69. // these pins are defined in the SD library if building with SD support
  70. #define SCK_PIN 52
  71. #define MISO_PIN 50
  72. #define MOSI_PIN 51
  73. #endif
  74. #define BEEPER 84
  75. #define BTN_EN1 72
  76. #define BTN_EN2 14
  77. #define BTN_ENC 9
  78. #define SDCARDDETECT 15
  79. #define LCD_PINS_RS 82
  80. #define LCD_PINS_ENABLE 18
  81. #define LCD_PINS_D4 19
  82. #define LCD_PINS_D5 70
  83. #define LCD_PINS_D6 85
  84. #define LCD_PINS_D7 71
  85. #define E0_STEP_PIN 34
  86. #define E0_DIR_PIN 43
  87. #define E0_ENABLE_PIN 26
  88. #define E0_MS1_PIN 65
  89. #define E0_MS2_PIN 66
  90. #define LED_PIN 13
  91. #ifdef THREEMM_PRINTER
  92. #define FAN_PIN 8
  93. #else
  94. #define FAN_PIN 6
  95. #endif
  96. #define KILL_PIN -1 //80 with Smart Controller LCD
  97. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
  98. #define SDPOWER -1
  99. #define HEATER_2_PIN -1
  100. #ifdef MINI_RAMBO
  101. #define ELECTRONICS "RAMBo13a"
  102. #define HEATER_0_PIN 3
  103. #define HEATER_BED_PIN 4
  104. #define FAN_1_PIN -1 //6
  105. #define PS_ON_PIN 71
  106. #define MOTOR_CURRENT_PWM_XY_PIN 46
  107. #define MOTOR_CURRENT_PWM_Z_PIN 45
  108. #define MOTOR_CURRENT_PWM_E_PIN 44
  109. #else //RAMBo
  110. #define ELECTRONICS "RAMBoBig"
  111. #define E1_STEP_PIN 33
  112. #define E1_DIR_PIN 42
  113. #define E1_ENABLE_PIN 25
  114. #define E1_MS1_PIN 63
  115. #define E1_MS2_PIN 64
  116. #define DIGIPOTSS_PIN 38
  117. #define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping
  118. #define HEATER_0_PIN 9
  119. #define HEATER_BED_PIN 3
  120. #define PS_ON_PIN 4
  121. #define SDSS 53
  122. #ifdef ULTRA_LCD
  123. #define KILL_PIN 80
  124. #ifdef NEWPANEL
  125. //arduino pin which triggers an piezzo beeper
  126. #define BEEPER 84 // Beeper on AUX-4
  127. #define LCD_PINS_RS 82
  128. #define LCD_PINS_ENABLE 18
  129. #define LCD_PINS_D4 19
  130. #define LCD_PINS_D5 70
  131. #define LCD_PINS_D6 85
  132. #define LCD_PINS_D7 71
  133. //buttons are directly attached using AUX-2
  134. #define BTN_EN1 76
  135. #define BTN_EN2 77
  136. #define BTN_ENC 78 //the click
  137. #define BLEN_C 2
  138. #define BLEN_B 1
  139. #define BLEN_A 0
  140. #define SDCARDDETECT 81 // Ramps does not use this port
  141. //encoder rotation values
  142. #define encrot0 0
  143. #define encrot1 2
  144. #define encrot2 3
  145. #define encrot3 1
  146. #else //old style panel with shift register
  147. //arduino pin witch triggers an piezzo beeper
  148. #define BEEPER 84 //No Beeper added
  149. //buttons are attached to a shift register
  150. // Not wired this yet
  151. // #define SHIFT_CLK 38
  152. // #define SHIFT_LD 42
  153. // #define SHIFT_OUT 40
  154. // #define SHIFT_EN 17
  155. #define LCD_PINS_RS 82
  156. #define LCD_PINS_ENABLE 18
  157. #define LCD_PINS_D4 19
  158. #define LCD_PINS_D5 70
  159. #define LCD_PINS_D6 85
  160. #define LCD_PINS_D7 71
  161. //encoder rotation values
  162. #define encrot0 0
  163. #define encrot1 2
  164. #define encrot2 3
  165. #define encrot3 1
  166. //bits in the shift register that carry the buttons for:
  167. // left up center down right red
  168. #define BL_LE 7
  169. #define BL_UP 6
  170. #define BL_MI 5
  171. #define BL_DW 4
  172. #define BL_RI 3
  173. #define BL_ST 2
  174. #define BLEN_B 1
  175. #define BLEN_A 0
  176. #endif
  177. #endif //ULTRA_LCD
  178. #endif //RAMBo/MiniRambo option
  179. #endif
  180. /*****************************************************************
  181. * Rambo mini Pin Assignments 1.0
  182. ******************************************************************/
  183. #if MOTHERBOARD == 102
  184. #define ELECTRONICS "RAMBo10a"
  185. #define KNOWN_BOARD
  186. #ifndef __AVR_ATmega2560__
  187. #error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
  188. #endif
  189. #define FR_SENS 21
  190. #ifdef SNMM
  191. #define E_MUX0_PIN 17
  192. #define E_MUX1_PIN 16
  193. #define E_MUX2_PIN 84
  194. #endif
  195. #define LARGE_FLASH true
  196. #define X_STEP_PIN 37
  197. #define X_DIR_PIN 48
  198. #define X_MIN_PIN 12
  199. #define X_MAX_PIN 30
  200. #define X_ENABLE_PIN 29
  201. #define X_MS1_PIN 40
  202. #define X_MS2_PIN 41
  203. #define Y_STEP_PIN 36
  204. #define Y_DIR_PIN 49
  205. #define Y_MIN_PIN 11
  206. #define Y_MAX_PIN 24
  207. #define Y_ENABLE_PIN 28
  208. #define Y_MS1_PIN 69
  209. #define Y_MS2_PIN 39
  210. #define Z_STEP_PIN 35
  211. #define Z_DIR_PIN 47
  212. #define Z_MIN_PIN 10
  213. #define Z_MAX_PIN 23
  214. #define Z_ENABLE_PIN 27
  215. #define Z_MS1_PIN 68
  216. #define Z_MS2_PIN 67
  217. #define TEMP_BED_PIN 2
  218. #define TEMP_0_PIN 0
  219. #define HEATER_1_PIN 7
  220. #define TEMP_1_PIN 1
  221. #define TEMP_2_PIN -1
  222. // The SDSS pin uses a different pin mapping from file Sd2PinMap.h
  223. #define SDSS 53
  224. #ifndef SDSUPPORT
  225. // these pins are defined in the SD library if building with SD support
  226. #define SCK_PIN 52
  227. #define MISO_PIN 50
  228. #define MOSI_PIN 51
  229. #endif
  230. #define BEEPER 78
  231. #define BTN_EN1 80
  232. #define BTN_EN2 73
  233. #define BTN_ENC 21
  234. #define SDCARDDETECT 72
  235. #define LCD_PINS_RS 38
  236. #define LCD_PINS_ENABLE 5
  237. #define LCD_PINS_D4 14
  238. #define LCD_PINS_D5 15
  239. #define LCD_PINS_D6 32
  240. #define LCD_PINS_D7 31
  241. #define E0_STEP_PIN 34
  242. #define E0_DIR_PIN 43
  243. #define E0_ENABLE_PIN 26
  244. #define E0_MS1_PIN 65
  245. #define E0_MS2_PIN 66
  246. #define LED_PIN 13
  247. #ifdef THREEMM_PRINTER
  248. #define FAN_PIN 8
  249. #else
  250. #define FAN_PIN 6
  251. #endif
  252. #define KILL_PIN -1 //80 with Smart Controller LCD
  253. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
  254. #define SDPOWER -1
  255. #define HEATER_2_PIN -1
  256. #define HEATER_0_PIN 3
  257. #define HEATER_BED_PIN 4
  258. #define FAN_1_PIN -1 //6
  259. #define PS_ON_PIN 71
  260. #define MOTOR_CURRENT_PWM_XY_PIN 46
  261. #define MOTOR_CURRENT_PWM_Z_PIN 45
  262. #define MOTOR_CURRENT_PWM_E_PIN 44
  263. #endif
  264. /*****************************************************************
  265. * EINY Rambo Pin Assignments 0.3a
  266. ******************************************************************/
  267. #if MOTHERBOARD == 300
  268. #define ELECTRONICS "EINY_03a"
  269. #define KNOWN_BOARD
  270. #ifndef __AVR_ATmega2560__
  271. #error Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu.
  272. #endif
  273. #define LARGE_FLASH true
  274. #define HAVE_TMC2130_DRIVERS
  275. #define HAVE_PAT9125_SENSOR
  276. #define X_STEP_PIN 37
  277. #define X_DIR_PIN 49
  278. #define X_MIN_PIN 12
  279. #define X_MAX_PIN 30
  280. //#define X_MIN_PIN 64 //TMC2130 SG homing
  281. //#define X_MAX_PIN 64 //TMC2130 SG homing
  282. #define X_ENABLE_PIN 29
  283. #define X_MS1_PIN -1
  284. #define X_MS2_PIN -1
  285. #define X_TMC2130_CS 41
  286. #define Y_STEP_PIN 36
  287. #define Y_DIR_PIN 48
  288. #define Y_MIN_PIN 11
  289. #define Y_MAX_PIN 24
  290. //#define Y_MIN_PIN 69 //TMC2130 SG homing
  291. //#define Y_MAX_PIN 69 //TMC2130 SG homing
  292. #define Y_ENABLE_PIN 28
  293. #define Y_MS1_PIN -1
  294. #define Y_MS2_PIN -1
  295. #define Y_TMC2130_CS 39
  296. #define Z_STEP_PIN 35
  297. #define Z_DIR_PIN 47
  298. #define Z_MIN_PIN 10
  299. #define Z_MAX_PIN 23
  300. #define Z_ENABLE_PIN 27
  301. #define Z_MS1_PIN -1
  302. #define Z_MS2_PIN -1
  303. #define Z_TMC2130_CS 67
  304. #define HEATER_BED_PIN 4
  305. #define TEMP_BED_PIN 2
  306. #define HEATER_0_PIN 3
  307. #define TEMP_0_PIN 0
  308. #define HEATER_1_PIN 7
  309. #define TEMP_1_PIN 1
  310. #ifdef BARICUDA
  311. #define HEATER_2_PIN 6
  312. #else
  313. #define HEATER_2_PIN -1
  314. #endif
  315. #define TEMP_2_PIN -1
  316. #define E0_STEP_PIN 34
  317. #define E0_DIR_PIN 43
  318. #define E0_ENABLE_PIN 26
  319. #define E0_MS1_PIN -1
  320. #define E0_MS2_PIN -1
  321. #define E0_TMC2130_CS 66
  322. #define MOTOR_CURRENT_PWM_XY_PIN 46
  323. #define MOTOR_CURRENT_PWM_Z_PIN 45
  324. #define MOTOR_CURRENT_PWM_E_PIN 44
  325. #define SDPOWER -1
  326. #define SDSS 53
  327. #define LED_PIN 13
  328. #define FAN_PIN 6
  329. #define FAN_1_PIN -1
  330. #define PS_ON_PIN -1
  331. #define KILL_PIN -1 // 80 with Smart Controller LCD
  332. #define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
  333. #ifdef ULTRA_LCD
  334. #define KILL_PIN 32
  335. #ifdef NEWPANEL
  336. #define BEEPER 84 // Beeper on AUX-4
  337. #define LCD_PINS_RS 82
  338. #define LCD_PINS_ENABLE 18
  339. #define LCD_PINS_D4 19
  340. #define LCD_PINS_D5 70
  341. #define LCD_PINS_D6 85
  342. #define LCD_PINS_D7 71
  343. //buttons are directly attached using AUX-2
  344. #define BTN_EN1 72
  345. #define BTN_EN2 14
  346. #define BTN_ENC 9 // the click
  347. #define SDCARDDETECT 15
  348. #define TACH_0 81
  349. #define TACH_1 80
  350. #endif //NEWPANEL
  351. #endif //ULTRA_LCD
  352. #endif //MOTHERBOARD == 300
  353. /*****************************************************************
  354. * EINY Rambo Pin Assignments 0.4a
  355. ******************************************************************/
  356. #if MOTHERBOARD == 299
  357. #define ELECTRONICS "EINY_04a"
  358. #define KNOWN_BOARD
  359. #ifndef __AVR_ATmega2560__
  360. #error Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu.
  361. #endif
  362. #define LARGE_FLASH true
  363. #define HAVE_TMC2130_DRIVERS
  364. #define HAVE_PAT9125_SENSOR
  365. #define X_STEP_PIN 37
  366. #define X_DIR_PIN 49
  367. #define X_MIN_PIN 12
  368. #define X_MAX_PIN 30
  369. //#define X_MIN_PIN 64 //TMC2130 SG homing
  370. //#define X_MAX_PIN 64 //TMC2130 SG homing
  371. #define X_ENABLE_PIN 29
  372. #define X_MS1_PIN -1
  373. #define X_MS2_PIN -1
  374. #define X_TMC2130_CS 41
  375. #define Y_STEP_PIN 36
  376. #define Y_DIR_PIN 48
  377. #define Y_MIN_PIN 11
  378. #define Y_MAX_PIN 24
  379. //#define Y_MIN_PIN 69 //TMC2130 SG homing
  380. //#define Y_MAX_PIN 69 //TMC2130 SG homing
  381. #define Y_ENABLE_PIN 28
  382. #define Y_MS1_PIN -1
  383. #define Y_MS2_PIN -1
  384. #define Y_TMC2130_CS 39
  385. #define Z_STEP_PIN 35
  386. #define Z_DIR_PIN 47
  387. #define Z_MIN_PIN 10
  388. #define Z_MAX_PIN 23
  389. #define Z_ENABLE_PIN 27
  390. #define Z_MS1_PIN -1
  391. #define Z_MS2_PIN -1
  392. #define Z_TMC2130_CS 67
  393. #define HEATER_BED_PIN 4
  394. #define TEMP_BED_PIN 2
  395. #define HEATER_0_PIN 3
  396. #define TEMP_0_PIN 0
  397. #define HEATER_1_PIN 7
  398. #define TEMP_1_PIN 1
  399. #ifdef BARICUDA
  400. #define HEATER_2_PIN 6
  401. #else
  402. #define HEATER_2_PIN -1
  403. #endif
  404. #define TEMP_2_PIN -1
  405. #define E0_STEP_PIN 34
  406. #define E0_DIR_PIN 43
  407. #define E0_ENABLE_PIN 26
  408. #define E0_MS1_PIN -1
  409. #define E0_MS2_PIN -1
  410. #define E0_TMC2130_CS 66
  411. #define MOTOR_CURRENT_PWM_XY_PIN 46
  412. #define MOTOR_CURRENT_PWM_Z_PIN 45
  413. #define MOTOR_CURRENT_PWM_E_PIN 44
  414. #define SDPOWER -1
  415. #define SDSS 77
  416. #define LED_PIN 13
  417. #define FAN_PIN 6
  418. #define FAN_1_PIN -1
  419. #define PS_ON_PIN -1
  420. #define KILL_PIN -1 // 80 with Smart Controller LCD
  421. #define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
  422. #ifdef ULTRA_LCD
  423. //#define KILL_PIN 32
  424. #ifdef NEWPANEL
  425. #define BEEPER 84 // Beeper on AUX-4
  426. #define LCD_PINS_RS 82
  427. //#define LCD_PINS_ENABLE 18
  428. //#define LCD_PINS_D4 19
  429. #define LCD_PINS_ENABLE 61
  430. #define LCD_PINS_D4 59
  431. #define LCD_PINS_D5 70
  432. #define LCD_PINS_D6 85
  433. #define LCD_PINS_D7 71
  434. //buttons are directly attached using AUX-2
  435. #define BTN_EN1 72
  436. #define BTN_EN2 14
  437. #define BTN_ENC 9 // the click
  438. #define SDCARDDETECT 15
  439. #define TACH_0 79
  440. #define TACH_1 80
  441. #endif //NEWPANEL
  442. #endif //ULTRA_LCD
  443. #endif //MOTHERBOARD == 300
  444. #ifndef KNOWN_BOARD
  445. #error Unknown MOTHERBOARD value in configuration.h
  446. #endif
  447. //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  448. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
  449. #if EXTRUDERS > 1
  450. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
  451. #else
  452. #define _E1_PINS
  453. #endif
  454. #if EXTRUDERS > 2
  455. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
  456. #else
  457. #define _E2_PINS
  458. #endif
  459. #ifdef X_STOP_PIN
  460. #if X_HOME_DIR < 0
  461. #define X_MIN_PIN X_STOP_PIN
  462. #define X_MAX_PIN -1
  463. #else
  464. #define X_MIN_PIN -1
  465. #define X_MAX_PIN X_STOP_PIN
  466. #endif
  467. #endif
  468. #ifdef Y_STOP_PIN
  469. #if Y_HOME_DIR < 0
  470. #define Y_MIN_PIN Y_STOP_PIN
  471. #define Y_MAX_PIN -1
  472. #else
  473. #define Y_MIN_PIN -1
  474. #define Y_MAX_PIN Y_STOP_PIN
  475. #endif
  476. #endif
  477. #ifdef Z_STOP_PIN
  478. #if Z_HOME_DIR < 0
  479. #define Z_MIN_PIN Z_STOP_PIN
  480. #define Z_MAX_PIN -1
  481. #else
  482. #define Z_MIN_PIN -1
  483. #define Z_MAX_PIN Z_STOP_PIN
  484. #endif
  485. #endif
  486. #ifdef DISABLE_MAX_ENDSTOPS
  487. #define X_MAX_PIN -1
  488. #define Y_MAX_PIN -1
  489. #define Z_MAX_PIN -1
  490. #endif
  491. #ifdef DISABLE_MIN_ENDSTOPS
  492. #define X_MIN_PIN -1
  493. #define Y_MIN_PIN -1
  494. #define Z_MIN_PIN -1
  495. #endif
  496. #define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
  497. HEATER_BED_PIN, FAN_PIN, \
  498. _E0_PINS _E1_PINS _E2_PINS \
  499. analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
  500. #endif //__PINS_H