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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu."
  52. #endif
  53. #ifndef BOARD_NAME
  54. #define BOARD_NAME "Sanguinololu <1.2"
  55. #endif
  56. #ifdef __AVR_ATmega1284P__
  57. #define LARGE_FLASH true
  58. #endif
  59. //
  60. // Limit Switches
  61. //
  62. #define X_STOP_PIN 18
  63. #define Y_STOP_PIN 19
  64. #define Z_STOP_PIN 20
  65. //
  66. // Steppers
  67. //
  68. #define X_STEP_PIN 15
  69. #define X_DIR_PIN 21
  70. #define Y_STEP_PIN 22
  71. #define Y_DIR_PIN 23
  72. #define Z_STEP_PIN 3
  73. #define Z_DIR_PIN 2
  74. #define E0_STEP_PIN 1
  75. #define E0_DIR_PIN 0
  76. //
  77. // Temperature Sensors
  78. //
  79. #define TEMP_0_PIN 7 // Analog Input (pin 33 extruder)
  80. #define TEMP_BED_PIN 6 // Analog Input (pin 34 bed)
  81. //
  82. // Heaters / Fans
  83. //
  84. #define HEATER_0_PIN 13 // (extruder)
  85. #if ENABLED(SANGUINOLOLU_V_1_2)
  86. #define HEATER_BED_PIN 12 // (bed)
  87. #define X_ENABLE_PIN 14
  88. #define Y_ENABLE_PIN 14
  89. #define Z_ENABLE_PIN 26
  90. #define E0_ENABLE_PIN 14
  91. #if ENABLED(LCD_I2C_PANELOLU2)
  92. #define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
  93. #endif
  94. #else
  95. #define HEATER_BED_PIN 14 // (bed)
  96. #define X_ENABLE_PIN -1
  97. #define Y_ENABLE_PIN -1
  98. #define Z_ENABLE_PIN -1
  99. #define E0_ENABLE_PIN -1
  100. #endif
  101. #if MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI)
  102. #define FAN_PIN 4 // Works for Panelolu2 too
  103. #endif
  104. //
  105. // Misc. Functions
  106. //
  107. /**
  108. * In some versions of the Sanguino libraries the pin
  109. * definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi).
  110. * If you encounter issues with these pins, upgrade your
  111. * Sanguino libraries! See #368.
  112. */
  113. //#define SDSS 24
  114. #define SDSS 31
  115. #if ENABLED(IS_MELZI)
  116. #define LED_PIN 27
  117. #elif MB(STB_11)
  118. #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED
  119. #endif
  120. #if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
  121. #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available
  122. #endif
  123. /**
  124. * Sanguinololu 1.4 AUX pins:
  125. *
  126. * PWM TX1 RX1 SDA SCL
  127. * 12V 5V D12 D11 D10 D17 D16
  128. * GND GND D31 D30 D29 D28 D27
  129. * A4 A3 A2 A1 A0
  130. */
  131. //
  132. // LCD / Controller
  133. //
  134. #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
  135. #if ENABLED(DOGLCD)
  136. #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
  137. #if ENABLED(IS_MELZI)
  138. #define LCD_PINS_RS 30 // CS chip select /SS chip slave select
  139. #define LCD_PINS_ENABLE 29 // SID (MOSI)
  140. #define LCD_PINS_D4 17 // SCK (CLK) clock
  141. // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
  142. // Marlin so this can be used for BEEPER_PIN. You can use this pin
  143. // with M42 instead of BEEPER_PIN.
  144. #define BEEPER_PIN 27
  145. #else // Sanguinololu >=1.3
  146. #define LCD_PINS_RS 4
  147. #define LCD_PINS_ENABLE 17
  148. #define LCD_PINS_D4 30
  149. #define LCD_PINS_D5 29
  150. #define LCD_PINS_D6 28
  151. #define LCD_PINS_D7 27
  152. #endif
  153. #else // DOGM SPI LCD Support
  154. #define DOGLCD_A0 30
  155. #define LCD_CONTRAST 1
  156. #if ENABLED(MAKRPANEL)
  157. #define BEEPER_PIN 29
  158. #define DOGLCD_CS 17
  159. #define LCD_BACKLIGHT_PIN 28 // PA3
  160. #else // !MAKRPANEL
  161. #define DOGLCD_CS 29
  162. #endif
  163. #endif
  164. // Uncomment screen orientation
  165. #define LCD_SCREEN_ROT_0
  166. //#define LCD_SCREEN_ROT_90
  167. //#define LCD_SCREEN_ROT_180
  168. //#define LCD_SCREEN_ROT_270
  169. #else // !DOGLCD
  170. #define LCD_PINS_RS 4
  171. #define LCD_PINS_ENABLE 17
  172. #define LCD_PINS_D4 30
  173. #define LCD_PINS_D5 29
  174. #define LCD_PINS_D6 28
  175. #define LCD_PINS_D7 27
  176. #endif // !DOGLCD
  177. #define BTN_EN1 11
  178. #define BTN_EN2 10
  179. #if ENABLED(LCD_I2C_PANELOLU2)
  180. #if ENABLED(IS_MELZI)
  181. #define BTN_ENC 29
  182. #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi
  183. #else
  184. #define BTN_ENC 30
  185. #endif
  186. #elif ENABLED(LCD_FOR_MELZI)
  187. #define LCD_PINS_RS 17
  188. #define LCD_PINS_ENABLE 16
  189. #define LCD_PINS_D4 11
  190. #define BTN_ENC 28
  191. #define BTN_EN1 29
  192. #define BTN_EN2 30
  193. #ifndef ST7920_DELAY_1
  194. #define ST7920_DELAY_1 DELAY_0_NOP
  195. #endif
  196. #ifndef ST7920_DELAY_3
  197. #define ST7920_DELAY_2 DELAY_3_NOP
  198. #endif
  199. #ifndef ST7920_DELAY_3
  200. #define ST7920_DELAY_3 DELAY_0_NOP
  201. #endif
  202. #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI
  203. #define BTN_ENC 16
  204. #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi
  205. #endif
  206. #define SD_DETECT_PIN -1
  207. #endif // ULTRA_LCD && NEWPANEL
  208. //
  209. // M3/M4/M5 - Spindle/Laser Control
  210. //
  211. #if ENABLED(SPINDLE_LASER_ENABLE)
  212. #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
  213. #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown!
  214. #define SPINDLE_LASER_PWM_PIN 4 // MUST BE 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_ENABLE_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 // MUST BE HARDWARE PWM
  250. #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup!
  251. #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin
  252. #endif
  253. #endif // SPINDLE_LASER_ENABLE