1 |
ron |
1 |
/**
|
|
|
2 |
* Marlin 3D Printer Firmware
|
|
|
3 |
* Copyright (C) 2017 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 |
* Anet V1.0 board pin assignments
|
|
|
25 |
*/
|
|
|
26 |
|
|
|
27 |
/**
|
|
|
28 |
* Rev B 16 JUN 2017
|
|
|
29 |
*
|
|
|
30 |
* 1) no longer uses Sanguino files to define some of the pins
|
|
|
31 |
* 2) added pointers to useable Arduino IDE extensions
|
|
|
32 |
*
|
|
|
33 |
*/
|
|
|
34 |
|
|
|
35 |
/**
|
|
|
36 |
* The standard Arduino IDE extension (board manager) for this board
|
|
|
37 |
* is located at https://github.com/SkyNet3D/anet-board.
|
|
|
38 |
*
|
|
|
39 |
* Installation instructions are on that page.
|
|
|
40 |
*
|
|
|
41 |
* After copying the files to the appropriate location, restart Arduino and
|
|
|
42 |
* you'll see "Anet V1.0" and "Anet V1.0 (Optiboot)" in the boards list.
|
|
|
43 |
*
|
|
|
44 |
* "Anet V1.0" uses the bootloader that was installed on the board when
|
|
|
45 |
* it shipped from the factory.
|
|
|
46 |
*
|
|
|
47 |
* "Anet V1.0 (Optiboot)" frees up another 3K of FLASH. You'll need to burn
|
|
|
48 |
* a new bootloader to the board to be able to automatically download a
|
|
|
49 |
* compiled image.
|
|
|
50 |
*
|
|
|
51 |
*/
|
|
|
52 |
|
|
|
53 |
/**
|
|
|
54 |
* Another usable Arduino IDE extension (board manager) can be found at
|
|
|
55 |
* https://github.com/Lauszus/Sanguino
|
|
|
56 |
*
|
|
|
57 |
* This extension has been tested on Arduino 1.6.12 & 1.8.0
|
|
|
58 |
*
|
|
|
59 |
* Here's the JSON path:
|
|
|
60 |
* https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
|
|
|
61 |
*
|
|
|
62 |
* When installing select 1.0.2
|
|
|
63 |
*
|
|
|
64 |
* Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino
|
|
|
65 |
* Just use the above JSON URL instead of Sparkfun's JSON.
|
|
|
66 |
*
|
|
|
67 |
* Once installed select the Sanguino board and then select the CPU.
|
|
|
68 |
*
|
|
|
69 |
*/
|
|
|
70 |
|
|
|
71 |
/**
|
|
|
72 |
* To burn a new bootloader:
|
|
|
73 |
*
|
|
|
74 |
* 1. Connect your programmer to the board.
|
|
|
75 |
* 2. In the Arduino IDE select the board and then select the programmer.
|
|
|
76 |
* 3. In the Arduino IDE click on "burn bootloader". Don't worry about the "verify failed at 1F000" error message.
|
|
|
77 |
* 4. The programmer is no longer needed. Remove it.
|
|
|
78 |
*/
|
|
|
79 |
|
|
|
80 |
/**
|
|
|
81 |
* Additional info:
|
|
|
82 |
*
|
|
|
83 |
* Anet Schematics - https://github.com/ralf-e/ANET-3D-Board-V1.0
|
|
|
84 |
* Wiring RRDFG Smart Controller - http://www.thingiverse.com/thing:2103748
|
|
|
85 |
* SkyNet3D Anet software development - https://github.com/SkyNet3D/Marlin/
|
|
|
86 |
* Anet Users / Skynet SW on Facebook - https://www.facebook.com/skynet3ddevelopment/
|
|
|
87 |
*
|
|
|
88 |
* Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community.
|
|
|
89 |
*/
|
|
|
90 |
|
|
|
91 |
#ifndef __AVR_ATmega1284P__
|
|
|
92 |
#error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected in the 'Tools -> Boards' menu and ATmega1284P selected in 'Tools -> Processor' menu."
|
|
|
93 |
#endif
|
|
|
94 |
|
|
|
95 |
#ifndef BOARD_NAME
|
|
|
96 |
#define BOARD_NAME "Anet"
|
|
|
97 |
#endif
|
|
|
98 |
|
|
|
99 |
//
|
|
|
100 |
// Limit Switches
|
|
|
101 |
//
|
|
|
102 |
#define X_STOP_PIN 18
|
|
|
103 |
#define Y_STOP_PIN 19
|
|
|
104 |
#define Z_STOP_PIN 20
|
|
|
105 |
|
|
|
106 |
//
|
|
|
107 |
// Steppers
|
|
|
108 |
//
|
|
|
109 |
#define X_STEP_PIN 15
|
|
|
110 |
#define X_DIR_PIN 21
|
|
|
111 |
#define X_ENABLE_PIN 14
|
|
|
112 |
|
|
|
113 |
#define Y_STEP_PIN 22
|
|
|
114 |
#define Y_DIR_PIN 23
|
|
|
115 |
#define Y_ENABLE_PIN 14
|
|
|
116 |
|
|
|
117 |
#define Z_STEP_PIN 3
|
|
|
118 |
#define Z_DIR_PIN 2
|
|
|
119 |
#define Z_ENABLE_PIN 26
|
|
|
120 |
|
|
|
121 |
#define E0_STEP_PIN 1
|
|
|
122 |
#define E0_DIR_PIN 0
|
|
|
123 |
#define E0_ENABLE_PIN 14
|
|
|
124 |
|
|
|
125 |
//
|
|
|
126 |
// Temperature Sensors
|
|
|
127 |
//
|
|
|
128 |
#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder)
|
|
|
129 |
#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed)
|
|
|
130 |
|
|
|
131 |
//
|
|
|
132 |
// Heaters / Fans
|
|
|
133 |
//
|
|
|
134 |
#define HEATER_0_PIN 13 // (extruder)
|
|
|
135 |
#define HEATER_BED_PIN 12 // (bed)
|
|
|
136 |
|
|
|
137 |
#ifndef FAN_PIN
|
|
|
138 |
#define FAN_PIN 4
|
|
|
139 |
#endif
|
|
|
140 |
|
|
|
141 |
//
|
|
|
142 |
// Misc. Functions
|
|
|
143 |
//
|
|
|
144 |
#define SDSS 31
|
|
|
145 |
#define LED_PIN -1
|
|
|
146 |
|
|
|
147 |
/**
|
|
|
148 |
* LCD / Controller
|
|
|
149 |
*
|
|
|
150 |
* Only the following displays are supported:
|
|
|
151 |
* ZONESTAR_LCD
|
|
|
152 |
* ANET_FULL_GRAPHICS_LCD
|
|
|
153 |
* REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
|
|
154 |
*/
|
|
|
155 |
|
|
|
156 |
#if ENABLED(ULTRA_LCD)
|
|
|
157 |
#define LCD_SDSS 28
|
|
|
158 |
#if ENABLED(ADC_KEYPAD)
|
|
|
159 |
#define SERVO0_PIN 27 // free for BLTouch/3D-Touch
|
|
|
160 |
#ifndef LCD_I2C_TYPE_PCF8575
|
|
|
161 |
#define LCD_PINS_RS 28
|
|
|
162 |
#define LCD_PINS_ENABLE 29
|
|
|
163 |
#define LCD_PINS_D4 10
|
|
|
164 |
#define LCD_PINS_D5 11
|
|
|
165 |
#define LCD_PINS_D6 16
|
|
|
166 |
#define LCD_PINS_D7 17
|
|
|
167 |
#endif
|
|
|
168 |
#ifndef ADC_KEYPAD_PIN
|
|
|
169 |
#define ADC_KEYPAD_PIN 1 // Analog Input
|
|
|
170 |
#endif
|
|
|
171 |
#elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD)
|
|
|
172 |
// Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
|
|
|
173 |
// display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
|
|
|
174 |
// See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748
|
|
|
175 |
#define SERVO0_PIN 29 // free for BLTouch/3D-Touch
|
|
|
176 |
#define BEEPER_PIN 17
|
|
|
177 |
#define LCD_PINS_RS 27
|
|
|
178 |
#define LCD_PINS_ENABLE 28
|
|
|
179 |
#define LCD_PINS_D4 30
|
|
|
180 |
#define BTN_EN1 11
|
|
|
181 |
#define BTN_EN2 10
|
|
|
182 |
#define BTN_ENC 16
|
|
|
183 |
#ifndef ST7920_DELAY_1
|
|
|
184 |
#define ST7920_DELAY_1 DELAY_NS(0)
|
|
|
185 |
#endif
|
|
|
186 |
#ifndef ST7920_DELAY_2
|
|
|
187 |
#define ST7920_DELAY_2 DELAY_NS(63)
|
|
|
188 |
#endif
|
|
|
189 |
#ifndef ST7920_DELAY_3
|
|
|
190 |
#define ST7920_DELAY_3 DELAY_NS(125)
|
|
|
191 |
#endif
|
|
|
192 |
#define STD_ENCODER_PULSES_PER_STEP 4
|
|
|
193 |
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
|
|
194 |
#endif
|
|
|
195 |
#else
|
|
|
196 |
#define SERVO0_PIN 27
|
|
|
197 |
#endif
|
|
|
198 |
|
|
|
199 |
/**
|
|
|
200 |
* ====================================================================
|
|
|
201 |
* =============== Alternative RepRapDiscount Wiring ==================
|
|
|
202 |
* ====================================================================
|
|
|
203 |
*
|
|
|
204 |
* An alternative wiring scheme for the RepRapDiscount Full Graphics Display is
|
|
|
205 |
* published by oderwat on Thingiverse at https://www.thingiverse.com/thing:2103748.
|
|
|
206 |
*
|
|
|
207 |
* Using that adapter requires changing the pin definition as follows:
|
|
|
208 |
* #define SERVO0_PIN 27 // free for BLTouch/3D-Touch
|
|
|
209 |
* #define BEEPER_PIN 28
|
|
|
210 |
* #define LCD_PINS_RS 30
|
|
|
211 |
* #define LCD_PINS_ENABLE 29
|
|
|
212 |
* #define LCD_PINS_D4 17
|
|
|
213 |
*
|
|
|
214 |
* The BLTouch pin becomes LCD:3
|
|
|
215 |
*/
|
|
|
216 |
|
|
|
217 |
/**
|
|
|
218 |
* ====================================================================
|
|
|
219 |
* ===================== LCD PINOUTS ==================================
|
|
|
220 |
* ====================================================================
|
|
|
221 |
*
|
|
|
222 |
* Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring
|
|
|
223 |
* physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | http://www.thingiverse
|
|
|
224 |
* pin pin functions | | | | .com/thing:2103748
|
|
|
225 |
*------------------------------------------------------------------------------------------------------------------------
|
|
|
226 |
* ANET-J3.1 8 *** | N/A | J3_TX *** | |
|
|
|
227 |
* ANET-J3.2 9 *** | N/A | J3_RX *** | |
|
|
|
228 |
* ANET-J3.3 6 MISO | N/A | MISO *** | EXP2.1 MISO | EXP2.1 MISO
|
|
|
229 |
* ANET-J3.4 +5V | N/A | +5V | |
|
|
|
230 |
* ANET-J3.5 7 SCK | N/A | SCK *** | EXP2.2 SCK | EXP2.2 SCK
|
|
|
231 |
* ANET-J3.6 5 MOSI | N/A | MOSI *** | EXP2.6 MOSI | EXP2.6 MOSI
|
|
|
232 |
* ANET-J3.7 !RESET | N/A | button | EXP2.8 panel button | EXP2.8 panel button
|
|
|
233 |
* ANET-J3.8 GND | N/A | GND | EXP2.9 GND | EXP2.9 GND
|
|
|
234 |
* ANET-J3.9 4 Don't use | N/A | N/C | |
|
|
|
235 |
* ANET-J3.10 +3.3V | N/A | +3.3V *** | |
|
|
|
236 |
* | | | |
|
|
|
237 |
* | | | |
|
|
|
238 |
* ANET-LCD.1 GND | GND | GND | EXP1.9 GND | EXP1.9 GND
|
|
|
239 |
* ANET-LCD.2 +5V | +5V | +5V | EXP1.10 +5V | EXP1.10 +5V
|
|
|
240 |
* ANET-LCD.3 27 A4 | N/C * | LCD_PINS_RS | EXP1.4 LCD_PINS_RS | EXP2.4 SDSS or N/C *
|
|
|
241 |
* ANET-LCD.4 10 | LCD_PINS_D4 | BTN_EN2 | EXP2.3 BTN_EN2 | EXP2.3 BTN_EN2
|
|
|
242 |
* ANET-LCD.5 28 A3 | LCD_PINS_RS | LCD_PINS_ENABLE | EXP1.3 LCD_PINS_ENABLE | EXP1.1 BEEPER_PIN
|
|
|
243 |
* ANET-LCD.6 11 | LCD_PINS_D5 | BTN_EN1 | EXP2.5 BTN_EN1 | EXP2.5 BTN_EN1
|
|
|
244 |
* ANET-LCD.7 29 A2 | LCD_PINS_ENABLE | N/C * | EXP2.4 SDSS or N/C * | EXP1.3 LCD_PINS_ENABLE
|
|
|
245 |
* ANET-LCD.8 16 SCL | LCD_PINS_D6 | BTN_ENC | EXP1.2 BTN_ENC | EXP1.2 BTN_ENC
|
|
|
246 |
* ANET-LCD.9 30 A1 | ADC_KEYPAD_PIN ** | LCD_PINS_D4 | EXP1.5 LCD_PINS_D4 | EXP1.4 LCD_PINS_RS
|
|
|
247 |
* ANET-LCD.10 17 SDA | LCD_PINS_D7 | BEEPER_PIN | EXP1.1 BEEPER_PIN | EXP1.5 LCD_PINS_D4
|
|
|
248 |
*
|
|
|
249 |
* N/C * - if not connected to the LCD can be used for BLTouch servo input
|
|
|
250 |
* ** - analog pin -WITHOUT a pullup
|
|
|
251 |
* *** - only connected to something if the Bluetooth module is populated
|
|
|
252 |
*/
|
|
|
253 |
|
|
|
254 |
/**
|
|
|
255 |
* REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
|
|
256 |
* physical pin function
|
|
|
257 |
* EXP1.1 BEEPER
|
|
|
258 |
* EXP1.2 BTN_ENC
|
|
|
259 |
* EXP1.3 LCD_PINS_ENABLE
|
|
|
260 |
* EXP1.4 LCD_PINS_RS
|
|
|
261 |
* EXP1.5 LCD_PINS_D4
|
|
|
262 |
* EXP1.6 LCD_PINS_D5 (not used)
|
|
|
263 |
* EXP1.7 LCD_PINS_D6 (not used)
|
|
|
264 |
* EXP1.8 LCD_PINS_D7 (not used)
|
|
|
265 |
* EXP1.9 GND
|
|
|
266 |
* EXP1.10 VCC
|
|
|
267 |
*
|
|
|
268 |
*
|
|
|
269 |
* EXP2.1 MISO
|
|
|
270 |
* EXP2.2 SCK
|
|
|
271 |
* EXP2.3 BTN_EN2
|
|
|
272 |
* EXP2.4 SDSS
|
|
|
273 |
* EXP2.5 BTN_EN1
|
|
|
274 |
* EXP2.6 MOSI
|
|
|
275 |
* EXP2.7 SD_DETECT_PIN
|
|
|
276 |
* EXP2.8 button
|
|
|
277 |
* EXP2.9 GND
|
|
|
278 |
* EXP2.10 NC
|
|
|
279 |
*/
|