Advertisement
Guest User

pins.h

a guest
Jan 8th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 12.74 KB | None | 0 0
  1. #ifndef PINS_H
  2. #define PINS_H
  3.  
  4. /****************************************************************************************
  5. * Arduino pin assignment
  6. *
  7. *                  ATMega168
  8. *                   +-\/-+
  9. *             PC6  1|    |28  PC5 (AI 5 / D19)
  10. *       (D 0) PD0  2|    |27  PC4 (AI 4 / D18)
  11. *       (D 1) PD1  3|    |26  PC3 (AI 3 / D17)
  12. *       (D 2) PD2  4|    |25  PC2 (AI 2 / D16)
  13. *  PWM+ (D 3) PD3  5|    |24  PC1 (AI 1 / D15)
  14. *       (D 4) PD4  6|    |23  PC0 (AI 0 / D14)
  15. *             VCC  7|    |22  GND
  16. *             GND  8|    |21  AREF
  17. *             PB6  9|    |20  AVCC
  18. *             PB7 10|    |19  PB5 (D 13)
  19. *  PWM+ (D 5) PD5 11|    |18  PB4 (D 12)
  20. *  PWM+ (D 6) PD6 12|    |17  PB3 (D 11) PWM
  21. *       (D 7) PD7 13|    |16  PB2 (D 10) PWM
  22. *       (D 8) PB0 14|    |15  PB1 (D 9)  PWM
  23. *                   +----+
  24. ****************************************************************************************/
  25. #if MOTHERBOARD == 0
  26. #ifndef __AVR_ATmega168__
  27. #error Oops!  Make sure you have 'Arduino Diecimila' selected from the boards menu.
  28. #endif
  29.  
  30. #define X_STEP_PIN          2
  31. #define X_DIR_PIN           3
  32. #define X_ENABLE_PIN       -1
  33. #define X_MIN_PIN           4
  34. #define X_MAX_PIN           9
  35.  
  36. #define Y_STEP_PIN         10
  37. #define Y_DIR_PIN           7
  38. #define Y_ENABLE_PIN       -1
  39. #define Y_MIN_PIN           8
  40. #define Y_MAX_PIN          13
  41.  
  42. #define Z_STEP_PIN         19
  43. #define Z_DIR_PIN          18
  44. #define Z_ENABLE_PIN        5
  45. #define Z_MIN_PIN          17
  46. #define Z_MAX_PIN          16
  47.  
  48. #define E_STEP_PIN         11
  49. #define E_DIR_PIN          12
  50. #define E_ENABLE_PIN       -1
  51.  
  52. #define SDPOWER          -1
  53. #define SDSS          -1
  54. #define LED_PIN            -1
  55. #define FAN_PIN            -1
  56. #define PS_ON_PIN          15
  57. #define KILL_PIN           -1
  58.  
  59. #define HEATER_0_PIN        6
  60. #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. /****************************************************************************************
  68. * Sanguino/RepRap Motherboard with direct-drive extruders
  69. *
  70. *                        ATMega644P
  71. *
  72. *                        +---\/---+
  73. *            (D 0) PB0  1|        |40  PA0 (AI 0 / D31)
  74. *            (D 1) PB1  2|        |39  PA1 (AI 1 / D30)
  75. *       INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
  76. *        PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
  77. *        PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
  78. *       MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
  79. *       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
  80. *        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
  81. *                  RST  9|        |32  AREF
  82. *                  VCC 10|        |31  GND
  83. *                  GND 11|        |30  AVCC
  84. *                XTAL2 12|        |29  PC7 (D 23)
  85. *                XTAL1 13|        |28  PC6 (D 22)
  86. *       RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI
  87. *       TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO
  88. *  INT0 RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS
  89. *  INT1 TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK
  90. *       PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
  91. *       PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
  92. *       PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
  93. *                        +--------+
  94. *
  95. ****************************************************************************************/
  96. #elif MOTHERBOARD == 1
  97. #ifndef __AVR_ATmega644P__
  98. #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  99. #endif
  100.  
  101. #define X_STEP_PIN         15
  102. #define X_DIR_PIN          18
  103. #define X_ENABLE_PIN       19
  104. #define X_MIN_PIN          20
  105. #define X_MAX_PIN          21
  106.  
  107. #define Y_STEP_PIN         23
  108. #define Y_DIR_PIN          22
  109. #define Y_ENABLE_PIN       19
  110. #define Y_MIN_PIN          25
  111. #define Y_MAX_PIN          26
  112.  
  113. #define Z_STEP_PIN         29
  114. #define Z_DIR_PIN          30
  115. #define Z_ENABLE_PIN       31
  116. #define Z_MIN_PIN           2
  117. #define Z_MAX_PIN           1
  118.  
  119. #define E_STEP_PIN         12
  120. #define E_DIR_PIN          16
  121. #define E_ENABLE_PIN        3
  122.  
  123. #define SDPOWER          -1
  124. #define SDSS          -1
  125. #define LED_PIN             0
  126. #define FAN_PIN            -1
  127. #define PS_ON_PIN          -1
  128. #define KILL_PIN           -1
  129.  
  130. #define HEATER_0_PIN       14
  131. #define TEMP_0_PIN          4 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  132.  
  133. /*  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)  */
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. /****************************************************************************************
  141. * RepRap Motherboard  ****---NOOOOOO RS485/EXTRUDER CONTROLLER!!!!!!!!!!!!!!!!!---*******
  142. *
  143. ****************************************************************************************/
  144. #elif MOTHERBOARD == 2
  145. #ifndef __AVR_ATmega644P__
  146. #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  147. #endif
  148.  
  149. #define X_STEP_PIN      15
  150. #define X_DIR_PIN       18
  151. #define X_ENABLE_PIN    19
  152. #define X_MIN_PIN       20
  153. #define X_MAX_PIN       21
  154.  
  155. #define Y_STEP_PIN      23
  156. #define Y_DIR_PIN       22
  157. #define Y_ENABLE_PIN    24
  158. #define Y_MIN_PIN       25
  159. #define Y_MAX_PIN       26
  160.  
  161. #define Z_STEP_PINN     27
  162. #define Z_DIR_PINN      28
  163. #define Z_ENABLE_PIN    29
  164. #define Z_MIN_PIN       30
  165. #define Z_MAX_PIN       31
  166.  
  167. #define E_STEP_PIN      17
  168. #define E_DIR_PIN       16
  169. #define E_ENABLE_PIN    -1
  170.  
  171. #define SDPOWER          -1
  172. #define SDSS          4
  173. #define LED_PIN          0
  174.  
  175. #define SD_CARD_WRITE    2
  176. #define SD_CARD_DETECT   3
  177. #define SD_CARD_SELECT   4
  178.  
  179. //our RS485 pins
  180. #define TX_ENABLE_PIN   12
  181. #define RX_ENABLE_PIN   13
  182.  
  183. //pin for controlling the PSU.
  184. #define PS_ON_PIN       14
  185.  
  186. #define FAN_PIN         -1
  187. #define KILL_PIN        -1
  188.  
  189. #define HEATER_0_PIN    -1
  190. #define TEMP_0_PIN      -1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197. /****************************************************************************************
  198. * Arduino Mega pin assignment
  199. *
  200. ****************************************************************************************/
  201. #elif MOTHERBOARD == 3
  202. //////////////////FIX THIS//////////////
  203. #ifndef __AVR_ATmega1280__
  204.  #ifndef __AVR_ATmega2560__
  205.  #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
  206.  #endif
  207. #endif
  208.  
  209. #define X_STEP_PIN         26
  210. #define X_DIR_PIN          28
  211. #define X_ENABLE_PIN       24
  212. #define X_MIN_PIN           3
  213. #define X_MAX_PIN          -2    //2
  214.  
  215. #define Y_STEP_PIN         38
  216. #define Y_DIR_PIN          40
  217. #define Y_ENABLE_PIN       36
  218. #define Y_MIN_PIN          16
  219. #define Y_MAX_PIN          -1    //17
  220.  
  221. #define Z_STEP_PIN         44
  222. #define Z_DIR_PIN          46
  223. #define Z_ENABLE_PIN       42
  224. #define Z_MIN_PIN          18
  225. #define Z_MAX_PIN          -1    //19
  226.  
  227. #define E_STEP_PIN         32
  228. #define E_DIR_PIN          34
  229. #define E_ENABLE_PIN       30
  230.  
  231. #define SDPOWER            48
  232. #define SDSS               53
  233. #define LED_PIN            13
  234.  
  235. #define LED_TEMP_WAIT       4 // allume la diode bicolore de température en rouge
  236. #define LED_TEMP_READY      5 // allume la diode bicolore de température en vert
  237.  
  238. #define PS_ON_PIN          -1
  239. #define KILL_PIN           -1
  240.  
  241. // uncomment the following line for RAMPS V1.0
  242. // #define RAMPS_V_1_0
  243.  
  244. #ifdef RAMPS_V_1_0
  245.   #define HEATER_0_PIN     12    // RAMPS 1.0
  246.   #define HEATER_1_PIN     -1    // RAMPS 1.0
  247.  
  248.   #define FAN_PIN          11    // RAMPS 1.0
  249.  
  250. #else // RAMPS_V_1_1 as default
  251.   #define HEATER_0_PIN     10    // RAMPS 1.1
  252.   #define HEATER_1_PIN      8    // RAMPS 1.1
  253.  
  254.   #define FAN_PIN           9    // RAMPS 1.1
  255. #endif
  256.  
  257. #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  258. #define TEMP_1_PIN          1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  259.  
  260. // SPI for Max6675 Thermocouple
  261.  
  262. #ifndef SDSUPPORT
  263. // these pins are defined in the SD library if building with SD support  #define SCK_PIN          52
  264.   #define MISO_PIN         50
  265.   #define MOSI_PIN         51
  266.   #define MAX6675_SS       53
  267. #else
  268.   #define MAX6675_SS       49
  269. #endif
  270.  
  271.  
  272.  
  273. /****************************************************************************************
  274. * Duemilanove w/ ATMega328P pin assignment
  275. *
  276. ****************************************************************************************/
  277. #elif MOTHERBOARD == 4
  278. #ifndef __AVR_ATmega328P__
  279. #error Oops!  Make sure you have 'Arduino Duemilanove w/ ATMega328' selected from the 'Tools -> Boards' menu.
  280. #endif
  281.  
  282. #define X_STEP_PIN         19
  283. #define X_DIR_PIN          18
  284. #define X_ENABLE_PIN       -1
  285. #define X_MIN_PIN          17
  286. #define X_MAX_PIN          -1
  287.  
  288. #define Y_STEP_PIN         10
  289. #define Y_DIR_PIN           7
  290. #define Y_ENABLE_PIN       -1
  291. #define Y_MIN_PIN           8
  292. #define Y_MAX_PIN          -1
  293.  
  294. #define Z_STEP_PIN         13
  295. #define Z_DIR_PIN           3
  296. #define Z_ENABLE_PIN        2
  297. #define Z_MIN_PIN           4
  298. #define Z_MAX_PIN          -1
  299.  
  300. #define E_STEP_PIN         11
  301. #define E_DIR_PIN          12
  302. #define E_ENABLE_PIN       -1
  303.  
  304. #define SDPOWER          -1
  305. #define SDSS          -1
  306. #define LED_PIN            -1
  307. #define FAN_PIN             5
  308. #define PS_ON_PIN          -1
  309. #define KILL_PIN           -1
  310.  
  311. #define HEATER_0_PIN        6
  312. #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
  313.  
  314.  
  315.  
  316.  
  317. /****************************************************************************************
  318. * Gen6 pin assignment
  319. *
  320. ****************************************************************************************/
  321. #elif MOTHERBOARD == 5
  322.  
  323. #ifndef __AVR_ATmega644P__
  324.     #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  325. #endif
  326.  
  327. //x axis pins
  328.     #define X_STEP_PIN      15
  329.     #define X_DIR_PIN       18
  330.     #define X_ENABLE_PIN    19
  331.     #define X_MIN_PIN       20
  332.     #define X_MAX_PIN       -1
  333.    
  334.     //y axis pins
  335.     #define Y_STEP_PIN      23
  336.     #define Y_DIR_PIN       22
  337.     #define Y_ENABLE_PIN    24
  338.     #define Y_MIN_PIN       25
  339.     #define Y_MAX_PIN       -1
  340.    
  341.     //z axis pins
  342.     #define Z_STEP_PIN      27
  343.     #define Z_DIR_PIN       28
  344.     #define Z_ENABLE_PIN    29
  345.     #define Z_MIN_PIN       30
  346.     #define Z_MAX_PIN       -1
  347.    
  348.     //extruder pins
  349.     #define E_STEP_PIN      4     //Edited @ EJE Electronics 20100715
  350.     #define E_DIR_PIN       2     //Edited @ EJE Electronics 20100715
  351.     #define E_ENABLE_PIN    3     //Added @ EJE Electronics 20100715
  352.     #define TEMP_0_PIN      5     //changed @ rkoeppl 20110410
  353.     #define HEATER_0_PIN    14    //changed @ rkoeppl 20110410
  354.     #define HEATER_1_PIN    -1    //changed @ rkoeppl 20110410
  355.    
  356.    
  357.     #define SDPOWER          -1
  358.     #define SDSS          -1
  359.     #define LED_PIN         -1    //changed @ rkoeppl 20110410
  360.     #define TEMP_1_PIN      -1    //changed @ rkoeppl 20110410
  361.     #define FAN_PIN         -1    //changed @ rkoeppl 20110410
  362.     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
  363.     //our pin for debugging.
  364.    
  365.     #define DEBUG_PIN        0
  366.    
  367.     //our RS485 pins
  368.     #define TX_ENABLE_PIN   12
  369.     #define RX_ENABLE_PIN   13
  370.  
  371.  
  372. /****************************************************************************************
  373. * Sanguinololu pin assignment
  374. *
  375. ****************************************************************************************/
  376. #elif MOTHERBOARD == 6
  377. #ifndef __AVR_ATmega644P__
  378. #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
  379. #endif
  380.  
  381. #define X_STEP_PIN         15
  382. #define X_DIR_PIN          21
  383. #define X_ENABLE_PIN       -1
  384. #define X_MIN_PIN          18
  385. #define X_MAX_PIN           -2 //2
  386.  
  387. #define Y_STEP_PIN         22
  388. #define Y_DIR_PIN          23
  389. #define Y_ENABLE_PIN       -1
  390. #define Y_MIN_PIN          19
  391. #define Y_MAX_PIN          -1 //17
  392.  
  393. #define Z_STEP_PIN         3
  394. #define Z_DIR_PIN          2
  395. #define Z_ENABLE_PIN       -1
  396. #define Z_MIN_PIN          20
  397. #define Z_MAX_PIN          -1 //19
  398.  
  399. #define E_STEP_PIN         1
  400. #define E_DIR_PIN          0
  401. #define E_ENABLE_PIN       -1
  402.  
  403. #define LED_PIN            -1
  404.  
  405. #define FAN_PIN            -1 // THIS LINE FOR V1.0
  406.  
  407. #define PS_ON_PIN          -1
  408. #define KILL_PIN           -1
  409.  
  410. #define HEATER_0_PIN       13 // THIS LINE FOR V1.0 (extruder)
  411. #define HEATER_1_PIN       14 // THIS LINE FOR V1.0 (bed)
  412.  
  413. #define TEMP_0_PIN          7   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 33 extruder)
  414. #define TEMP_1_PIN          6   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
  415.  
  416. #else
  417.  
  418. #error Unknown MOTHERBOARD value in configuration.h
  419.  
  420. #endif
  421.  
  422. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement