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 8.8KB

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