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