Repetier-Firmware 0.2
Repetier/pins.h
Go to the documentation of this file.
00001 #ifndef PINS_H
00002 #define PINS_H
00003 
00004 /****************************************************************************************
00005 * Arduino pin assignment
00006 *
00007 *                  ATMega168
00008 *                   +-\/-+
00009 *             PC6  1|    |28  PC5 (AI 5 / D19)
00010 *       (D 0) PD0  2|    |27  PC4 (AI 4 / D18)
00011 *       (D 1) PD1  3|    |26  PC3 (AI 3 / D17)
00012 *       (D 2) PD2  4|    |25  PC2 (AI 2 / D16)
00013 *  PWM+ (D 3) PD3  5|    |24  PC1 (AI 1 / D15)
00014 *       (D 4) PD4  6|    |23  PC0 (AI 0 / D14)
00015 *             VCC  7|    |22  GND
00016 *             GND  8|    |21  AREF
00017 *             PB6  9|    |20  AVCC
00018 *             PB7 10|    |19  PB5 (D 13)
00019 *  PWM+ (D 5) PD5 11|    |18  PB4 (D 12)
00020 *  PWM+ (D 6) PD6 12|    |17  PB3 (D 11) PWM
00021 *       (D 7) PD7 13|    |16  PB2 (D 10) PWM
00022 *       (D 8) PB0 14|    |15  PB1 (D 9)  PWM
00023 *                   +----+
00024 ****************************************************************************************/
00025 #if MOTHERBOARD == 0
00026 #define KNOWN_BOARD 1
00027 
00028 #ifndef __AVR_ATmega168__
00029 #error Oops!  Make sure you have 'Arduino Diecimila' selected from the boards menu.
00030 #endif
00031 
00032 #define X_STEP_PIN          2
00033 #define X_DIR_PIN           3
00034 #define X_ENABLE_PIN       -1
00035 #define X_MIN_PIN           4
00036 #define X_MAX_PIN           9
00037 
00038 #define Y_STEP_PIN         10
00039 #define Y_DIR_PIN           7
00040 #define Y_ENABLE_PIN       -1
00041 #define Y_MIN_PIN           8
00042 #define Y_MAX_PIN          13
00043 
00044 #define Z_STEP_PIN         19
00045 #define Z_DIR_PIN          18
00046 #define Z_ENABLE_PIN        5
00047 #define Z_MIN_PIN          17
00048 #define Z_MAX_PIN          16
00049 
00050 #define E_STEP_PIN         11
00051 #define E_DIR_PIN          12
00052 #define E_ENABLE_PIN       -1
00053 
00054 #define SDPOWER          -1
00055 #define SDSS          -1
00056 #define LED_PIN            -1
00057 #define FAN_PIN            -1
00058 #define PS_ON_PIN          15
00059 #define KILL_PIN           -1
00060 
00061 #define HEATER_0_PIN        6
00062 #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00063 
00064 
00065 #endif
00066 
00067 
00068 
00069 /****************************************************************************************
00070 * Sanguino/RepRap Motherboard with direct-drive extruders
00071 *
00072 *                        ATMega644P
00073 *
00074 *                        +---\/---+
00075 *            (D 0) PB0  1|        |40  PA0 (AI 0 / D31)
00076 *            (D 1) PB1  2|        |39  PA1 (AI 1 / D30)
00077 *       INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
00078 *        PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
00079 *        PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
00080 *       MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
00081 *       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
00082 *        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
00083 *                  RST  9|        |32  AREF
00084 *                  VCC 10|        |31  GND 
00085 *                  GND 11|        |30  AVCC
00086 *                XTAL2 12|        |29  PC7 (D 23)
00087 *                XTAL1 13|        |28  PC6 (D 22)
00088 *       RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI
00089 *       TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO
00090 *  INT0 RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS
00091 *  INT1 TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK
00092 *       PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
00093 *       PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
00094 *       PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
00095 *                        +--------+
00096 *
00097 ****************************************************************************************/
00098 #if MOTHERBOARD == 1
00099 #define KNOWN_BOARD 1
00100 
00101 #ifndef __AVR_ATmega644P__
00102 #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
00103 #endif
00104 
00105 #define X_STEP_PIN         15
00106 #define X_DIR_PIN          18
00107 #define X_ENABLE_PIN       19
00108 #define X_MIN_PIN          20
00109 #define X_MAX_PIN          21
00110 
00111 #define Y_STEP_PIN         23
00112 #define Y_DIR_PIN          22
00113 #define Y_ENABLE_PIN       19
00114 #define Y_MIN_PIN          25
00115 #define Y_MAX_PIN          26
00116 
00117 #define Z_STEP_PIN         29
00118 #define Z_DIR_PIN          30
00119 #define Z_ENABLE_PIN       31
00120 #define Z_MIN_PIN           2
00121 #define Z_MAX_PIN           1
00122 
00123 #define E_STEP_PIN         12
00124 #define E_DIR_PIN          16
00125 #define E_ENABLE_PIN        3
00126 
00127 #define SDPOWER          -1
00128 #define SDSS          -1
00129 #define LED_PIN             0
00130 #define FAN_PIN            -1
00131 #define PS_ON_PIN          -1
00132 #define KILL_PIN           -1
00133 
00134 #define HEATER_0_PIN       14
00135 #define TEMP_0_PIN          4 //D27   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00136 
00137 /*  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)  */
00138 
00139 
00140 
00141 #endif
00142 
00143 
00144 /****************************************************************************************
00145 * RepRap Motherboard  ****---NOOOOOO RS485/EXTRUDER CONTROLLER!!!!!!!!!!!!!!!!!---*******
00146 *
00147 ****************************************************************************************/
00148 #if MOTHERBOARD == 2
00149 #define KNOWN_BOARD 1
00150 
00151 #ifndef __AVR_ATmega644P__
00152 #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
00153 #endif
00154 
00155 #define X_STEP_PIN      15
00156 #define X_DIR_PIN       18
00157 #define X_ENABLE_PIN    19
00158 #define X_MIN_PIN       20
00159 #define X_MAX_PIN       21
00160 
00161 #define Y_STEP_PIN      23
00162 #define Y_DIR_PIN       22
00163 #define Y_ENABLE_PIN    24
00164 #define Y_MIN_PIN       25
00165 #define Y_MAX_PIN       26
00166 
00167 #define Z_STEP_PINN     27
00168 #define Z_DIR_PINN      28
00169 #define Z_ENABLE_PIN    29
00170 #define Z_MIN_PIN       30
00171 #define Z_MAX_PIN       31
00172 
00173 #define E_STEP_PIN      17
00174 #define E_DIR_PIN       16
00175 #define E_ENABLE_PIN    -1
00176 
00177 #define SDPOWER          -1
00178 #define SDSS          4
00179 #define LED_PIN          0
00180 
00181 #define SD_CARD_WRITE    2
00182 #define SD_CARD_DETECT   3
00183 #define SD_CARD_SELECT   4
00184 
00185 //our RS485 pins
00186 #define TX_ENABLE_PIN   12
00187 #define RX_ENABLE_PIN   13
00188 
00189 //pin for controlling the PSU.
00190 #define PS_ON_PIN       14
00191 
00192 #define FAN_PIN         -1
00193 #define KILL_PIN        -1
00194 
00195 #define HEATER_0_PIN    -1
00196 #define TEMP_0_PIN      -1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00197 
00198 
00199 
00200 
00201 #endif
00202 
00203 /****************************************************************************************
00204 * Arduino Mega pin assignment
00205 *
00206 ****************************************************************************************/
00207 #if MOTHERBOARD == 33
00208 #define MOTHERBOARD 3
00209 #define RAMPS_V_1_3
00210 #endif
00211 #if MOTHERBOARD == 3
00212 #define KNOWN_BOARD 1
00213 
00215 #ifndef __AVR_ATmega1280__
00216  #ifndef __AVR_ATmega2560__
00217  #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
00218  #endif
00219 #endif
00220 
00221 // uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
00222 // #define RAMPS_V_1_3
00223 // #define RAMPS_V_1_0
00224 
00225 #ifdef RAMPS_V_1_3
00226 
00227 #define X_STEP_PIN         54
00228 #define X_DIR_PIN          55
00229 #define X_ENABLE_PIN       38
00230 #define X_MIN_PIN           3
00231 #define X_MAX_PIN          -1   //2 //Max endstops default to disabled "-1", set to commented value to enable.
00232 
00233 #define Y_STEP_PIN         60
00234 #define Y_DIR_PIN          61
00235 #define Y_ENABLE_PIN       56
00236 #define Y_MIN_PIN          14
00237 #define Y_MAX_PIN          -1   //15
00238 
00239 #define Z_STEP_PIN         46
00240 #define Z_DIR_PIN          48
00241 #define Z_ENABLE_PIN       62
00242 #define Z_MIN_PIN          18
00243 #define Z_MAX_PIN          -1   //19
00244 
00245 #define E_STEP_PIN         26
00246 #define E_DIR_PIN          28
00247 #define E_ENABLE_PIN       24
00248 
00249 #define E_1_STEP_PIN         36
00250 #define E_1_DIR_PIN          34
00251 #define E_1_ENABLE_PIN       30
00252 
00253 #define SDPOWER            -1
00254 #define SDSS               53
00255 #define LED_PIN            13
00256 #define FAN_PIN            9
00257 #define PS_ON_PIN          12
00258 #define KILL_PIN           -1
00259 
00260 #define HEATER_0_PIN       10
00261 #define HEATER_1_PIN       8
00262 #define TEMP_0_PIN         13   // ANALOG NUMBERING
00263 #define TEMP_1_PIN         14   // ANALOG NUMBERING
00264 
00265 
00266 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default
00267 
00268 #define X_STEP_PIN         26
00269 #define X_DIR_PIN          28
00270 #define X_ENABLE_PIN       24
00271 #define X_MIN_PIN           3
00272 #define X_MAX_PIN          -1    //2
00273 
00274 #define Y_STEP_PIN         38
00275 #define Y_DIR_PIN          40
00276 #define Y_ENABLE_PIN       36
00277 #define Y_MIN_PIN          16
00278 #define Y_MAX_PIN          -1    //17
00279 
00280 #define Z_STEP_PIN         44
00281 #define Z_DIR_PIN          46
00282 #define Z_ENABLE_PIN       42
00283 #define Z_MIN_PIN          18
00284 #define Z_MAX_PIN          -1    //19
00285 
00286 #define E_STEP_PIN         32
00287 #define E_DIR_PIN          34
00288 #define E_ENABLE_PIN       30
00289 
00290 #define SDPOWER            48
00291 #define SDSS               53
00292 #define LED_PIN            13
00293 #define PS_ON_PIN          -1
00294 #define KILL_PIN           -1
00295 
00296 
00297 
00298 #ifdef RAMPS_V_1_0 // RAMPS_V_1_0
00299   #define HEATER_0_PIN     12    // RAMPS 1.0
00300   #define HEATER_1_PIN     -1    // RAMPS 1.0
00301   #define FAN_PIN          11    // RAMPS 1.0
00302 
00303 #else // RAMPS_V_1_1 or RAMPS_V_1_2
00304   #define HEATER_0_PIN     10    // RAMPS 1.1
00305   #define HEATER_1_PIN      8    // RAMPS 1.1
00306   #define FAN_PIN           9    // RAMPS 1.1
00307 #endif
00308 
00309 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00310 #define TEMP_1_PIN          1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00311 #endif
00312 
00313 // SPI for Max6675 Thermocouple 
00314 
00315 #ifndef SDSUPPORT
00316 // these pins are defined in the SD library if building with SD support  #define SCK_PIN          52
00317   #define MISO_PIN         50
00318   #define MOSI_PIN         51
00319   #define MAX6675_SS       53
00320 #else
00321   #define MAX6675_SS       49
00322 #endif
00323 
00324 
00325 #endif
00326 /****************************************************************************************
00327 * Duemilanove w/ ATMega328P pin assignment
00328 *
00329 ****************************************************************************************/
00330 #if MOTHERBOARD == 4
00331 #define KNOWN_BOARD 1
00332 
00333 #ifndef __AVR_ATmega328P__
00334 #error Oops!  Make sure you have 'Arduino Duemilanove w/ ATMega328' selected from the 'Tools -> Boards' menu.
00335 #endif
00336 
00337 #define X_STEP_PIN         19
00338 #define X_DIR_PIN          18
00339 #define X_ENABLE_PIN       -1
00340 #define X_MIN_PIN          17
00341 #define X_MAX_PIN          -1
00342 
00343 #define Y_STEP_PIN         10
00344 #define Y_DIR_PIN           7
00345 #define Y_ENABLE_PIN       -1
00346 #define Y_MIN_PIN           8
00347 #define Y_MAX_PIN          -1
00348 
00349 #define Z_STEP_PIN         13
00350 #define Z_DIR_PIN           3
00351 #define Z_ENABLE_PIN        2
00352 #define Z_MIN_PIN           4
00353 #define Z_MAX_PIN          -1
00354 
00355 #define E_STEP_PIN         11
00356 #define E_DIR_PIN          12
00357 #define E_ENABLE_PIN       -1
00358 
00359 #define SDPOWER          -1
00360 #define SDSS          -1
00361 #define LED_PIN            -1
00362 #define FAN_PIN             5
00363 #define PS_ON_PIN          -1
00364 #define KILL_PIN           -1
00365 
00366 #define HEATER_0_PIN        6
00367 #define TEMP_0_PIN          0    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
00368 
00369 
00370 #endif
00371 
00372 /****************************************************************************************
00373 * Gen6 pin assignment
00374 *
00375 ****************************************************************************************/
00376 #if MOTHERBOARD == 5
00377 #define KNOWN_BOARD 1
00378 
00379 #ifndef __AVR_ATmega644P__
00380     #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
00381 #endif
00382 
00383 //x axis pins
00384     #define X_STEP_PIN      15
00385     #define X_DIR_PIN       18
00386     #define X_ENABLE_PIN    19
00387     #define X_MIN_PIN       20
00388     #define X_MAX_PIN       -1
00389     
00390     //y axis pins
00391     #define Y_STEP_PIN      23
00392     #define Y_DIR_PIN       22
00393     #define Y_ENABLE_PIN    24
00394     #define Y_MIN_PIN       25
00395     #define Y_MAX_PIN       -1
00396     
00397     //z axis pins
00398     #define Z_STEP_PIN      27
00399     #define Z_DIR_PIN       28
00400     #define Z_ENABLE_PIN    29
00401     #define Z_MIN_PIN       30
00402     #define Z_MAX_PIN       -1
00403     
00404     //extruder pins
00405     #define E_STEP_PIN      4     //Edited @ EJE Electronics 20100715
00406     #define E_DIR_PIN       2     //Edited @ EJE Electronics 20100715
00407     #define E_ENABLE_PIN    3     //Added @ EJE Electronics 20100715
00408     #define TEMP_0_PIN      5     //changed @ rkoeppl 20110410
00409     #define HEATER_0_PIN    14    //changed @ rkoeppl 20110410
00410     #define HEATER_1_PIN    -1    //changed @ rkoeppl 20110410
00411     
00412     
00413     #define SDPOWER          -1
00414     #define SDSS          17
00415     #define LED_PIN         -1    //changed @ rkoeppl 20110410
00416     #define TEMP_1_PIN      -1    //changed @ rkoeppl 20110410
00417     #define FAN_PIN         -1    //changed @ rkoeppl 20110410
00418     #define PS_ON_PIN       -1    //changed @ rkoeppl 20110410
00419     //our pin for debugging.
00420     
00421     #define DEBUG_PIN        0
00422     
00423     //our RS485 pins
00424     #define TX_ENABLE_PIN       12
00425     #define RX_ENABLE_PIN       13
00426 
00427 #endif
00428 /****************************************************************************************
00429 * Sanguinololu pin assignment
00430 *
00431 ****************************************************************************************/
00432 #if MOTHERBOARD == 62
00433 #define MOTHERBOARD 6
00434 #define SANGUINOLOLU_V_1_2 
00435 #endif
00436 #if MOTHERBOARD == 6
00437 #define KNOWN_BOARD 1
00438 #ifndef __AVR_ATmega644P__
00439 #error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
00440 #endif
00441 
00442 #define X_STEP_PIN         15
00443 #define X_DIR_PIN          21
00444 #define X_MIN_PIN          18
00445 #define X_MAX_PIN           -2
00446 
00447 #define Y_STEP_PIN         22
00448 #define Y_DIR_PIN          23
00449 #define Y_MIN_PIN          19
00450 #define Y_MAX_PIN          -1
00451 
00452 #define Z_STEP_PIN         3
00453 #define Z_DIR_PIN          2
00454 #define Z_MIN_PIN          20
00455 #define Z_MAX_PIN          -1
00456 
00457 #define E_STEP_PIN         1
00458 #define E_DIR_PIN          0
00459 
00460 #define LED_PIN            -1
00461 
00462 #define FAN_PIN            -1 
00463 
00464 #define PS_ON_PIN          -1
00465 #define KILL_PIN           -1
00466 
00467 #define HEATER_0_PIN       13 // (extruder)
00468 
00469 #ifdef SANGUINOLOLU_V_1_2
00470 
00471 #define HEATER_1_PIN       12 // (bed)
00472 #define X_ENABLE_PIN       14
00473 #define Y_ENABLE_PIN       14
00474 #define Z_ENABLE_PIN       26
00475 #define E_ENABLE_PIN       14
00476 
00477 #else
00478 
00479 #define HEATER_1_PIN       14  // (bed)
00480 #define X_ENABLE_PIN       -1
00481 #define Y_ENABLE_PIN       -1
00482 #define Z_ENABLE_PIN       -1
00483 #define E_ENABLE_PIN       -1
00484 
00485 #endif
00486 
00487 #define TEMP_0_PIN          7   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 33 extruder)
00488 #define TEMP_1_PIN          6   // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
00489 #define SDPOWER          -1
00490 #define SDSS          31
00491 
00492 #ifndef KNOWN_BOARD
00493 #error Unknown MOTHERBOARD value in configuration.h
00494 #endif
00495 
00496 #endif
00497 
00498 #endif
 All Data Structures Files Functions Variables Typedefs Friends Defines