pins.h 9.4 KB

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