Subversion Repositories MK-Marlin

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ron 1
/**
2
 * Marlin 3D Printer Firmware
3
 * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
 *
5
 * Based on Sprinter and grbl.
6
 * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
 
23
/**
24
 * MegaTronics v3.0 / v3.1 pin assignments
25
 */
26
 
27
#ifndef __AVR_ATmega2560__
28
  #error "Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
29
#endif
30
 
31
#if MB(MEGATRONICS_31)
32
  #define BOARD_NAME "Megatronics v3.1"
33
#else
34
  #define BOARD_NAME "Megatronics v3.0"
35
#endif
36
 
37
//
38
// Servos
39
//
40
#define SERVO0_PIN         46   // AUX3-6
41
#define SERVO1_PIN         47   // AUX3-5
42
#define SERVO2_PIN         48   // AUX3-4
43
#define SERVO3_PIN         49   // AUX3-3
44
 
45
//
46
// Limit Switches
47
//
48
#define X_MIN_PIN          37
49
#define X_MAX_PIN          40
50
#define Y_MIN_PIN          41
51
#define Y_MAX_PIN          38
52
#define Z_MIN_PIN          18
53
#define Z_MAX_PIN          19
54
 
55
//
56
// Z Probe (when not Z_MIN_PIN)
57
//
58
#ifndef Z_MIN_PROBE_PIN
59
  #define Z_MIN_PROBE_PIN  19
60
#endif
61
 
62
//
63
// Steppers
64
//
65
#define X_STEP_PIN         58
66
#define X_DIR_PIN          57
67
#define X_ENABLE_PIN       59
68
 
69
#define Y_STEP_PIN          5
70
#define Y_DIR_PIN          17
71
#define Y_ENABLE_PIN        4
72
 
73
#define Z_STEP_PIN         16
74
#define Z_DIR_PIN          11
75
#define Z_ENABLE_PIN        3
76
 
77
#define E0_STEP_PIN        28
78
#define E0_DIR_PIN         27
79
#define E0_ENABLE_PIN      29
80
 
81
#define E1_STEP_PIN        25
82
#define E1_DIR_PIN         24
83
#define E1_ENABLE_PIN      26
84
 
85
#define E2_STEP_PIN        22
86
#define E2_DIR_PIN         60
87
#define E2_ENABLE_PIN      23
88
 
89
//
90
// Temperature Sensors
91
//
92
#if TEMP_SENSOR_0 == -1
93
  #define TEMP_0_PIN       11   // Analog Input
94
#else
95
  #define TEMP_0_PIN       15   // Analog Input
96
#endif
97
#if TEMP_SENSOR_1 == -1
98
  #define TEMP_1_PIN       10   // Analog Input
99
#else
100
  #define TEMP_1_PIN       13   // Analog Input
101
#endif
102
#if TEMP_SENSOR_2 == -1
103
  #define TEMP_2_PIN        9   // Analog Input
104
#else
105
  #define TEMP_2_PIN       12   // Analog Input
106
#endif
107
#if TEMP_SENSOR_BED == -1
108
  #define TEMP_BED_PIN      8   // Analog Input
109
#else
110
  #define TEMP_BED_PIN     14   // Analog Input
111
#endif
112
 
113
//
114
// Heaters / Fans
115
//
116
#define HEATER_0_PIN        2
117
#define HEATER_1_PIN        9
118
#define HEATER_2_PIN        8
119
#define HEATER_BED_PIN     10
120
 
121
#ifndef FAN_PIN
122
  #define FAN_PIN           6
123
#endif
124
#define FAN1_PIN            7
125
 
126
//
127
// Misc. Functions
128
//
129
#define SDSS               53
130
#define LED_PIN            13
131
#define PS_ON_PIN          12
132
#define CASE_LIGHT_PIN     45   // Try the keypad connector
133
 
134
//
135
// LCD / Controller
136
//
137
#define BEEPER_PIN         61
138
 
139
#define BTN_EN1            44
140
#define BTN_EN2            45
141
#define BTN_ENC            33
142
 
143
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
144
 
145
  #define LCD_PINS_RS      56   // CS chip select / SS chip slave select
146
  #define LCD_PINS_ENABLE  51   // SID (MOSI)
147
  #define LCD_PINS_D4      52   // SCK (CLK) clock
148
  #define SD_DETECT_PIN    35
149
 
150
#else
151
 
152
  #define LCD_PINS_RS      32
153
  #define LCD_PINS_ENABLE  31
154
  #define LCD_PINS_D4      14
155
  #define LCD_PINS_D5      30
156
  #define LCD_PINS_D6      39
157
  #define LCD_PINS_D7      15
158
 
159
  #define SHIFT_CLK        43
160
  #define SHIFT_LD         35
161
  #define SHIFT_OUT        34
162
  #define SHIFT_EN         44
163
 
164
  #if MB(MEGATRONICS_31)
165
    #define SD_DETECT_PIN  56
166
  #endif
167
 
168
#endif
169
 
170
//
171
// M3/M4/M5 - Spindle/Laser Control
172
//
173
#if DISABLED(REPRAPWORLD_KEYPAD)        // try to use the keypad connector first
174
  #define SPINDLE_LASER_PWM_PIN    44   // MUST BE HARDWARE PWM
175
  #define SPINDLE_LASER_ENABLE_PIN 43   // Pin should have a pullup!
176
  #define SPINDLE_DIR_PIN          42
177
#elif EXTRUDERS <= 2
178
  // Hijack the last extruder so that we can get the PWM signal off the Y breakout
179
  // Move Y to the E2 plug. This makes dual Y steppers harder
180
  #undef Y_ENABLE_PIN  //  4
181
  #undef Y_STEP_PIN    //  5
182
  #undef Y_DIR_PIN     // 17
183
  #undef E2_ENABLE_PIN // 23
184
  #undef E2_STEP_PIN   // 22
185
  #undef E2_DIR_PIN    // 60
186
  #define Y_ENABLE_PIN             23
187
  #define Y_STEP_PIN               22
188
  #define Y_DIR_PIN                60
189
  #define SPINDLE_LASER_PWM_PIN     4   // MUST BE HARDWARE PWM
190
  #define SPINDLE_LASER_ENABLE_PIN 17   // Pin should have a pullup!
191
  #define SPINDLE_DIR_PIN           5
192
#endif