Prusa MINI Firmware overview
pins_MEGATRONICS_3.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 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 #pragma once
23 
24 /**
25  * MegaTronics v3.0 / v3.1 / v3.2 pin assignments
26  */
27 
28 #ifndef __AVR_ATmega2560__
29  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30 #endif
31 
32 #if MB(MEGATRONICS_32)
33  #define BOARD_INFO_NAME "Megatronics v3.2"
34 #elif MB(MEGATRONICS_31)
35  #define BOARD_INFO_NAME "Megatronics v3.1"
36 #else
37  #define BOARD_INFO_NAME "Megatronics v3.0"
38 #endif
39 
40 //
41 // Servos
42 //
43 #define SERVO0_PIN 46 // AUX3-6
44 #define SERVO1_PIN 47 // AUX3-5
45 #define SERVO2_PIN 48 // AUX3-4
46 #define SERVO3_PIN 49 // AUX3-3
47 
48 //
49 // Limit Switches
50 //
51 #define X_MIN_PIN 37
52 #define X_MAX_PIN 40
53 #define Y_MIN_PIN 41
54 #define Y_MAX_PIN 38
55 #define Z_MIN_PIN 18
56 #define Z_MAX_PIN 19
57 
58 //
59 // Z Probe (when not Z_MIN_PIN)
60 //
61 #ifndef Z_MIN_PROBE_PIN
62  #define Z_MIN_PROBE_PIN 19
63 #endif
64 
65 //
66 // Steppers
67 //
68 #define X_STEP_PIN 58
69 #define X_DIR_PIN 57
70 #define X_ENABLE_PIN 59
71 
72 #define Y_STEP_PIN 5
73 #define Y_DIR_PIN 17
74 #define Y_ENABLE_PIN 4
75 
76 #define Z_STEP_PIN 16
77 #define Z_DIR_PIN 11
78 #define Z_ENABLE_PIN 3
79 
80 #define E0_STEP_PIN 28
81 #define E0_DIR_PIN 27
82 #define E0_ENABLE_PIN 29
83 
84 #define E1_STEP_PIN 25
85 #define E1_DIR_PIN 24
86 #define E1_ENABLE_PIN 26
87 
88 #define E2_STEP_PIN 22
89 #define E2_DIR_PIN 60
90 #define E2_ENABLE_PIN 23
91 
92 //
93 // Temperature Sensors
94 //
95 #if TEMP_SENSOR_0 == -1
96  #define TEMP_0_PIN 11 // Analog Input
97 #else
98  #define TEMP_0_PIN 15 // Analog Input
99 #endif
100 #if TEMP_SENSOR_1 == -1
101  #define TEMP_1_PIN 10 // Analog Input
102 #else
103  #define TEMP_1_PIN 13 // Analog Input
104 #endif
105 #if TEMP_SENSOR_2 == -1
106  #define TEMP_2_PIN 9 // Analog Input
107 #else
108  #define TEMP_2_PIN 12 // Analog Input
109 #endif
110 #if TEMP_SENSOR_BED == -1
111  #define TEMP_BED_PIN 8 // Analog Input
112 #else
113  #define TEMP_BED_PIN 14 // Analog Input
114 #endif
115 
116 //
117 // Heaters / Fans
118 //
119 #define HEATER_0_PIN 2
120 #define HEATER_1_PIN 9
121 #define HEATER_2_PIN 8
122 #define HEATER_BED_PIN 10
123 
124 #ifndef FAN_PIN
125  #define FAN_PIN 6
126 #endif
127 #define FAN1_PIN 7
128 
129 //
130 // Misc. Functions
131 //
132 #define SDSS 53
133 #define LED_PIN 13
134 #define PS_ON_PIN 12
135 #define CASE_LIGHT_PIN 45 // Try the keypad connector
136 
137 //
138 // LCD / Controller
139 //
140 #define BEEPER_PIN 61
141 
142 #define BTN_EN1 44
143 #define BTN_EN2 45
144 #define BTN_ENC 33
145 
146 #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
147 
148  #define LCD_PINS_RS 56 // CS chip select / SS chip slave select
149  #define LCD_PINS_ENABLE 51 // SID (MOSI)
150  #define LCD_PINS_D4 52 // SCK (CLK) clock
151  #define SD_DETECT_PIN 35
152 
153 #else
154 
155  #define LCD_PINS_RS 32
156  #define LCD_PINS_ENABLE 31
157  #define LCD_PINS_D4 14
158  #define LCD_PINS_D5 30
159  #define LCD_PINS_D6 39
160  #define LCD_PINS_D7 15
161 
162  #define SHIFT_CLK 43
163  #define SHIFT_LD 35
164  #define SHIFT_OUT 34
165  #define SHIFT_EN 44
166 
167  #if MB(MEGATRONICS_31, MEGATRONICS_32)
168  #define SD_DETECT_PIN 56
169  #endif
170 
171 #endif
172 
173 //
174 // M3/M4/M5 - Spindle/Laser Control
175 //
176 #if DISABLED(REPRAPWORLD_KEYPAD) // try to use the keypad connector first
177  #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
178  #define SPINDLE_LASER_ENA_PIN 43 // Pullup!
179  #define SPINDLE_DIR_PIN 42
180 #elif EXTRUDERS <= 2
181  // Hijack the last extruder so that we can get the PWM signal off the Y breakout
182  // Move Y to the E2 plug. This makes dual Y steppers harder
183  #undef Y_ENABLE_PIN // 4
184  #undef Y_STEP_PIN // 5
185  #undef Y_DIR_PIN // 17
186  #undef E2_ENABLE_PIN // 23
187  #undef E2_STEP_PIN // 22
188  #undef E2_DIR_PIN // 60
189  #define Y_ENABLE_PIN 23
190  #define Y_STEP_PIN 22
191  #define Y_DIR_PIN 60
192  #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM
193  #define SPINDLE_LASER_ENA_PIN 17 // Pullup!
194  #define SPINDLE_DIR_PIN 5
195 #endif