Prusa3d Marlin fork
pins_Einsy_1_0.h
1 /*****************************************************************
2 * EINSY Rambo 1.0a Pin Assignments
3 ******************************************************************/
4 
5 #define ELECTRONICS "EINSy_10a"
6 
7 #define KNOWN_BOARD
8 #ifndef __AVR_ATmega2560__
9  #error Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu.
10 #endif
11 
12 #define TMC2130
13 #define UVLO_SUPPORT
14 
15 #define AMBIENT_THERMISTOR
16 #define PINDA_THERMISTOR
17 
18 #define PRUSA_SN_SUPPORT //enables the "PRUSA SN" command and 32u2 enhanced firmware support
19 
20 #define XFLASH // external 256kB flash
21 #define BOOTAPP // bootloader support
22 #define WATCHDOG_SOFT_RESET_VALUE WDTO_15MS
23 
24 #define XFLASH_PIN_CS 32
25 
26 #define X_TMC2130_CS 41
27 #define X_TMC2130_DIAG 64 // !!! changed from 40 (EINY03)
28 #define X_STEP_PIN 37
29 #define X_DIR_PIN 49
30 #define X_MIN_PIN 12
31 //#define X_MAX_PIN 30
32 //#define X_MIN_PIN X_TMC2130_DIAG
33 #define X_MAX_PIN X_TMC2130_DIAG
34 #define X_ENABLE_PIN 29
35 #define X_MS1_PIN -1
36 #define X_MS2_PIN -1
37 
38 #define Y_TMC2130_CS 39
39 #define Y_TMC2130_DIAG 69
40 #define Y_STEP_PIN 36
41 #define Y_DIR_PIN 48
42 #define Y_MIN_PIN 11
43 //#define Y_MAX_PIN 24
44 //#define Y_MIN_PIN Y_TMC2130_DIAG
45 #define Y_MAX_PIN Y_TMC2130_DIAG
46 #define Y_ENABLE_PIN 28
47 #define Y_MS1_PIN -1
48 #define Y_MS2_PIN -1
49 
50 #define Z_TMC2130_CS 67
51 #define Z_TMC2130_DIAG 68
52 #define Z_STEP_PIN 35
53 #define Z_DIR_PIN 47
54 #define Z_MIN_PIN 10
55 #define Z_MAX_PIN 23
56 //#define Z_MAX_PIN Z_TMC2130_DIAG
57 #define Z_ENABLE_PIN 27
58 #define Z_MS1_PIN -1
59 #define Z_MS2_PIN -1
60 
61 #define HEATER_BED_PIN 4 //PG5
62 #define TEMP_BED_PIN 2 //A2
63 
64 #define HEATER_0_PIN 3 //PE5
65 #define TEMP_0_PIN 0 //A0
66 
67 #define HEATER_1_PIN -1
68 #define TEMP_1_PIN 1 //A1
69 
70 #define HEATER_2_PIN -1
71 #define TEMP_2_PIN -1
72 
73 #define TEMP_AMBIENT_PIN 6 //A6
74 
75 #define TEMP_PINDA_PIN 3 //A3
76 
77 #define VOLT_PWR_PIN 4 //A4
78 #define VOLT_BED_PIN 9 //A9
79 #define VOLT_IR_PIN 8 //A8
80 
81 
82 #define TEMP_TIM 5
83 
84 
85 #define E0_TMC2130_CS 66
86 #define E0_TMC2130_DIAG 65
87 #define E0_STEP_PIN 34
88 #define E0_DIR_PIN 43
89 #define E0_ENABLE_PIN 26
90 #define E0_MS1_PIN -1
91 #define E0_MS2_PIN -1
92 
93 #define SDPOWER -1
94 #define SDSS 77
95 #define LED_PIN 13
96 #define FAN_PIN 6
97 #define FAN_1_PIN -1
98 #define PS_ON_PIN -1
99 #define KILL_PIN -1 // 80 with Smart Controller LCD
100 #define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
101 
102 
103 //#define KILL_PIN 32
104 
105 #define LCD_BL_PIN 5 //backlight control pin
106 #define BEEPER 84 // Beeper on AUX-4
107 #define LCD_PINS_RS 82
108 #define LCD_PINS_ENABLE 61 // !!! changed from 18 (EINY03)
109 #define LCD_PINS_D4 59 // !!! changed from 19 (EINY03)
110 #define LCD_PINS_D5 70
111 #define LCD_PINS_D6 85
112 #define LCD_PINS_D7 71
113 
114 //buttons are directly attached using AUX-2
115 #define BTN_EN1 72
116 #define BTN_EN2 14
117 #define BTN_ENC 9 // the click
118 
119 #define SDCARDDETECT 15
120 
121 #define TACH_0 79 // !!! changed from 81 (EINY03)
122 #define TACH_1 80
123 
124 #define IR_SENSOR_PIN 62 //idler sensor @PK0 (digital pin 62/A8)
125 
126 #define MMU_RST_PIN 76
127 
128 // Support for an 8 bit logic analyzer, for example the Saleae.
129 // Channels 0-2 are fast, they could generate 2.667Mhz waveform with a software loop.
130 #define LOGIC_ANALYZER_CH0 X_MIN_PIN // PB6
131 #define LOGIC_ANALYZER_CH1 Y_MIN_PIN // PB5
132 #define LOGIC_ANALYZER_CH2 53 // PB0 (PROC_nCS)
133 // Channels 3-7 are slow, they could generate
134 // 0.889Mhz waveform with a software loop and interrupt locking,
135 // 1.333MHz waveform without interrupt locking.
136 #define LOGIC_ANALYZER_CH3 73 // PJ3
137 // PK0 has no Arduino digital pin assigned, so we set it directly.
138 #define WRITE_LOGIC_ANALYZER_CH4(value) if (value) PORTK |= (1 << 0); else PORTK &= ~(1 << 0) // PK0
139 #define LOGIC_ANALYZER_CH5 16 // PH0 (RXD2)
140 #define LOGIC_ANALYZER_CH6 17 // PH1 (TXD2)
141 #define LOGIC_ANALYZER_CH7 76 // PJ5
142 
143 #define LOGIC_ANALYZER_CH0_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH0); WRITE(LOGIC_ANALYZER_CH0, false); } while (0)
144 #define LOGIC_ANALYZER_CH1_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH1); WRITE(LOGIC_ANALYZER_CH1, false); } while (0)
145 #define LOGIC_ANALYZER_CH2_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH2); WRITE(LOGIC_ANALYZER_CH2, false); } while (0)
146 #define LOGIC_ANALYZER_CH3_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH3); WRITE(LOGIC_ANALYZER_CH3, false); } while (0)
147 #define LOGIC_ANALYZER_CH4_ENABLE do { DDRK |= 1 << 0; WRITE_LOGIC_ANALYZER_CH4(false); } while (0)
148 #define LOGIC_ANALYZER_CH5_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH5); WRITE(LOGIC_ANALYZER_CH5, false); } while (0)
149 #define LOGIC_ANALYZER_CH6_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH6); WRITE(LOGIC_ANALYZER_CH6, false); } while (0)
150 #define LOGIC_ANALYZER_CH7_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH7); WRITE(LOGIC_ANALYZER_CH7, false); } while (0)
151 
152 // Async output on channel 5 of the logical analyzer.
153 // Baud rate 2MBit, 9 bits, 1 stop bit.
154 #define LOGIC_ANALYZER_SERIAL_TX_ENABLE do { UBRR2H = 0; UBRR2L = 0; UCSR2B = (1 << TXEN2) | (1 << UCSZ02); UCSR2C = 0x06; } while (0)
155 // Non-checked (quicker) variant. Use it if you are sure that the transmit buffer is already empty.
156 #define LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C) do { if (C & 0x100) UCSR2B |= 1; else UCSR2B &= ~1; UDR2 = C; } while (0)
157 #define LOGIC_ANALYZER_SERIAL_TX_WRITE(C) do { \
158  /* Wait for empty transmit buffer */ \
159  while (!(UCSR2A & (1<<UDRE2))); \
160  /* Put data into buffer, sends the data */ \
161  LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C); \
162 } while (0)
163