Prusa MINI Firmware overview
pins_PRINTRBOARD_G2.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  * PRINTRBOARD_G2
26  */
27 
28 #ifndef __SAM3X8E__
29  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30 #endif
31 
32 #ifndef BOARD_INFO_NAME
33  #define BOARD_INFO_NAME "PRINTRBOARD_G2"
34 #endif
35 
36 //
37 // Servos
38 //
39 //#define SERVO0_PIN -1
40 //#define SERVO1_PIN -1
41 
42 //
43 // Limit Switches
44 //
45 #define X_MIN_PIN 22 // PB26
46 #define Y_MAX_PIN 18 // PA11
47 #define Z_MIN_PIN 19 // PA10
48 
49 //
50 // Z Probe (when not Z_MIN_PIN)
51 //
52 #ifndef Z_MIN_PROBE_PIN
53  #define Z_MIN_PROBE_PIN 22
54 #endif
55 
56 #ifndef FIL_RUNOUT_PIN
57  //#define FIL_RUNOUT_PIN 57 // PA22
58 #endif
59 #ifndef FIL_RUNOUT2_PIN
60  //#define FIL_RUNOUT2_PIN 21 // PB13
61 #endif
62 
63 //
64 // LED defines
65 //
66 //#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
67 //#define NEOPIXEL_PIN 20 // LED driving pin on motherboard
68 //#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
69 //#define SDA0 20 // PB12 NeoPixel pin I2C data
70 //#define SCL0 21 // PB13 I2C clock
71 
72 // D0_12 #REF! (INDICATOR_LED)
73 // B28 JTAG-CLK
74 // B31 JTAG_TMS /SWD_DIO
75 //A18 INTERRUPT_OUT
76 //A12 USART_RX not used
77 //A13 USART_TX not used
78 //A14 UART_RTS
79 //A15 UART_CTS
80 //PB2 Unassigned
81 //PB4 to PB9 Unassigned
82 //#define UART_RX_PIN 0 // PA8 "RX0"
83 //#define UART_TX_PIN 1 // PA9 "TX0"
84 //#define UART_RTS_PIN 23 // PA14
85 //#define UART_CTS_PIN 24 // PA15
86 
87 //
88 // Steppers
89 //
90 #define Z_STEP_PIN 73 // PA21 MOTOR 1
91 #define Z_DIR_PIN 75 // PA26
92 #define Z_ENABLE_PIN 74 // PA25
93 
94 #define X_STEP_PIN 66 // PB15 MOTOR 2
95 #define X_DIR_PIN 54 // PA16
96 #define X_ENABLE_PIN 67 // PB16
97 
98 #define Y_STEP_PIN 34 // PA29 MOTOR 3
99 #define Y_DIR_PIN 35 // PB1
100 #define Y_ENABLE_PIN 36 // PB0
101 
102 #define E0_STEP_PIN 53 // PB14 MOTOR 4
103 #define E0_DIR_PIN 78 // PB23
104 #define E0_ENABLE_PIN 37 // PB22
105 
106 // Microstepping mode pins
107 #define Z_MS1_PIN 52 // PB21 MODE0 MOTOR 1
108 #define Z_MS2_PIN 52 // PB21 MODE1
109 #define Z_MS3_PIN 65 // PB20 MODE2
110 
111 #define X_MS1_PIN 43 // PA20 MODE0 MOTOR 2
112 #define X_MS2_PIN 43 // PA20 MODE1
113 #define X_MS3_PIN 42 // PA19 MODE2
114 
115 #define Y_MS1_PIN 77 // PA28 MODE0 MOTOR 3
116 #define Y_MS2_PIN 77 // PA28 MODE1
117 #define Y_MS3_PIN 76 // PA27 MODE2
118 
119 #define E0_MS1_PIN 38 // PB11 MODE0 MOTOR 4
120 #define E0_MS2_PIN 38 // PB11 MODE1
121 #define E0_MS3_PIN 39 // PB10 MODE2
122 
123 // Motor current PWM pins
124 #define MOTOR_CURRENT_PWM_X_PIN 62 // PB17 MOTOR 1
125 #define MOTOR_CURRENT_PWM_Z_PIN 63 // PB18 MOTOR 2
126 #define MOTOR_CURRENT_PWM_Y_PIN 64 // PB19 MOTOR 3
127 #define MOTOR_CURRENT_PWM_E_PIN 61 // PA2 MOTOR 4
128 
129 #define DEFAULT_PWM_MOTOR_CURRENT { 300, 400, 1000} // XY Z E0, 1000 = 1000mAh
130 
131 //
132 // Temperature Sensors
133 //
134 #define TEMP_0_PIN 2 // digital 56 PA23
135 #define TEMP_BED_PIN 5 // digital 59 PA4
136 
137 //
138 // Heaters / Fans
139 //
140 #define HEATER_0_PIN 40 // PA5
141 #define HEATER_BED_PIN 41 // PB24
142 
143 #ifndef FAN_PIN
144  #define FAN_PIN 13 // PB27 Fan1A
145 #endif
146 #define FAN1_PIN 58 // PA6 Fan1B
147 
148 #define FET_SAFETY_PIN 31 // PA7 must be pulsed low every 50 mS or FETs are turned off
149 #define FET_SAFETY_DELAY 50 // 50 mS delay between pulses
150 #define FET_SAFETY_INVERTED true // true - negative going pulse of 2 uS
151 
152 /////////////////////////////////////////////////////////
153 
154 #define MISO_PIN 68 // set to unused pins for now
155 #define MOSI_PIN 69 // set to unused pins for now
156 #define SCK_PIN 70 // set to unused pins for now
157 #define SDSS 71 // set to unused pins for now
158 
159 /**
160  * G2 uses 8 pins that are not available in the DUE environment:
161  * 34 PA29 - Y_STEP_PIN
162  * 35 PB1 - Y_DIR_PIN
163  * 36 PB0 - Y_ENABLE_PIN
164  * 37 PB22 - E0_ENABLE_PIN
165  * 38 PB11 - E0_MS1_PIN - normally used by the USB native port
166  * 39 PB10 - E0_MS3_PIN - normally used by the USB native port
167  * 40 PA5 - HEATER_0_PIN
168  * 41 PB24 - HEATER_BED_PIN
169  *
170  * None of these are in the arduino_due_x variant so digitalWrite and digitalRead can't be used on them.
171  *
172  * They can be accessed via FASTIO functions WRITE, READ, OUT_WRITE, OUTPUT, ...
173  *
174  */