pins.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. #ifndef PINS_H
  2. #define PINS_H
  3. #if MOTHERBOARD == 99
  4. #define KNOWN_BOARD 1
  5. #define X_STEP_PIN 2
  6. #define X_DIR_PIN 3
  7. #define X_ENABLE_PIN -1
  8. #define X_MIN_PIN -1
  9. #define X_MAX_PIN 16
  10. #define Y_STEP_PIN 5
  11. #define Y_DIR_PIN 6
  12. #define Y_ENABLE_PIN -1
  13. #define Y_MIN_PIN 67
  14. #define Y_MAX_PIN -1
  15. #define Z_STEP_PIN 62
  16. #define Z_DIR_PIN 63
  17. #define Z_ENABLE_PIN -1
  18. #define Z_MIN_PIN 59
  19. #define Z_MAX_PIN -1
  20. #define E0_STEP_PIN 65
  21. #define E0_DIR_PIN 66
  22. #define E0_ENABLE_PIN -1
  23. #define SDPOWER -1
  24. #define SDSS 53
  25. #define LED_PIN -1
  26. #define FAN_PIN -1
  27. #define PS_ON_PIN 9
  28. #define KILL_PIN -1
  29. #define HEATER_0_PIN 13
  30. #define HEATER_1_PIN -1
  31. #define HEATER_2_PIN -1
  32. #define TEMP_0_PIN 6 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  33. #define TEMP_1_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  34. #define TEMP_2_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  35. #define HEATER_BED_PIN 4
  36. #define TEMP_BED_PIN 10
  37. #endif /* 99 */
  38. /****************************************************************************************
  39. * Gen7 v1.1, v1.2, v1.3, v1.4 pin assignment
  40. *
  41. ****************************************************************************************/
  42. #if MOTHERBOARD == 13
  43. #define MOTHERBOARD 11
  44. #define GEN7_VERSION 14 // v1.4
  45. #endif
  46. #if MOTHERBOARD == 12
  47. #define MOTHERBOARD 11
  48. #define GEN7_VERSION 13 // v1.3
  49. #endif
  50. #if MOTHERBOARD == 11
  51. #define KNOWN_BOARD
  52. #if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
  53. #error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
  54. #endif
  55. #ifndef GEN7_VERSION
  56. #define GEN7_VERSION 12 // v1.x
  57. #endif
  58. //x axis pins
  59. #define X_STEP_PIN 19
  60. #define X_DIR_PIN 18
  61. #define X_ENABLE_PIN 24
  62. #define X_MIN_PIN 7
  63. #define X_MAX_PIN -1
  64. //y axis pins
  65. #define Y_STEP_PIN 23
  66. #define Y_DIR_PIN 22
  67. #define Y_ENABLE_PIN 24
  68. #define Y_MIN_PIN 5
  69. #define Y_MAX_PIN -1
  70. //z axis pins
  71. #define Z_STEP_PIN 26
  72. #define Z_DIR_PIN 25
  73. #define Z_ENABLE_PIN 24
  74. #define Z_MIN_PIN 1
  75. #define Z_MAX_PIN 0
  76. //extruder pins
  77. #define E0_STEP_PIN 28
  78. #define E0_DIR_PIN 27
  79. #define E0_ENABLE_PIN 24
  80. #define TEMP_0_PIN 1
  81. #define TEMP_1_PIN -1
  82. #define TEMP_2_PIN -1
  83. #define TEMP_BED_PIN 2
  84. #define HEATER_0_PIN 4
  85. #define HEATER_1_PIN -1
  86. #define HEATER_2_PIN -1
  87. #define HEATER_BED_PIN 3
  88. #define SDPOWER -1
  89. #define SDSS -1 // SCL pin of I2C header
  90. #define LED_PIN -1
  91. #if (GEN7_VERSION >= 13)
  92. // Gen7 v1.3 removed the fan pin
  93. #define FAN_PIN -1
  94. #else
  95. #define FAN_PIN 31
  96. #endif
  97. #define PS_ON_PIN 15
  98. #if (GEN7_VERSION < 14)
  99. // Gen 1.3 and earlier supplied thermistor power via PS_ON
  100. // Need to ignore the bad thermistor readings on those units
  101. #define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
  102. #endif
  103. //our pin for debugging.
  104. #define DEBUG_PIN 0
  105. //our RS485 pins
  106. #define TX_ENABLE_PIN 12
  107. #define RX_ENABLE_PIN 13
  108. #endif
  109. /*******************************************************************************
  110. *********
  111. * Gen7 Alfons3 pin assignment
  112. *
  113. ********************************************************************************
  114. ********/
  115. /* These Pins are assigned for the modified GEN7 Board from Alfons3 Please review the pins and adjust it for your needs*/
  116. #if MOTHERBOARD == 10
  117. #define KNOWN_BOARD
  118. #if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
  119. #error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
  120. #endif
  121. //x axis pins
  122. #define X_STEP_PIN 21 //different from stanard GEN7
  123. #define X_DIR_PIN 20 //different from stanard GEN7
  124. #define X_ENABLE_PIN 24
  125. #define X_MIN_PIN 0
  126. #define X_MAX_PIN -1
  127. //y axis pins
  128. #define Y_STEP_PIN 23
  129. #define Y_DIR_PIN 22
  130. #define Y_ENABLE_PIN 24
  131. #define Y_MIN_PIN 1
  132. #define Y_MAX_PIN -1
  133. //z axis pins
  134. #define Z_STEP_PIN 26
  135. #define Z_DIR_PIN 25
  136. #define Z_ENABLE_PIN 24
  137. #define Z_MIN_PIN 2
  138. #define Z_MAX_PIN -1
  139. //extruder pins
  140. #define E0_STEP_PIN 28
  141. #define E0_DIR_PIN 27
  142. #define E0_ENABLE_PIN 24
  143. #define TEMP_0_PIN 2
  144. #define TEMP_1_PIN -1
  145. #define TEMP_2_PIN -1
  146. #define TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
  147. #define HEATER_0_PIN 4
  148. #define HEATER_1_PIN -1
  149. #define HEATER_2_PIN -1
  150. #define HEATER_BED_PIN 3 // (bed)
  151. #define SDPOWER -1
  152. #define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support
  153. #define LED_PIN -1
  154. #define FAN_PIN -1
  155. #define PS_ON_PIN 19
  156. //our pin for debugging.
  157. #define DEBUG_PIN -1
  158. //our RS485 pins
  159. //#define TX_ENABLE_PIN 12
  160. //#define RX_ENABLE_PIN 13
  161. #define BEEPER -1
  162. #define SDCARDDETECT -1
  163. #define SUICIDE_PIN -1 //has to be defined; otherwise Power_off doesn't work
  164. //Pins for 4bit LCD Support
  165. #define LCD_PINS_RS 18
  166. #define LCD_PINS_ENABLE 17
  167. #define LCD_PINS_D4 16
  168. #define LCD_PINS_D5 15
  169. #define LCD_PINS_D6 13
  170. #define LCD_PINS_D7 14
  171. //buttons are directly attached
  172. #define BTN_EN1 11
  173. #define BTN_EN2 10
  174. #define BTN_ENC 12 //the click
  175. #define BLEN_C 2
  176. #define BLEN_B 1
  177. #define BLEN_A 0
  178. #define encrot0 0
  179. #define encrot1 2
  180. #define encrot2 3
  181. #define encrot3 1
  182. #endif
  183. /****************************************************************************************
  184. * Arduino Mega pin assignment
  185. *
  186. ****************************************************************************************/
  187. #if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34
  188. #define KNOWN_BOARD 1
  189. //////////////////FIX THIS//////////////
  190. #ifndef __AVR_ATmega1280__
  191. #ifndef __AVR_ATmega2560__
  192. #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
  193. #endif
  194. #endif
  195. // uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
  196. // #define RAMPS_V_1_3
  197. // #define RAMPS_V_1_0
  198. #if MOTHERBOARD == 33 || MOTHERBOARD == 34
  199. #define X_STEP_PIN 54
  200. #define X_DIR_PIN 55
  201. #define X_ENABLE_PIN 38
  202. #define X_MIN_PIN 3
  203. #define X_MAX_PIN 2 //2 //Max endstops default to disabled "-1", set to commented value to enable.
  204. #define Y_STEP_PIN 60
  205. #define Y_DIR_PIN 61
  206. #define Y_ENABLE_PIN 56
  207. #define Y_MIN_PIN 14
  208. #define Y_MAX_PIN 15 //15
  209. #define Z_STEP_PIN 46
  210. #define Z_DIR_PIN 48
  211. #define Z_ENABLE_PIN 62
  212. #define Z_MIN_PIN 18
  213. #define Z_MAX_PIN 19
  214. #define E0_STEP_PIN 26
  215. #define E0_DIR_PIN 28
  216. #define E0_ENABLE_PIN 24
  217. #define E1_STEP_PIN 36
  218. #define E1_DIR_PIN 34
  219. #define E1_ENABLE_PIN 30
  220. #define SDPOWER -1
  221. #define SDSS 53
  222. #define LED_PIN 13
  223. #if MOTHERBOARD == 33
  224. #define FAN_PIN 9 // (Sprinter config)
  225. #else
  226. #define FAN_PIN 4 // IO pin. Buffer needed
  227. #endif
  228. #define PS_ON_PIN 12
  229. #define KILL_PIN -1
  230. #define HEATER_0_PIN 10 // EXTRUDER 1
  231. #if MOTHERBOARD == 33
  232. #define HEATER_1_PIN -1
  233. #else
  234. #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter)
  235. #endif
  236. #define HEATER_2_PIN -1
  237. #define TEMP_0_PIN 13 // ANALOG NUMBERING
  238. #define TEMP_1_PIN 15 // ANALOG NUMBERING
  239. #define TEMP_2_PIN -1 // ANALOG NUMBERING
  240. #define HEATER_BED_PIN 8 // BED
  241. #define TEMP_BED_PIN 14 // ANALOG NUMBERING
  242. #ifdef ULTRA_LCD
  243. #ifdef NEWPANEL
  244. //arduino pin which triggers an piezzo beeper
  245. #define BEEPER 33 // Beeper on AUX-4
  246. #define LCD_PINS_RS 16
  247. #define LCD_PINS_ENABLE 17
  248. #define LCD_PINS_D4 23
  249. #define LCD_PINS_D5 25
  250. #define LCD_PINS_D6 27
  251. #define LCD_PINS_D7 29
  252. //buttons are directly attached using AUX-2
  253. #define BTN_EN1 37
  254. #define BTN_EN2 35
  255. #define BTN_ENC 31 //the click
  256. #define BLEN_C 2
  257. #define BLEN_B 1
  258. #define BLEN_A 0
  259. #define SDCARDDETECT -1 // Ramps does not use this port
  260. //encoder rotation values
  261. #define encrot0 0
  262. #define encrot1 2
  263. #define encrot2 3
  264. #define encrot3 1
  265. #else //old style panel with shift register
  266. //arduino pin witch triggers an piezzo beeper
  267. #define BEEPER 33 No Beeper added
  268. //buttons are attached to a shift register
  269. // Not wired this yet
  270. //#define SHIFT_CLK 38
  271. //#define SHIFT_LD 42
  272. //#define SHIFT_OUT 40
  273. //#define SHIFT_EN 17
  274. #define LCD_PINS_RS 16
  275. #define LCD_PINS_ENABLE 17
  276. #define LCD_PINS_D4 23
  277. #define LCD_PINS_D5 25
  278. #define LCD_PINS_D6 27
  279. #define LCD_PINS_D7 29
  280. //encoder rotation values
  281. #define encrot0 0
  282. #define encrot1 2
  283. #define encrot2 3
  284. #define encrot3 1
  285. //bits in the shift register that carry the buttons for:
  286. // left up center down right red
  287. #define BL_LE 7
  288. #define BL_UP 6
  289. #define BL_MI 5
  290. #define BL_DW 4
  291. #define BL_RI 3
  292. #define BL_ST 2
  293. #define BLEN_B 1
  294. #define BLEN_A 0
  295. #endif
  296. #endif //ULTRA_LCD
  297. #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default
  298. #define X_STEP_PIN 26
  299. #define X_DIR_PIN 28
  300. #define X_ENABLE_PIN 24
  301. #define X_MIN_PIN 3
  302. #define X_MAX_PIN -1 //2
  303. #define Y_STEP_PIN 38
  304. #define Y_DIR_PIN 40
  305. #define Y_ENABLE_PIN 36
  306. #define Y_MIN_PIN 16
  307. #define Y_MAX_PIN -1 //17
  308. #define Z_STEP_PIN 44
  309. #define Z_DIR_PIN 46
  310. #define Z_ENABLE_PIN 42
  311. #define Z_MIN_PIN 18
  312. #define Z_MAX_PIN -1 //19
  313. #define E0_STEP_PIN 32
  314. #define E0_DIR_PIN 34
  315. #define E0_ENABLE_PIN 30
  316. #define SDPOWER 48
  317. #define SDSS 53
  318. #define LED_PIN 13
  319. #define PS_ON_PIN -1
  320. #define KILL_PIN -1
  321. #ifdef RAMPS_V_1_0 // RAMPS_V_1_0
  322. #define HEATER_0_PIN 12 // RAMPS 1.0
  323. #define HEATER_BED_PIN -1 // RAMPS 1.0
  324. #define FAN_PIN 11 // RAMPS 1.0
  325. #else // RAMPS_V_1_1 or RAMPS_V_1_2
  326. #define HEATER_0_PIN 10 // RAMPS 1.1
  327. #define HEATER_BED_PIN 8 // RAMPS 1.1
  328. #define FAN_PIN 9 // RAMPS 1.1
  329. #endif
  330. #define HEATER_1_PIN -1
  331. #define HEATER_2_PIN -1
  332. #define TEMP_0_PIN 2 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  333. #define TEMP_1_PIN -1
  334. #define TEMP_2_PIN -1
  335. #define TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  336. #endif
  337. // SPI for Max6675 Thermocouple
  338. #ifndef SDSUPPORT
  339. // these pins are defined in the SD library if building with SD support
  340. #define MAX_SCK_PIN 52
  341. #define MAX_MISO_PIN 50
  342. #define MAX_MOSI_PIN 51
  343. #define MAX6675_SS 53
  344. #else
  345. #define MAX6675_SS 49
  346. #endif
  347. #endif
  348. /****************************************************************************************
  349. * Duemilanove w/ ATMega328P pin assignment
  350. *
  351. ****************************************************************************************/
  352. #if MOTHERBOARD == 4
  353. #define KNOWN_BOARD 1
  354. #ifndef __AVR_ATmega328P__
  355. #error Oops! Make sure you have 'Arduino Duemilanove w/ ATMega328' selected from the 'Tools -> Boards' menu.
  356. #endif
  357. #define X_STEP_PIN 19
  358. #define X_DIR_PIN 18
  359. #define X_ENABLE_PIN -1
  360. #define X_MIN_PIN 17
  361. #define X_MAX_PIN -1
  362. #define Y_STEP_PIN 10
  363. #define Y_DIR_PIN 7
  364. #define Y_ENABLE_PIN -1
  365. #define Y_MIN_PIN 8
  366. #define Y_MAX_PIN -1
  367. #define Z_STEP_PIN 13
  368. #define Z_DIR_PIN 3
  369. #define Z_ENABLE_PIN 2
  370. #define Z_MIN_PIN 4
  371. #define Z_MAX_PIN -1
  372. #define E0_STEP_PIN 11
  373. #define E0_DIR_PIN 12
  374. #define E0_ENABLE_PIN -1
  375. #define SDPOWER -1
  376. #define SDSS -1
  377. #define LED_PIN -1
  378. #define FAN_PIN 5
  379. #define PS_ON_PIN -1
  380. #define KILL_PIN -1
  381. #define HEATER_0_PIN 6
  382. #define HEATER_1_PIN -1
  383. #define HEATER_2_PIN -1
  384. #define TEMP_0_PIN 0 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  385. #define TEMP_1_PIN -1
  386. #define TEMP_2_PIN -1
  387. #define HEATER_BED_PIN -1
  388. #define TEMP_BED_PIN -1
  389. #endif
  390. /****************************************************************************************
  391. * Gen6 pin assignment
  392. *
  393. ****************************************************************************************/
  394. #if MOTHERBOARD == 5 || MOTHERBOARD == 51
  395. #define KNOWN_BOARD 1
  396. #ifndef __AVR_ATmega644P__
  397. #ifndef __AVR_ATmega1284P__
  398. #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  399. #endif
  400. #endif
  401. //x axis pins
  402. #define X_STEP_PIN 15
  403. #define X_DIR_PIN 18
  404. #define X_ENABLE_PIN 19
  405. #define X_MIN_PIN 20
  406. #define X_MAX_PIN -1
  407. //y axis pins
  408. #define Y_STEP_PIN 23
  409. #define Y_DIR_PIN 22
  410. #define Y_ENABLE_PIN 24
  411. #define Y_MIN_PIN 25
  412. #define Y_MAX_PIN -1
  413. //z axis pins
  414. #define Z_STEP_PIN 27
  415. #define Z_DIR_PIN 28
  416. #define Z_ENABLE_PIN 29
  417. #define Z_MIN_PIN 30
  418. #define Z_MAX_PIN -1
  419. //extruder pins
  420. #define E0_STEP_PIN 4 //Edited @ EJE Electronics 20100715
  421. #define E0_DIR_PIN 2 //Edited @ EJE Electronics 20100715
  422. #define E0_ENABLE_PIN 3 //Added @ EJE Electronics 20100715
  423. #define TEMP_0_PIN 5 //changed @ rkoeppl 20110410
  424. #define TEMP_1_PIN -1 //changed @ rkoeppl 20110410
  425. #define TEMP_2_PIN -1 //changed @ rkoeppl 20110410
  426. #define HEATER_0_PIN 14 //changed @ rkoeppl 20110410
  427. #define HEATER_1_PIN -1
  428. #define HEATER_2_PIN -1
  429. #if MOTHERBOARD == 5
  430. #define HEATER_BED_PIN -1 //changed @ rkoeppl 20110410
  431. #define TEMP_BED_PIN -1 //changed @ rkoeppl 20110410
  432. #else
  433. #define HEATER_BED_PIN 1 //changed @ rkoeppl 20110410
  434. #define TEMP_BED_PIN 0 //changed @ rkoeppl 20110410
  435. #endif
  436. #define SDPOWER -1
  437. #define SDSS 17
  438. #define LED_PIN -1 //changed @ rkoeppl 20110410
  439. #define FAN_PIN -1 //changed @ rkoeppl 20110410
  440. #define PS_ON_PIN -1 //changed @ rkoeppl 20110410
  441. //our pin for debugging.
  442. #define DEBUG_PIN 0
  443. //our RS485 pins
  444. #define TX_ENABLE_PIN 12
  445. #define RX_ENABLE_PIN 13
  446. #endif
  447. /****************************************************************************************
  448. * Sanguinololu pin assignment
  449. *
  450. ****************************************************************************************/
  451. #if MOTHERBOARD == 63
  452. #define MELZI
  453. #endif
  454. #if MOTHERBOARD == 62 || MOTHERBOARD == 63
  455. #undef MOTHERBOARD
  456. #define MOTHERBOARD 6
  457. #define SANGUINOLOLU_V_1_2
  458. #endif
  459. #if MOTHERBOARD == 6
  460. #define KNOWN_BOARD 1
  461. #ifndef __AVR_ATmega644P__
  462. #ifndef __AVR_ATmega1284P__
  463. #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  464. #endif
  465. #endif
  466. #define X_STEP_PIN 15
  467. #define X_DIR_PIN 21
  468. #define X_MIN_PIN 18
  469. #define X_MAX_PIN -1
  470. #define Y_STEP_PIN 22
  471. #define Y_DIR_PIN 23
  472. #define Y_MIN_PIN 19
  473. #define Y_MAX_PIN -1
  474. #define Z_STEP_PIN 3
  475. #define Z_DIR_PIN 2
  476. #define Z_MIN_PIN 20
  477. #define Z_MAX_PIN -1
  478. #define E0_STEP_PIN 1
  479. #define E0_DIR_PIN 0
  480. #define LED_PIN -1
  481. #define FAN_PIN -1
  482. #ifdef MELZI
  483. #define LED_PIN 28
  484. #define FAN_PIN 4
  485. #endif
  486. #define PS_ON_PIN -1
  487. #define KILL_PIN -1
  488. #define HEATER_0_PIN 13 // (extruder)
  489. #define HEATER_1_PIN -1
  490. #define HEATER_2_PIN -1
  491. #ifdef SANGUINOLOLU_V_1_2
  492. #define HEATER_BED_PIN 12 // (bed)
  493. #define X_ENABLE_PIN 14
  494. #define Y_ENABLE_PIN 14
  495. #define Z_ENABLE_PIN 26
  496. #define E0_ENABLE_PIN 14
  497. #else
  498. #define HEATER_BED_PIN 14 // (bed)
  499. #define X_ENABLE_PIN -1
  500. #define Y_ENABLE_PIN -1
  501. #define Z_ENABLE_PIN -1
  502. #define E0_ENABLE_PIN -1
  503. #endif
  504. #define TEMP_0_PIN 7 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 33 extruder)
  505. #define TEMP_1_PIN -1
  506. #define TEMP_2_PIN -1
  507. #define TEMP_BED_PIN 6 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
  508. #define SDPOWER -1
  509. #define SDSS 31
  510. #ifdef MELZI
  511. #define SDSS 24
  512. #endif
  513. #endif
  514. #if MOTHERBOARD == 7
  515. #define KNOWN_BOARD
  516. /*****************************************************************
  517. * Ultimaker pin assignment
  518. ******************************************************************/
  519. #ifndef __AVR_ATmega1280__
  520. #ifndef __AVR_ATmega2560__
  521. #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
  522. #endif
  523. #endif
  524. #define X_STEP_PIN 25
  525. #define X_DIR_PIN 23
  526. #define X_MIN_PIN 22
  527. #define X_MAX_PIN 24
  528. #define X_ENABLE_PIN 27
  529. #define Y_STEP_PIN 31
  530. #define Y_DIR_PIN 33
  531. #define Y_MIN_PIN 26
  532. #define Y_MAX_PIN 28
  533. #define Y_ENABLE_PIN 29
  534. #define Z_STEP_PIN 37
  535. #define Z_DIR_PIN 39
  536. #define Z_MIN_PIN 30
  537. #define Z_MAX_PIN 32
  538. #define Z_ENABLE_PIN 35
  539. #define HEATER_BED_PIN 4
  540. #define TEMP_BED_PIN 10
  541. #define HEATER_0_PIN 2
  542. #define TEMP_0_PIN 8
  543. #define HEATER_1_PIN 3
  544. #define TEMP_1_PIN 9
  545. #define HEATER_2_PIN -1
  546. #define TEMP_2_PIN -1
  547. #define E0_STEP_PIN 43
  548. #define E0_DIR_PIN 45
  549. #define E0_ENABLE_PIN 41
  550. #define E1_STEP_PIN 49
  551. #define E1_DIR_PIN 47
  552. #define E1_ENABLE_PIN 48
  553. #define SDPOWER -1
  554. #define SDSS 53
  555. #define LED_PIN 13
  556. #define FAN_PIN 7
  557. #define PS_ON_PIN 12
  558. #define KILL_PIN -1
  559. #define SUICIDE_PIN 54 //PIN that has to be turned on right after start, to keep power flowing.
  560. #ifdef ULTRA_LCD
  561. #ifdef NEWPANEL
  562. //arduino pin witch triggers an piezzo beeper
  563. #define BEEPER 18
  564. #define LCD_PINS_RS 20
  565. #define LCD_PINS_ENABLE 17
  566. #define LCD_PINS_D4 16
  567. #define LCD_PINS_D5 21
  568. #define LCD_PINS_D6 5
  569. #define LCD_PINS_D7 6
  570. //buttons are directly attached
  571. #define BTN_EN1 40
  572. #define BTN_EN2 42
  573. #define BTN_ENC 19 //the click
  574. #define BLEN_C 2
  575. #define BLEN_B 1
  576. #define BLEN_A 0
  577. #define SDCARDDETECT 38
  578. //encoder rotation values
  579. #define encrot0 0
  580. #define encrot1 2
  581. #define encrot2 3
  582. #define encrot3 1
  583. #else //old style panel with shift register
  584. //arduino pin witch triggers an piezzo beeper
  585. #define BEEPER 18
  586. //buttons are attached to a shift register
  587. #define SHIFT_CLK 38
  588. #define SHIFT_LD 42
  589. #define SHIFT_OUT 40
  590. #define SHIFT_EN 17
  591. #define LCD_PINS_RS 16
  592. #define LCD_PINS_ENABLE 5
  593. #define LCD_PINS_D4 6
  594. #define LCD_PINS_D5 21
  595. #define LCD_PINS_D6 20
  596. #define LCD_PINS_D7 19
  597. //encoder rotation values
  598. #ifndef ULTIMAKERCONTROLLER
  599. #define encrot0 0
  600. #define encrot1 2
  601. #define encrot2 3
  602. #define encrot3 1
  603. #else
  604. #define encrot0 0
  605. #define encrot1 1
  606. #define encrot2 3
  607. #define encrot3 2
  608. #endif
  609. #define SDCARDDETECT -1
  610. //bits in the shift register that carry the buttons for:
  611. // left up center down right red
  612. #define BL_LE 7
  613. #define BL_UP 6
  614. #define BL_MI 5
  615. #define BL_DW 4
  616. #define BL_RI 3
  617. #define BL_ST 2
  618. #define BLEN_B 1
  619. #define BLEN_A 0
  620. #endif
  621. #endif //ULTRA_LCD
  622. #endif
  623. #if MOTHERBOARD == 71
  624. #define KNOWN_BOARD
  625. /*****************************************************************
  626. * Ultimaker pin assignment (Old electronics)
  627. ******************************************************************/
  628. #ifndef __AVR_ATmega1280__
  629. #ifndef __AVR_ATmega2560__
  630. #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
  631. #endif
  632. #endif
  633. #define X_STEP_PIN 25
  634. #define X_DIR_PIN 23
  635. #define X_MIN_PIN 15
  636. #define X_MAX_PIN 14
  637. #define X_ENABLE_PIN 27
  638. #define Y_STEP_PIN 31
  639. #define Y_DIR_PIN 33
  640. #define Y_MIN_PIN 17
  641. #define Y_MAX_PIN 16
  642. #define Y_ENABLE_PIN 29
  643. #define Z_STEP_PIN 37
  644. #define Z_DIR_PIN 39
  645. #define Z_MIN_PIN 19
  646. #define Z_MAX_PIN 18
  647. #define Z_ENABLE_PIN 35
  648. #define HEATER_BED_PIN -1
  649. #define TEMP_BED_PIN -1
  650. #define HEATER_0_PIN 2
  651. #define TEMP_0_PIN 8
  652. #define HEATER_1_PIN 1
  653. #define TEMP_1_PIN 1
  654. #define HEATER_2_PIN -1
  655. #define TEMP_2_PIN -1
  656. #define E0_STEP_PIN 43
  657. #define E0_DIR_PIN 45
  658. #define E0_ENABLE_PIN 41
  659. #define E1_STEP_PIN -1
  660. #define E1_DIR_PIN -1
  661. #define E1_ENABLE_PIN -1
  662. #define SDPOWER -1
  663. #define SDSS -1
  664. #define LED_PIN -1
  665. #define FAN_PIN -1
  666. #define PS_ON_PIN -1
  667. #define KILL_PIN -1
  668. #define SUICIDE_PIN -1 //PIN that has to be turned on right after start, to keep power flowing.
  669. #define LCD_PINS_RS 24
  670. #define LCD_PINS_ENABLE 22
  671. #define LCD_PINS_D4 36
  672. #define LCD_PINS_D5 34
  673. #define LCD_PINS_D6 32
  674. #define LCD_PINS_D7 30
  675. #endif
  676. /****************************************************************************************
  677. * Teensylu 0.7 pin assingments (ATMEGA90USB)
  678. * Requires the Teensyduino software with Teensy2.0++ selected in arduino IDE!
  679. ****************************************************************************************/
  680. #if MOTHERBOARD == 8
  681. #define MOTHERBOARD 8
  682. #define KNOWN_BOARD 1
  683. #define X_STEP_PIN 0
  684. #define X_DIR_PIN 1
  685. #define X_ENABLE_PIN 39
  686. #define X_MIN_PIN 13
  687. #define X_MAX_PIN -1
  688. #define Y_STEP_PIN 2
  689. #define Y_DIR_PIN 3
  690. #define Y_ENABLE_PIN 38
  691. #define Y_MIN_PIN 14
  692. #define Y_MAX_PIN -1
  693. #define Z_STEP_PIN 4
  694. #define Z_DIR_PIN 5
  695. #define Z_ENABLE_PIN 23
  696. #define Z_MIN_PIN 15
  697. #define Z_MAX_PIN -1
  698. #define E0_STEP_PIN 6
  699. #define E0_DIR_PIN 7
  700. #define E0_ENABLE_PIN 19
  701. #define HEATER_0_PIN 21 // Extruder
  702. #define HEATER_1_PIN -1
  703. #define HEATER_2_PIN -1
  704. #define HEATER_BED_PIN 20 // Bed
  705. #define FAN_PIN 22 // Fan
  706. #define TEMP_0_PIN 7 // Extruder
  707. #define TEMP_1_PIN -1
  708. #define TEMP_2_PIN -1
  709. #define TEMP_BED_PIN 6 // Bed
  710. #define SDPOWER -1
  711. #define SDSS 8
  712. #define LED_PIN -1
  713. #define PS_ON_PIN -1
  714. #define KILL_PIN -1
  715. #define ALARM_PIN -1
  716. #ifndef SDSUPPORT
  717. // these pins are defined in the SD library if building with SD support
  718. #define SCK_PIN 9
  719. #define MISO_PIN 11
  720. #define MOSI_PIN 10
  721. #endif
  722. #endif
  723. /****************************************************************************************
  724. * Gen3+ pin assignment
  725. *
  726. ****************************************************************************************/
  727. #if MOTHERBOARD == 9
  728. #define MOTHERBOARD 6
  729. #define KNOWN_BOARD 1
  730. #ifndef __AVR_ATmega644P__
  731. #ifndef __AVR_ATmega1284P__
  732. #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  733. #endif
  734. #endif
  735. #define X_STEP_PIN 15
  736. #define X_DIR_PIN 18
  737. #define X_MIN_PIN 20
  738. #define X_MAX_PIN -1
  739. #define Y_STEP_PIN 23
  740. #define Y_DIR_PIN 22
  741. #define Y_MIN_PIN 25
  742. #define Y_MAX_PIN -1
  743. #define Z_STEP_PIN 27
  744. #define Z_DIR_PIN 28
  745. #define Z_MIN_PIN 30
  746. #define Z_MAX_PIN -1
  747. #define E_STEP_PIN 17
  748. #define E_DIR_PIN 21
  749. #define LED_PIN -1
  750. #define FAN_PIN -1
  751. #define PS_ON_PIN 14
  752. #define KILL_PIN -1
  753. #define HEATER_0_PIN 12 // (extruder)
  754. #define HEATER_1_PIN 16 // (bed)
  755. #define X_ENABLE_PIN 19
  756. #define Y_ENABLE_PIN 24
  757. #define Z_ENABLE_PIN 29
  758. #define E_ENABLE_PIN 13
  759. #define TEMP_0_PIN 0 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 33 extruder)
  760. #define TEMP_1_PIN 5 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
  761. #define TEMP_2_PIN -1
  762. #define SDPOWER -1
  763. #define SDSS 4
  764. #define HEATER_2_PIN -1
  765. #endif
  766. /****************************************************************************************
  767. * Open Motion controller with enable based extruders
  768. *
  769. * ATMega644
  770. *
  771. * +---\/---+
  772. * (D 0) PB0 1| |40 PA0 (AI 0 / D31)
  773. * (D 1) PB1 2| |39 PA1 (AI 1 / D30)
  774. * INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29)
  775. * PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28)
  776. * PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27)
  777. * MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26)
  778. * MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25)
  779. * SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24)
  780. * RST 9| |32 AREF
  781. * VCC 10| |31 GND
  782. * GND 11| |30 AVCC
  783. * XTAL2 12| |29 PC7 (D 23)
  784. * XTAL1 13| |28 PC6 (D 22)
  785. * RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI
  786. * TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO
  787. * INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS
  788. * INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK
  789. * PWM (D 12) PD4 18| |23 PC1 (D 17) SDA
  790. * PWM (D 13) PD5 19| |22 PC0 (D 16) SCL
  791. * PWM (D 14) PD6 20| |21 PD7 (D 15) PWM
  792. * +--------+
  793. *
  794. ****************************************************************************************/
  795. #if MOTHERBOARD == 90 //Alpha OMCA board
  796. #define KNOWN_BOARD 1
  797. #ifndef __AVR_ATmega644__
  798. #error Oops! Make sure you have 'SanguinoA' selected from the 'Tools -> Boards' menu.
  799. #endif
  800. #define X_STEP_PIN 21
  801. #define X_DIR_PIN 20
  802. #define X_ENABLE_PIN 24
  803. #define X_MIN_PIN 0
  804. #define X_MAX_PIN -1
  805. #define Y_STEP_PIN 23
  806. #define Y_DIR_PIN 22
  807. #define Y_ENABLE_PIN 24
  808. #define Y_MIN_PIN 1
  809. #define Y_MAX_PIN -1
  810. #define Z_STEP_PIN 26
  811. #define Z_DIR_PIN 25
  812. #define Z_ENABLE_PIN 24
  813. #define Z_MIN_PIN 49
  814. #define Z_MAX_PIN -1
  815. #define E0_STEP_PIN 28
  816. #define E0_DIR_PIN 27
  817. #define E0_ENABLE_PIN 24
  818. #define E1_STEP_PIN -1 // 19
  819. #define E1_DIR_PIN -1 // 18
  820. #define E1_ENABLE_PIN 24
  821. #define E2_STEP_PIN -1 // 17
  822. #define E2_DIR_PIN -1 // 16
  823. #define E2_ENABLE_PIN 24
  824. #define SDPOWER -1
  825. #define SDSS 11
  826. #define SDCARDDETECT -1 // 10 optional also used as mode pin
  827. #define LED_PIN -1
  828. #define FAN_PIN 3
  829. #define PS_ON_PIN -1
  830. #define KILL_PIN -1
  831. #define HEATER_0_PIN 4
  832. #define HEATER_1_PIN -1 // 12
  833. #define HEATER_2_PIN -1 // 13
  834. #define TEMP_0_PIN 0 //D27 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  835. #define TEMP_1_PIN -1 // 1
  836. #define TEMP_2_PIN -1 // 2
  837. #define HEATER_BED_PIN -1 // 14/15
  838. #define TEMP_BED_PIN -1 // 1,2 or I2C
  839. /* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */
  840. #endif
  841. #if MOTHERBOARD == 72 // Final OMCA board -- REF http://sanguino.cc/hardware
  842. #define KNOWN_BOARD 1
  843. #ifndef __AVR_ATmega1280__
  844. #ifndef __AVR_ATmega2560__
  845. #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
  846. #endif
  847. #endif
  848. #define X_STEP_PIN 28
  849. #define X_DIR_PIN 63
  850. #define X_ENABLE_PIN 29
  851. #define X_MIN_PIN 47
  852. #define X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
  853. #define Y_STEP_PIN 14 // A6
  854. #define Y_DIR_PIN 15 // A0
  855. #define Y_ENABLE_PIN 39
  856. #define Y_MIN_PIN 48
  857. #define Y_MAX_PIN -1 //15
  858. #define Z_STEP_PIN 31 // A2
  859. #define Z_DIR_PIN 32 // A6
  860. #define Z_ENABLE_PIN 30 // A1
  861. #define Z_MIN_PIN 49
  862. #define Z_MAX_PIN -1
  863. #define E0_STEP_PIN 34 //34
  864. #define E0_DIR_PIN 35 //35
  865. #define E0_ENABLE_PIN 33 //33
  866. #define E1_STEP_PIN 37 //37
  867. #define E1_DIR_PIN 40 //40
  868. #define E1_ENABLE_PIN 36 //36
  869. #define SDPOWER -1
  870. #define SDSS 11
  871. #define SDCARDDETECT -1 // 10 optional also used as mode pin
  872. #define LED_PIN 13
  873. #define FAN_PIN 7
  874. #define PS_ON_PIN -1
  875. #define KILL_PIN -1
  876. #define SOL1_PIN 16
  877. #define SOL2_PIN 17
  878. #define HEATER_0_PIN 9
  879. #define HEATER_1_PIN 8 // 12
  880. #define HEATER_2_PIN 11 //-1 // 13
  881. #define TEMP_0_PIN 13 //D27 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  882. #define TEMP_1_PIN 15 // 1
  883. #define TEMP_2_PIN -1 // 2
  884. #define HEATER_BED_PIN 10 // 14/15
  885. #define TEMP_BED_PIN 14 // 1,2 or I2C
  886. /* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */
  887. #endif
  888. #if MOTHERBOARD == 91 // Final OMCA board -- REF http://sanguino.cc/hardware
  889. #define KNOWN_BOARD 1
  890. #if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__)
  891. #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. (Final OMCA board)
  892. #endif
  893. #define X_STEP_PIN 26
  894. #define X_DIR_PIN 25
  895. #define X_ENABLE_PIN 10
  896. #define X_MIN_PIN 0
  897. #define X_MAX_PIN -1
  898. #define Y_STEP_PIN 28
  899. #define Y_DIR_PIN 27
  900. #define Y_ENABLE_PIN 10
  901. #define Y_MIN_PIN 1
  902. #define Y_MAX_PIN -1
  903. #define Z_STEP_PIN 23
  904. #define Z_DIR_PIN 22
  905. #define Z_ENABLE_PIN 10
  906. #define Z_MIN_PIN 2
  907. #define Z_MAX_PIN -1
  908. #define E0_STEP_PIN 24
  909. #define E0_DIR_PIN 21
  910. #define E0_ENABLE_PIN 10
  911. /* future proofing */
  912. #define __FS 20
  913. #define __FD 19
  914. #define __GS 18
  915. #define __GD 13
  916. #define UNUSED_PWM 14 /* PWM on LEFT connector */
  917. #define E1_STEP_PIN -1 // 21
  918. #define E1_DIR_PIN -1 // 20
  919. #define E1_ENABLE_PIN -1 // 19
  920. #define E2_STEP_PIN -1 // 21
  921. #define E2_DIR_PIN -1 // 20
  922. #define E2_ENABLE_PIN -1 // 18
  923. #define SDPOWER -1
  924. #define SDSS 11
  925. #define SDCARDDETECT -1 // 10 optional also used as mode pin
  926. #define LED_PIN -1
  927. #define FAN_PIN 14 /* PWM on MIDDLE connector */
  928. #define PS_ON_PIN -1
  929. #define KILL_PIN -1
  930. #define HEATER_0_PIN 3 /*DONE PWM on RIGHT connector */
  931. #define HEATER_1_PIN -1
  932. #define HEATER_2_PIN -1
  933. #define HEATER_1_PIN -1
  934. #define HEATER_2_PIN -1
  935. #define TEMP_0_PIN 0 // ANALOG INPUT NUMBERING
  936. #define TEMP_1_PIN 1 // ANALOG
  937. #define TEMP_2_PIN -1 // 2
  938. #define HEATER_BED_PIN 4
  939. #define TEMP_BED_PIN 2 // 1,2 or I2C
  940. #define I2C_SCL 16
  941. #define I2C_SDA 17
  942. #endif
  943. #ifndef KNOWN_BOARD
  944. #error Unknown MOTHERBOARD value in configuration.h
  945. #endif
  946. //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  947. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
  948. #if EXTRUDERS > 1
  949. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
  950. #else
  951. #define _E1_PINS
  952. #endif
  953. #if EXTRUDERS > 2
  954. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
  955. #else
  956. #define _E2_PINS
  957. #endif
  958. #ifdef DISABLE_MAX_ENDSTOPS
  959. #define X_MAX_PIN -1
  960. #define Y_MAX_PIN -1
  961. #define Z_MAX_PIN -1
  962. #endif
  963. #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, LED_PIN, PS_ON_PIN, \
  964. HEATER_BED_PIN, FAN_PIN, \
  965. _E0_PINS _E1_PINS _E2_PINS \
  966. TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }
  967. #endif