My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

pins_SANGUINOLOLU_11.h 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. #define IS_MELZI (MB(MELZI) || MB(MELZI_MAKR3D) || MB(MELZI_CREALITY))
  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 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 MB(AZTEEG_X1) || MB(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 DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
  119. #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available
  120. #endif
  121. //
  122. // LCD / Controller
  123. //
  124. #if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
  125. #if ENABLED(DOGLCD)
  126. #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
  127. #if IS_MELZI // Melzi board
  128. #define LCD_PINS_RS 30 // CS chip select /SS chip slave select
  129. #define LCD_PINS_ENABLE 29 // SID (MOSI)
  130. #define LCD_PINS_D4 17 // SCK (CLK) clock
  131. // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
  132. // Marlin so this can be used for BEEPER_PIN. You can use this pin
  133. // with M42 instead of BEEPER_PIN.
  134. #define BEEPER_PIN 27
  135. #else // Sanguinololu 1.3
  136. #define LCD_PINS_RS 4
  137. #define LCD_PINS_ENABLE 17
  138. #define LCD_PINS_D4 30
  139. #define LCD_PINS_D5 29
  140. #define LCD_PINS_D6 28
  141. #define LCD_PINS_D7 27
  142. #endif
  143. #else // DOGM SPI LCD Support
  144. #define DOGLCD_A0 30
  145. #define LCD_CONTRAST 1
  146. #if ENABLED(MAKRPANEL)
  147. #define BEEPER_PIN 29
  148. #define DOGLCD_CS 17
  149. #define LCD_BACKLIGHT_PIN 28 // PA3
  150. #else // !MAKRPANEL
  151. #define DOGLCD_CS 29
  152. #endif
  153. #endif
  154. // Uncomment screen orientation
  155. #define LCD_SCREEN_ROT_0
  156. //#define LCD_SCREEN_ROT_90
  157. //#define LCD_SCREEN_ROT_180
  158. //#define LCD_SCREEN_ROT_270
  159. #else // !DOGLCD
  160. #define LCD_PINS_RS 4
  161. #define LCD_PINS_ENABLE 17
  162. #define LCD_PINS_D4 30
  163. #define LCD_PINS_D5 29
  164. #define LCD_PINS_D6 28
  165. #define LCD_PINS_D7 27
  166. #endif // !DOGLCD
  167. #define BTN_EN1 11
  168. #define BTN_EN2 10
  169. #if ENABLED(LCD_I2C_PANELOLU2)
  170. #if IS_MELZI
  171. #define BTN_ENC 29
  172. #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi
  173. #else
  174. #define BTN_ENC 30
  175. #endif
  176. #elif ENABLED(LCD_FOR_MELZI)
  177. #define LCD_PINS_RS 17
  178. #define LCD_PINS_ENABLE 16
  179. #define LCD_PINS_D4 11
  180. #define BTN_ENC 28
  181. #define BTN_EN1 29
  182. #define BTN_EN2 30
  183. #ifndef ST7920_DELAY_1
  184. #define ST7920_DELAY_1 DELAY_0_NOP
  185. #endif
  186. #ifndef ST7920_DELAY_3
  187. #define ST7920_DELAY_2 DELAY_3_NOP
  188. #endif
  189. #ifndef ST7920_DELAY_3
  190. #define ST7920_DELAY_3 DELAY_0_NOP
  191. #endif
  192. #else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI
  193. #define BTN_ENC 16
  194. #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi
  195. #endif
  196. #define SD_DETECT_PIN -1
  197. #endif // ULTRA_LCD && NEWPANEL
  198. //
  199. // M3/M4/M5 - Spindle/Laser Control
  200. //
  201. #if ENABLED(SPINDLE_LASER_ENABLE)
  202. #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
  203. #define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown!
  204. #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM
  205. #define SPINDLE_DIR_PIN 11
  206. #elif !MB(MELZI) // use X stepper motor socket
  207. /**
  208. * To control the spindle speed and have an LCD you must sacrifice
  209. * the Extruder and pull some signals off the X stepper driver socket.
  210. *
  211. * The following assumes:
  212. * - The X stepper driver socket is empty
  213. * - The extruder driver socket has a driver board plugged into it
  214. * - The X stepper wires are attached the the extruder connector
  215. */
  216. /**
  217. * Where to get the spindle signals
  218. *
  219. * spindle signal socket name socket name
  220. * -------
  221. * /ENABLE O| |O VMOT
  222. * MS1 O| |O GND
  223. * MS2 O| |O 2B
  224. * MS3 O| |O 2A
  225. * /RESET O| |O 1A
  226. * /SLEEP O| |O 1B
  227. * SPINDLE_LASER_PWM_PIN STEP O| |O VDD
  228. * SPINDLE_LASER_ENABLE_PIN DIR O| |O GND
  229. * -------
  230. *
  231. * Note: Socket names vary from vendor to vendor.
  232. */
  233. #undef X_DIR_PIN
  234. #undef X_ENABLE_PIN
  235. #undef X_STEP_PIN
  236. #define X_DIR_PIN 0
  237. #define X_ENABLE_PIN 14
  238. #define X_STEP_PIN 1
  239. #define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM
  240. #define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup!
  241. #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin
  242. #endif
  243. #endif // SPINDLE_LASER_ENABLE