My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pins_SANGUINOLOLU_11.h 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * Sanguinololu board pin assignments
  25. */
  26. /**
  27. * Rev B 26 DEC 2016
  28. *
  29. * 1) added pointer to a current Arduino IDE extension
  30. * 2) added support for M3, M4 & M5 spindle control commands
  31. * 3) added case light pin definition
  32. */
  33. /**
  34. * A useable Arduino IDE extension (board manager) can be found at
  35. * https://github.com/Lauszus/Sanguino
  36. *
  37. * This extension has been tested on Arduino 1.6.12 & 1.8.0
  38. *
  39. * Here's the JSON path:
  40. * https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
  41. *
  42. * When installing select 1.0.2
  43. *
  44. * Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino
  45. * Just use the above JSON URL instead of Sparkfun's JSON.
  46. *
  47. * Once installed select the Sanguino board and then select the CPU.
  48. */
  49. #define ALLOW_MEGA644P
  50. #include "env_validate.h"
  51. #ifndef BOARD_INFO_NAME
  52. #define BOARD_INFO_NAME "Sanguinololu <1.2"
  53. #endif
  54. //
  55. // Limit Switches
  56. //
  57. #define X_STOP_PIN 18
  58. #define Y_STOP_PIN 19
  59. #define Z_STOP_PIN 20
  60. //
  61. // Steppers
  62. //
  63. #define X_STEP_PIN 15
  64. #define X_DIR_PIN 21
  65. #define Y_STEP_PIN 22
  66. #define Y_DIR_PIN 23
  67. #define Z_STEP_PIN 3
  68. #define Z_DIR_PIN 2
  69. #define E0_STEP_PIN 1
  70. #define E0_DIR_PIN 0
  71. //
  72. // Temperature Sensors
  73. //
  74. #define TEMP_0_PIN 7 // Analog Input (pin 33 extruder)
  75. #define TEMP_BED_PIN 6 // Analog Input (pin 34 bed)
  76. //
  77. // Heaters / Fans
  78. //
  79. #define HEATER_0_PIN 13 // (extruder)
  80. #if ENABLED(SANGUINOLOLU_V_1_2)
  81. #define HEATER_BED_PIN 12 // (bed)
  82. #define X_ENABLE_PIN 14
  83. #define Y_ENABLE_PIN 14
  84. #define Z_ENABLE_PIN 26
  85. #define E0_ENABLE_PIN 14
  86. #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2)
  87. #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
  88. #endif
  89. #else
  90. #define HEATER_BED_PIN 14 // (bed)
  91. #define X_ENABLE_PIN 4
  92. #define Y_ENABLE_PIN 4
  93. #define Z_ENABLE_PIN 4
  94. #define E0_ENABLE_PIN 4
  95. #endif
  96. #if !defined(FAN_PIN) && (MB(AZTEEG_X1, STB_11) || IS_MELZI)
  97. #define FAN_PIN 4 // Works for Panelolu2 too
  98. #endif
  99. //
  100. // Misc. Functions
  101. //
  102. /**
  103. * In some versions of the Sanguino libraries the pin
  104. * definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi).
  105. * If you encounter issues with these pins, upgrade your
  106. * Sanguino libraries! See #368.
  107. */
  108. //#define SDSS 24
  109. #define SDSS 31
  110. #if IS_MELZI
  111. #define LED_PIN 27
  112. #elif MB(STB_11)
  113. #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED
  114. #endif
  115. #if !HAS_CUTTER && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header
  116. #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available
  117. #endif
  118. /**
  119. * Sanguinololu 1.4 AUX pins:
  120. *
  121. * PWM TX1 RX1 SDA SCL
  122. * 12V 5V D12 D11 D10 D17 D16
  123. * GND GND D31 D30 D29 D28 D27
  124. * A4 A3 A2 A1 A0
  125. */
  126. //
  127. // LCD / Controller
  128. //
  129. #if HAS_WIRED_LCD
  130. #define SD_DETECT_PIN -1
  131. #if HAS_MARLINUI_U8GLIB
  132. #if ENABLED(LCD_FOR_MELZI)
  133. #define LCD_PINS_RS 17
  134. #define LCD_PINS_ENABLE 16
  135. #define LCD_PINS_D4 11
  136. #define KILL_PIN 10
  137. #define BEEPER_PIN 27
  138. #elif IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
  139. #if IS_MELZI
  140. #define LCD_PINS_RS 30 // CS chip select /SS chip slave select
  141. #define LCD_PINS_ENABLE 29 // SID (MOSI)
  142. #define LCD_PINS_D4 17 // SCK (CLK) clock
  143. // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
  144. // Marlin so this can be used for BEEPER_PIN. You can use this pin
  145. // with M42 instead of BEEPER_PIN.
  146. #define BEEPER_PIN 27
  147. #else // Sanguinololu >=1.3
  148. #define LCD_PINS_RS 4
  149. #define LCD_PINS_ENABLE 17
  150. #define LCD_PINS_D4 30
  151. #define LCD_PINS_D5 29
  152. #define LCD_PINS_D6 28
  153. #define LCD_PINS_D7 27
  154. #endif
  155. #else
  156. #define DOGLCD_A0 30
  157. #if ENABLED(MAKRPANEL)
  158. #define BEEPER_PIN 29
  159. #define DOGLCD_CS 17
  160. #define LCD_BACKLIGHT_PIN 28 // PA3
  161. #elif IS_MELZI
  162. #define BEEPER_PIN 27
  163. #define DOGLCD_CS 28
  164. #else // !MAKRPANEL
  165. #define DOGLCD_CS 29
  166. #endif
  167. #endif
  168. //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
  169. #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
  170. #define LCD_PINS_RS 28
  171. #define LCD_PINS_ENABLE 29
  172. #define LCD_PINS_D4 10
  173. #define LCD_PINS_D5 11
  174. #define LCD_PINS_D6 16
  175. #define LCD_PINS_D7 17
  176. #else
  177. #define LCD_PINS_RS 4
  178. #define LCD_PINS_ENABLE 17
  179. #define LCD_PINS_D4 30
  180. #define LCD_PINS_D5 29
  181. #define LCD_PINS_D6 28
  182. #define LCD_PINS_D7 27
  183. #endif
  184. #if ENABLED(LCD_FOR_MELZI)
  185. #define BTN_ENC 28
  186. #define BTN_EN1 29
  187. #define BTN_EN2 30
  188. #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
  189. #define ADC_KEYPAD_PIN 1
  190. #define BTN_EN1 -1
  191. #define BTN_EN2 -1
  192. #elif ENABLED(LCD_I2C_PANELOLU2)
  193. #if IS_MELZI
  194. #define BTN_ENC 29
  195. #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi
  196. #else
  197. #define BTN_ENC 30
  198. #endif
  199. #else // !LCD_FOR_MELZI && !ZONESTAR_LCD && !LCD_I2C_PANELOLU2
  200. #define BTN_ENC 16
  201. #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi
  202. #endif
  203. #if IS_NEWPANEL && !defined(BTN_EN1)
  204. #define BTN_EN1 11
  205. #define BTN_EN2 10
  206. #endif
  207. #endif // HAS_WIRED_LCD
  208. //
  209. // M3/M4/M5 - Spindle/Laser Control
  210. //
  211. #if HAS_CUTTER
  212. #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header
  213. #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown!
  214. #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM
  215. #define SPINDLE_DIR_PIN 11
  216. #elif !MB(MELZI) // use X stepper motor socket
  217. /**
  218. * To control the spindle speed and have an LCD you must sacrifice
  219. * the Extruder and pull some signals off the X stepper driver socket.
  220. *
  221. * The following assumes:
  222. * - The X stepper driver socket is empty
  223. * - The extruder driver socket has a driver board plugged into it
  224. * - The X stepper wires are attached the the extruder connector
  225. */
  226. /**
  227. * Where to get the spindle signals
  228. *
  229. * spindle signal socket name socket name
  230. * -------
  231. * /ENABLE O| |O VMOT
  232. * MS1 O| |O GND
  233. * MS2 O| |O 2B
  234. * MS3 O| |O 2A
  235. * /RESET O| |O 1A
  236. * /SLEEP O| |O 1B
  237. * SPINDLE_LASER_PWM_PIN STEP O| |O VDD
  238. * SPINDLE_LASER_ENA_PIN DIR O| |O GND
  239. * -------
  240. *
  241. * Note: Socket names vary from vendor to vendor.
  242. */
  243. #undef X_DIR_PIN
  244. #undef X_ENABLE_PIN
  245. #undef X_STEP_PIN
  246. #define X_DIR_PIN 0
  247. #define X_ENABLE_PIN 14
  248. #define X_STEP_PIN 1
  249. #define SPINDLE_LASER_PWM_PIN 15 // Hardware PWM
  250. #define SPINDLE_LASER_ENA_PIN 21 // Pullup!
  251. #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin
  252. #endif
  253. #endif