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

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