pins.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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. #endif
  60. #ifdef DIS
  61. #define D_REQUIRE 30
  62. #define D_DATA 20
  63. #define D_DATACLOCK 21
  64. #endif
  65. // The SDSS pin uses a different pin mapping from file Sd2PinMap.h
  66. #define SDSS 53
  67. #ifndef SDSUPPORT
  68. // these pins are defined in the SD library if building with SD support
  69. #define SCK_PIN 52
  70. #define MISO_PIN 50
  71. #define MOSI_PIN 51
  72. #endif
  73. #define BEEPER 84
  74. #define BTN_EN1 72
  75. #define BTN_EN2 14
  76. #define BTN_ENC 9
  77. #define SDCARDDETECT 15
  78. #define LCD_PINS_RS 82
  79. #define LCD_PINS_ENABLE 18
  80. #define LCD_PINS_D4 19
  81. #define LCD_PINS_D5 70
  82. #define LCD_PINS_D6 85
  83. #define LCD_PINS_D7 71
  84. #define E0_STEP_PIN 34
  85. #define E0_DIR_PIN 43
  86. #define E0_ENABLE_PIN 26
  87. #define E0_MS1_PIN 65
  88. #define E0_MS2_PIN 66
  89. #define LED_PIN 13
  90. #ifdef THREEMM_PRINTER
  91. #define FAN_PIN 8
  92. #else
  93. #define FAN_PIN 6
  94. #endif
  95. #define KILL_PIN -1 //80 with Smart Controller LCD
  96. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
  97. #define SDPOWER -1
  98. #define HEATER_2_PIN -1
  99. #ifdef MINI_RAMBO
  100. #define ELECTRONICS "RAMBo13a"
  101. #define HEATER_0_PIN 3
  102. #define HEATER_BED_PIN 4
  103. #define FAN_1_PIN -1 //6
  104. #define PS_ON_PIN 71
  105. #define MOTOR_CURRENT_PWM_XY_PIN 46
  106. #define MOTOR_CURRENT_PWM_Z_PIN 45
  107. #define MOTOR_CURRENT_PWM_E_PIN 44
  108. #else //RAMBo
  109. #define ELECTRONICS "RAMBoBig"
  110. #define E1_STEP_PIN 33
  111. #define E1_DIR_PIN 42
  112. #define E1_ENABLE_PIN 25
  113. #define E1_MS1_PIN 63
  114. #define E1_MS2_PIN 64
  115. #define DIGIPOTSS_PIN 38
  116. #define DIGIPOT_CHANNELS {4,5,3,0,1} // X Y Z E0 E1 digipot channels to stepper driver mapping
  117. #define HEATER_0_PIN 9
  118. #define HEATER_BED_PIN 3
  119. #define PS_ON_PIN 4
  120. #define SDSS 53
  121. #ifdef ULTRA_LCD
  122. #define KILL_PIN 80
  123. #ifdef NEWPANEL
  124. //arduino pin which triggers an piezzo beeper
  125. #define BEEPER 84 // Beeper on AUX-4
  126. #define LCD_PINS_RS 82
  127. #define LCD_PINS_ENABLE 18
  128. #define LCD_PINS_D4 19
  129. #define LCD_PINS_D5 70
  130. #define LCD_PINS_D6 85
  131. #define LCD_PINS_D7 71
  132. //buttons are directly attached using AUX-2
  133. #define BTN_EN1 76
  134. #define BTN_EN2 77
  135. #define BTN_ENC 78 //the click
  136. #define BLEN_C 2
  137. #define BLEN_B 1
  138. #define BLEN_A 0
  139. #define SDCARDDETECT 81 // Ramps does not use this port
  140. //encoder rotation values
  141. #define encrot0 0
  142. #define encrot1 2
  143. #define encrot2 3
  144. #define encrot3 1
  145. #else //old style panel with shift register
  146. //arduino pin witch triggers an piezzo beeper
  147. #define BEEPER 84 //No Beeper added
  148. //buttons are attached to a shift register
  149. // Not wired this yet
  150. // #define SHIFT_CLK 38
  151. // #define SHIFT_LD 42
  152. // #define SHIFT_OUT 40
  153. // #define SHIFT_EN 17
  154. #define LCD_PINS_RS 82
  155. #define LCD_PINS_ENABLE 18
  156. #define LCD_PINS_D4 19
  157. #define LCD_PINS_D5 70
  158. #define LCD_PINS_D6 85
  159. #define LCD_PINS_D7 71
  160. //encoder rotation values
  161. #define encrot0 0
  162. #define encrot1 2
  163. #define encrot2 3
  164. #define encrot3 1
  165. //bits in the shift register that carry the buttons for:
  166. // left up center down right red
  167. #define BL_LE 7
  168. #define BL_UP 6
  169. #define BL_MI 5
  170. #define BL_DW 4
  171. #define BL_RI 3
  172. #define BL_ST 2
  173. #define BLEN_B 1
  174. #define BLEN_A 0
  175. #endif
  176. #endif //ULTRA_LCD
  177. #endif //RAMBo/MiniRambo option
  178. #endif
  179. /*****************************************************************
  180. * Rambo mini Pin Assignments 1.0
  181. ******************************************************************/
  182. #if MOTHERBOARD == 102
  183. #define ELECTRONICS "RAMBo10a"
  184. #define KNOWN_BOARD
  185. #ifndef __AVR_ATmega2560__
  186. #error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
  187. #endif
  188. #define FR_SENS 21
  189. #ifdef SNMM
  190. #define E_MUX0_PIN 17
  191. #define E_MUX1_PIN 16
  192. #endif
  193. #define LARGE_FLASH true
  194. #define X_STEP_PIN 37
  195. #define X_DIR_PIN 48
  196. #define X_MIN_PIN 12
  197. #define X_MAX_PIN 30
  198. #define X_ENABLE_PIN 29
  199. #define X_MS1_PIN 40
  200. #define X_MS2_PIN 41
  201. #define Y_STEP_PIN 36
  202. #define Y_DIR_PIN 49
  203. #define Y_MIN_PIN 11
  204. #define Y_MAX_PIN 24
  205. #define Y_ENABLE_PIN 28
  206. #define Y_MS1_PIN 69
  207. #define Y_MS2_PIN 39
  208. #define Z_STEP_PIN 35
  209. #define Z_DIR_PIN 47
  210. #define Z_MIN_PIN 10
  211. #define Z_MAX_PIN 23
  212. #define Z_ENABLE_PIN 27
  213. #define Z_MS1_PIN 68
  214. #define Z_MS2_PIN 67
  215. #define TEMP_BED_PIN 2
  216. #define TEMP_0_PIN 0
  217. #define HEATER_1_PIN 7
  218. #define TEMP_1_PIN 1
  219. #define TEMP_2_PIN -1
  220. // The SDSS pin uses a different pin mapping from file Sd2PinMap.h
  221. #define SDSS 53
  222. #ifndef SDSUPPORT
  223. // these pins are defined in the SD library if building with SD support
  224. #define SCK_PIN 52
  225. #define MISO_PIN 50
  226. #define MOSI_PIN 51
  227. #endif
  228. #define BEEPER 78
  229. #define BTN_EN1 80
  230. #define BTN_EN2 73
  231. #define BTN_ENC 21
  232. #define SDCARDDETECT 72
  233. #define LCD_PINS_RS 38
  234. #define LCD_PINS_ENABLE 5
  235. #define LCD_PINS_D4 14
  236. #define LCD_PINS_D5 15
  237. #define LCD_PINS_D6 32
  238. #define LCD_PINS_D7 31
  239. #define E0_STEP_PIN 34
  240. #define E0_DIR_PIN 43
  241. #define E0_ENABLE_PIN 26
  242. #define E0_MS1_PIN 65
  243. #define E0_MS2_PIN 66
  244. #define LED_PIN 13
  245. #ifdef THREEMM_PRINTER
  246. #define FAN_PIN 8
  247. #else
  248. #define FAN_PIN 6
  249. #endif
  250. #define KILL_PIN -1 //80 with Smart Controller LCD
  251. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
  252. #define SDPOWER -1
  253. #define HEATER_2_PIN -1
  254. #define HEATER_0_PIN 3
  255. #define HEATER_BED_PIN 4
  256. #define FAN_1_PIN -1 //6
  257. #define PS_ON_PIN 71
  258. #define MOTOR_CURRENT_PWM_XY_PIN 46
  259. #define MOTOR_CURRENT_PWM_Z_PIN 45
  260. #define MOTOR_CURRENT_PWM_E_PIN 44
  261. #endif
  262. #ifndef KNOWN_BOARD
  263. #error Unknown MOTHERBOARD value in configuration.h
  264. #endif
  265. //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  266. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
  267. #if EXTRUDERS > 1
  268. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
  269. #else
  270. #define _E1_PINS
  271. #endif
  272. #if EXTRUDERS > 2
  273. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
  274. #else
  275. #define _E2_PINS
  276. #endif
  277. #ifdef X_STOP_PIN
  278. #if X_HOME_DIR < 0
  279. #define X_MIN_PIN X_STOP_PIN
  280. #define X_MAX_PIN -1
  281. #else
  282. #define X_MIN_PIN -1
  283. #define X_MAX_PIN X_STOP_PIN
  284. #endif
  285. #endif
  286. #ifdef Y_STOP_PIN
  287. #if Y_HOME_DIR < 0
  288. #define Y_MIN_PIN Y_STOP_PIN
  289. #define Y_MAX_PIN -1
  290. #else
  291. #define Y_MIN_PIN -1
  292. #define Y_MAX_PIN Y_STOP_PIN
  293. #endif
  294. #endif
  295. #ifdef Z_STOP_PIN
  296. #if Z_HOME_DIR < 0
  297. #define Z_MIN_PIN Z_STOP_PIN
  298. #define Z_MAX_PIN -1
  299. #else
  300. #define Z_MIN_PIN -1
  301. #define Z_MAX_PIN Z_STOP_PIN
  302. #endif
  303. #endif
  304. #ifdef DISABLE_MAX_ENDSTOPS
  305. #define X_MAX_PIN -1
  306. #define Y_MAX_PIN -1
  307. #define Z_MAX_PIN -1
  308. #endif
  309. #ifdef DISABLE_MIN_ENDSTOPS
  310. #define X_MIN_PIN -1
  311. #define Y_MIN_PIN -1
  312. #define Z_MIN_PIN -1
  313. #endif
  314. #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, \
  315. HEATER_BED_PIN, FAN_PIN, \
  316. _E0_PINS _E1_PINS _E2_PINS \
  317. analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
  318. #endif //__PINS_H