|
@@ -0,0 +1,207 @@
|
|
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
|
+ * Arduino DUE Shield Kit (ADSK) pin assignments
|
|
25
|
+ */
|
|
26
|
+
|
|
27
|
+#define BOARD_NAME "ADSK"
|
|
28
|
+
|
|
29
|
+#if !defined(__SAM3X8E__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
|
|
30
|
+ #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
|
|
31
|
+#endif
|
|
32
|
+
|
|
33
|
+/* CNC shield modifications:
|
|
34
|
+FROM THE BOTTOM CUT THE 5V PIN THAT GOES TO ARDUINO!!!
|
|
35
|
+On the top put jumper between 5V and 3V3 pins,
|
|
36
|
+ jumper between D12 and A.STEP, jumper between D13 and A.DIR
|
|
37
|
+*/
|
|
38
|
+
|
|
39
|
+/* CNC shield 3D printer connections:
|
|
40
|
+X,Y,Z steppers as normal
|
|
41
|
+A stepper for E0 extruder
|
|
42
|
+(X-)&(GND) - X limit
|
|
43
|
+(Y-)&(GND) - Y limit
|
|
44
|
+(Z-)&(GND) - Z limit
|
|
45
|
+(Abort)&(GND) - Extruder thermistor (also require pullup resistor 4.7K between "Abort" and
|
|
46
|
+ Vcc (now "5V" on the board but actual 3.3V because of jumper))
|
|
47
|
+(Hold)&(GND) - Bed thermistor (also require pullup resistor 4.7K between "Hold" and
|
|
48
|
+ Vcc (now "5V" on the board but actual 3.3V because of jumper))
|
|
49
|
+(CoolEn) - 3.3v signal to controll extruder heater MOSFET
|
|
50
|
+(Resume) - 3.3v signal to control heatbed MOSFET
|
|
51
|
+(SDA) - 3.3v signal to controll extruder fan
|
|
52
|
+(SCL) - 3.3v signal to controll extruder cooling fan
|
|
53
|
+*/
|
|
54
|
+
|
|
55
|
+/* CNC Shield pinout
|
|
56
|
+"Name on the board": DUE pin
|
|
57
|
+"Abort": Analog pin 0 or Digital pin 54
|
|
58
|
+"Hold": Analog pin 1 or Digital pin 55
|
|
59
|
+"Resume": Analog pin 2 or Digital pin 56
|
|
60
|
+"CoolEn": Analog pin 3 or Digital pin 57
|
|
61
|
+"SDA": Analog pin 4 or Digital pin 58
|
|
62
|
+"SCL": Analog pin 5 or Digital pin 59
|
|
63
|
+"E-STOP": Reset pin
|
|
64
|
+"RX": Digital pin 0
|
|
65
|
+"TX": Digital pin 1
|
|
66
|
+"X.STEP": Digital pin 2
|
|
67
|
+"Y.STEP": Digital pin 3
|
|
68
|
+"Z.STEP": Digital pin 4
|
|
69
|
+"X.DIR": Digital pin 5
|
|
70
|
+"Y.DIR": Digital pin 6
|
|
71
|
+"Z.DIR": Digital pin 7
|
|
72
|
+"EN": Digital pin 8
|
|
73
|
+"X+","X-": Digital pin 9
|
|
74
|
+"Y+","Y-": Digital pin 10
|
|
75
|
+"Z+","Z-": Digital pin 11
|
|
76
|
+"SpinEn": Digital pin 12 -> will be connected to A.STEP with jumper
|
|
77
|
+"SpinDir": Digital pin 13 -> will be connected to A.DIR with jumper
|
|
78
|
+*/
|
|
79
|
+
|
|
80
|
+//
|
|
81
|
+// Servos
|
|
82
|
+//
|
|
83
|
+#define SERVO0_PIN 61 // Analog pin 7, Digital pin 61
|
|
84
|
+
|
|
85
|
+//
|
|
86
|
+// Limit Switches
|
|
87
|
+//
|
|
88
|
+#define X_MIN_PIN 9
|
|
89
|
+#define Y_MIN_PIN 10
|
|
90
|
+#define Z_MIN_PIN 11
|
|
91
|
+
|
|
92
|
+#define Z_MIN_PROBE_PIN 62 // Analog pin 8, Digital pin 62
|
|
93
|
+
|
|
94
|
+//
|
|
95
|
+// Steppers
|
|
96
|
+//
|
|
97
|
+#define X_STEP_PIN 2
|
|
98
|
+#define X_DIR_PIN 5
|
|
99
|
+#define X_ENABLE_PIN 8
|
|
100
|
+
|
|
101
|
+#define Y_STEP_PIN 3
|
|
102
|
+#define Y_DIR_PIN 6
|
|
103
|
+#define Y_ENABLE_PIN 8
|
|
104
|
+
|
|
105
|
+#define Z_STEP_PIN 4
|
|
106
|
+#define Z_DIR_PIN 7
|
|
107
|
+#define Z_ENABLE_PIN 8
|
|
108
|
+
|
|
109
|
+#define E0_STEP_PIN 12
|
|
110
|
+#define E0_DIR_PIN 13
|
|
111
|
+#define E0_ENABLE_PIN 8
|
|
112
|
+
|
|
113
|
+//
|
|
114
|
+// Heaters / Fans
|
|
115
|
+//
|
|
116
|
+#define HEATER_0_PIN 55 // "Hold": Analog pin 1, Digital pin 55
|
|
117
|
+#define HEATER_BED_PIN 57 // "CoolEn": Analog pin 3, Digital pin 57
|
|
118
|
+#define FAN_PIN 54 // "Abort": Analog pin 0, Digital pin 54
|
|
119
|
+#undef E0_AUTO_FAN_PIN
|
|
120
|
+#define E0_AUTO_FAN_PIN 56 // "Resume": Analog pin 2, Digital pin 56
|
|
121
|
+
|
|
122
|
+//
|
|
123
|
+// Temperature Sensors
|
|
124
|
+//
|
|
125
|
+#define TEMP_0_PIN 4 // "SDA": Analog pin 4, Digital pin 58
|
|
126
|
+#define TEMP_BED_PIN 5 // "SCL": Analog pin 5, Digital pin 59
|
|
127
|
+
|
|
128
|
+//
|
|
129
|
+// Misc. Functions
|
|
130
|
+//
|
|
131
|
+#define SDSS 52
|
|
132
|
+
|
|
133
|
+#if ENABLED(ZONESTAR_LCD)
|
|
134
|
+
|
|
135
|
+ /**
|
|
136
|
+ * The 2004 LCD should be powered with 5V.
|
|
137
|
+ * The next LCD pins RS,D4,D5,D6,D7 have internal pull-ups to 5V and as result the 5V will be on these pins.
|
|
138
|
+ * Luckily these internal pull-ups have really high resistance and adding 33K pull-down resistors will create
|
|
139
|
+ * simple voltage divider that will bring the voltage down just slightly bellow 3.3V.
|
|
140
|
+ *
|
|
141
|
+ * This LCD also has buttons that connected to the same ADC pin with different voltage divider combinations.
|
|
142
|
+ * On the LCD panel there is internal pull-up resistor of the 4.7K connected to 5V.
|
|
143
|
+ * Connecting another 4.7K pull-down resistor between ADC pin and the GND
|
|
144
|
+ * will result in scaled values for voltage dividers and will bring them down to be always below 3.3V.
|
|
145
|
+ *
|
|
146
|
+ * For 2004 LCD to work with 3.3V board like Arduino DUE the next required:
|
|
147
|
+ * Pull-down resistors of 33K between each of LCD pins RS,D4,D5,D6,D7 and the GND.
|
|
148
|
+ * Pull-down resistor of 4.7K between ADC_KEYPAD_PIN and the GND
|
|
149
|
+ *
|
|
150
|
+ * All these modifications will still work with 5V based boards but require proper scaled ADC values
|
|
151
|
+ */
|
|
152
|
+
|
|
153
|
+ #ifdef __SAM3X8E__
|
|
154
|
+ #define AREF_VOLTS 3.3
|
|
155
|
+ #else
|
|
156
|
+ #define AREF_VOLTS 5.0
|
|
157
|
+ #endif
|
|
158
|
+
|
|
159
|
+ //
|
|
160
|
+ // LCD / Controller
|
|
161
|
+ //
|
|
162
|
+ #define LCD_PINS_ENABLE 14
|
|
163
|
+ #define LCD_PINS_RS 15
|
|
164
|
+ #define LCD_PINS_D4 16
|
|
165
|
+ #define LCD_PINS_D5 17
|
|
166
|
+ #define LCD_PINS_D6 18
|
|
167
|
+ #define LCD_PINS_D7 19
|
|
168
|
+ #define ADC_KEYPAD_PIN 6 //60 // Analog pin 6, Digital pin 60
|
|
169
|
+
|
|
170
|
+ /**
|
|
171
|
+ * The below defines will scale all the values to work properly on both
|
|
172
|
+ * 5V (Mega) and 3.3V (DUE) boards with all pull-up resistors added for 3.3V
|
|
173
|
+ */
|
|
174
|
+
|
|
175
|
+ #define ADC_BUTTONS_VALUE_SCALE (5.0/AREF_VOLTS) // The LCD module pullup voltage is 5.0V but ADC reference voltage is 3.3V
|
|
176
|
+
|
|
177
|
+ #define ADC_BUTTONS_R_PULLDOWN 4.7 // Moves voltage down to be bellow 3.3V instead of 5V
|
|
178
|
+ // the resistors values will be scaled because of 4.7K pulldown parallel resistor
|
|
179
|
+ #define _ADC_BUTTONS_R_SCALED(R) ((R) * (ADC_BUTTONS_R_PULLDOWN) / ((R) + ADC_BUTTONS_R_PULLDOWN))
|
|
180
|
+
|
|
181
|
+ // buttons pullup resistor
|
|
182
|
+ #define ADC_BUTTONS_R_PULLUP 4.7 // the resistor on the 2004 LCD panel
|
|
183
|
+ // buttons resistors with scaled values because of parallel pulldown resistor
|
|
184
|
+ #define ADC_BUTTONS_LEFT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(0.47)
|
|
185
|
+ #define ADC_BUTTONS_RIGHT_R_PULLDOWN _ADC_BUTTONS_R_SCALED(4.7)
|
|
186
|
+ #define ADC_BUTTONS_UP_R_PULLDOWN _ADC_BUTTONS_R_SCALED(1.0)
|
|
187
|
+ #define ADC_BUTTONS_DOWN_R_PULLDOWN _ADC_BUTTONS_R_SCALED(10.0)
|
|
188
|
+ #define ADC_BUTTONS_MIDDLE_R_PULLDOWN _ADC_BUTTONS_R_SCALED(2.2)
|
|
189
|
+
|
|
190
|
+#endif // ZONESTAR_LCD
|
|
191
|
+
|
|
192
|
+/**
|
|
193
|
+ * RJ45 8 pins extruder connector
|
|
194
|
+ *
|
|
195
|
+ * 1 - GND (Please do not connect to the same GND as extruder heater to prevent ground offset voltage)
|
|
196
|
+ * 2 - thermistor
|
|
197
|
+ * 3 - SERVO PWM
|
|
198
|
+ * 4 - extruder heater
|
|
199
|
+ * 5 - FAN (print cooling)
|
|
200
|
+ * 6 - FAN (extruder cooling)
|
|
201
|
+ * 7 - Probe signal
|
|
202
|
+ * 8 - 5V
|
|
203
|
+ *
|
|
204
|
+ * Standard ethernet pairs: 1&2, 3&6, 4&5, 7&8
|
|
205
|
+ * Use CAT7 cable to have all pairs shielded
|
|
206
|
+ *
|
|
207
|
+ */
|