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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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. //
  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 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 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 DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(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 ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
  132. #if ENABLED(DOGLCD)
  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. #define LCD_CONTRAST 1
  153. #if ENABLED(MAKRPANEL)
  154. #define BEEPER_PIN 29
  155. #define DOGLCD_CS 17
  156. #define LCD_BACKLIGHT_PIN 28 // PA3
  157. #else // !MAKRPANEL
  158. #define DOGLCD_CS 29
  159. #endif
  160. #endif
  161. // Uncomment screen orientation
  162. #define LCD_SCREEN_ROT_0
  163. //#define LCD_SCREEN_ROT_90
  164. //#define LCD_SCREEN_ROT_180
  165. //#define LCD_SCREEN_ROT_270
  166. #else // !DOGLCD
  167. #define LCD_PINS_RS 4
  168. #define LCD_PINS_ENABLE 17
  169. #define LCD_PINS_D4 30
  170. #define LCD_PINS_D5 29
  171. #define LCD_PINS_D6 28
  172. #define LCD_PINS_D7 27
  173. #endif // !DOGLCD
  174. #define BTN_EN1 11
  175. #define BTN_EN2 10
  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_0_NOP
  192. #endif
  193. #ifndef ST7920_DELAY_2
  194. #define ST7920_DELAY_2 DELAY_3_NOP
  195. #endif
  196. #ifndef ST7920_DELAY_3
  197. #define ST7920_DELAY_3 DELAY_0_NOP
  198. #endif
  199. #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI
  200. #define BTN_ENC 16
  201. #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi
  202. #endif
  203. #define SD_DETECT_PIN -1
  204. #endif // ULTRA_LCD && NEWPANEL
  205. //
  206. // M3/M4/M5 - Spindle/Laser Control
  207. //
  208. #if ENABLED(SPINDLE_LASER_ENABLE)
  209. #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
  210. #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown!
  211. #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM
  212. #define SPINDLE_DIR_PIN 11
  213. #elif !MB(MELZI) // use X stepper motor socket
  214. /**
  215. * To control the spindle speed and have an LCD you must sacrifice
  216. * the Extruder and pull some signals off the X stepper driver socket.
  217. *
  218. * The following assumes:
  219. * - The X stepper driver socket is empty
  220. * - The extruder driver socket has a driver board plugged into it
  221. * - The X stepper wires are attached the the extruder connector
  222. */
  223. /**
  224. * Where to get the spindle signals
  225. *
  226. * spindle signal socket name socket name
  227. * -------
  228. * /ENABLE O| |O VMOT
  229. * MS1 O| |O GND
  230. * MS2 O| |O 2B
  231. * MS3 O| |O 2A
  232. * /RESET O| |O 1A
  233. * /SLEEP O| |O 1B
  234. * SPINDLE_LASER_PWM_PIN STEP O| |O VDD
  235. * SPINDLE_LASER_ENABLE_PIN DIR O| |O GND
  236. * -------
  237. *
  238. * Note: Socket names vary from vendor to vendor.
  239. */
  240. #undef X_DIR_PIN
  241. #undef X_ENABLE_PIN
  242. #undef X_STEP_PIN
  243. #define X_DIR_PIN 0
  244. #define X_ENABLE_PIN 14
  245. #define X_STEP_PIN 1
  246. #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM
  247. #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup!
  248. #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin
  249. #endif
  250. #endif // SPINDLE_LASER_ENABLE