2016-03-25 01:19:46 -05:00
|
|
|
/**
|
2016-03-24 13:01:20 -05:00
|
|
|
* Marlin 3D Printer Firmware
|
2019-02-12 15:06:53 -06:00
|
|
|
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2016-03-24 13:01:20 -05:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
|
|
|
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-25 20:40:00 -06:00
|
|
|
/**
|
|
|
|
* Sanguinololu board pin assignments
|
|
|
|
*/
|
|
|
|
|
2017-04-07 13:52:21 -05:00
|
|
|
/**
|
|
|
|
* Rev B 26 DEC 2016
|
|
|
|
*
|
|
|
|
* 1) added pointer to a current Arduino IDE extension
|
|
|
|
* 2) added support for M3, M4 & M5 spindle control commands
|
|
|
|
* 3) added case light pin definition
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A useable Arduino IDE extension (board manager) can be found at
|
|
|
|
* https://github.com/Lauszus/Sanguino
|
|
|
|
*
|
|
|
|
* This extension has been tested on Arduino 1.6.12 & 1.8.0
|
|
|
|
*
|
|
|
|
* Here's the JSON path:
|
|
|
|
* https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
|
|
|
|
*
|
|
|
|
* When installing select 1.0.2
|
|
|
|
*
|
|
|
|
* Installation instructions can be found at https://learn.sparkfun.com/pages/CustomBoardsArduino
|
|
|
|
* Just use the above JSON URL instead of Sparkfun's JSON.
|
|
|
|
*
|
|
|
|
* Once installed select the Sanguino board and then select the CPU.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-25 20:40:00 -06:00
|
|
|
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__)
|
2018-11-08 21:57:15 -06:00
|
|
|
#error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'"
|
2015-01-25 20:40:00 -06:00
|
|
|
#endif
|
|
|
|
|
2016-06-30 04:24:29 -05:00
|
|
|
#ifndef BOARD_NAME
|
|
|
|
#define BOARD_NAME "Sanguinololu <1.2"
|
|
|
|
#endif
|
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
//
|
|
|
|
// Limit Switches
|
|
|
|
//
|
|
|
|
#define X_STOP_PIN 18
|
|
|
|
#define Y_STOP_PIN 19
|
|
|
|
#define Z_STOP_PIN 20
|
|
|
|
|
|
|
|
//
|
|
|
|
// Steppers
|
|
|
|
//
|
2015-01-25 20:40:00 -06:00
|
|
|
#define X_STEP_PIN 15
|
|
|
|
#define X_DIR_PIN 21
|
|
|
|
|
|
|
|
#define Y_STEP_PIN 22
|
|
|
|
#define Y_DIR_PIN 23
|
|
|
|
|
2015-07-23 14:33:22 -05:00
|
|
|
#define Z_STEP_PIN 3
|
|
|
|
#define Z_DIR_PIN 2
|
2015-01-25 20:40:00 -06:00
|
|
|
|
|
|
|
#define E0_STEP_PIN 1
|
|
|
|
#define E0_DIR_PIN 0
|
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
//
|
|
|
|
// Temperature Sensors
|
|
|
|
//
|
|
|
|
#define TEMP_0_PIN 7 // Analog Input (pin 33 extruder)
|
|
|
|
#define TEMP_BED_PIN 6 // Analog Input (pin 34 bed)
|
2015-05-11 16:22:19 -05:00
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
//
|
|
|
|
// Heaters / Fans
|
|
|
|
//
|
2018-03-28 12:51:59 -05:00
|
|
|
#define HEATER_0_PIN 13 // (extruder)
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2015-07-31 00:11:19 -05:00
|
|
|
#if ENABLED(SANGUINOLOLU_V_1_2)
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2018-03-28 12:51:59 -05:00
|
|
|
#define HEATER_BED_PIN 12 // (bed)
|
2015-07-23 14:33:22 -05:00
|
|
|
#define X_ENABLE_PIN 14
|
|
|
|
#define Y_ENABLE_PIN 14
|
|
|
|
#define Z_ENABLE_PIN 26
|
|
|
|
#define E0_ENABLE_PIN 14
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2018-06-07 16:46:13 -05:00
|
|
|
#if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2)
|
2018-03-28 12:51:59 -05:00
|
|
|
#define FAN_PIN 4 // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
|
2015-01-25 20:40:00 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2018-03-28 12:51:59 -05:00
|
|
|
#define HEATER_BED_PIN 14 // (bed)
|
2015-07-23 14:33:22 -05:00
|
|
|
#define X_ENABLE_PIN -1
|
|
|
|
#define Y_ENABLE_PIN -1
|
|
|
|
#define Z_ENABLE_PIN -1
|
|
|
|
#define E0_ENABLE_PIN -1
|
2015-01-25 20:40:00 -06:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2018-06-07 16:46:13 -05:00
|
|
|
#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI))
|
2018-03-28 12:51:59 -05:00
|
|
|
#define FAN_PIN 4 // Works for Panelolu2 too
|
2016-10-08 15:27:04 -05:00
|
|
|
#endif
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
//
|
|
|
|
// Misc. Functions
|
|
|
|
//
|
2017-04-07 13:52:21 -05:00
|
|
|
|
2015-07-23 14:33:22 -05:00
|
|
|
/**
|
2017-04-07 13:52:21 -05:00
|
|
|
* In some versions of the Sanguino libraries the pin
|
|
|
|
* definitions are wrong, with SDSS = 24 and LED_PIN = 28 (Melzi).
|
|
|
|
* If you encounter issues with these pins, upgrade your
|
|
|
|
* Sanguino libraries! See #368.
|
2015-07-23 14:33:22 -05:00
|
|
|
*/
|
2015-01-25 20:40:00 -06:00
|
|
|
//#define SDSS 24
|
2016-10-08 15:27:04 -05:00
|
|
|
#define SDSS 31
|
|
|
|
|
2017-08-23 18:20:40 -05:00
|
|
|
#if ENABLED(IS_MELZI)
|
|
|
|
#define LED_PIN 27
|
2016-10-08 15:27:04 -05:00
|
|
|
#elif MB(STB_11)
|
2018-03-28 12:51:59 -05:00
|
|
|
#define LCD_BACKLIGHT_PIN 17 // LCD backlight LED
|
2016-10-08 15:27:04 -05:00
|
|
|
#endif
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2017-04-07 13:52:21 -05:00
|
|
|
#if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
|
2018-03-28 12:51:59 -05:00
|
|
|
#define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available
|
2017-04-07 13:52:21 -05:00
|
|
|
#endif
|
|
|
|
|
2017-08-23 18:20:40 -05:00
|
|
|
/**
|
|
|
|
* Sanguinololu 1.4 AUX pins:
|
|
|
|
*
|
|
|
|
* PWM TX1 RX1 SDA SCL
|
|
|
|
* 12V 5V D12 D11 D10 D17 D16
|
|
|
|
* GND GND D31 D30 D29 D28 D27
|
|
|
|
* A4 A3 A2 A1 A0
|
|
|
|
*/
|
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
//
|
|
|
|
// LCD / Controller
|
|
|
|
//
|
2018-11-09 00:07:16 -06:00
|
|
|
#if ENABLED(ULTRA_LCD)
|
2015-07-23 14:33:22 -05:00
|
|
|
|
2015-07-31 00:11:19 -05:00
|
|
|
#if ENABLED(DOGLCD)
|
2015-07-23 14:33:22 -05:00
|
|
|
|
2016-10-08 15:27:04 -05:00
|
|
|
#if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
|
2015-07-23 14:33:22 -05:00
|
|
|
|
2017-08-23 18:20:40 -05:00
|
|
|
#if ENABLED(IS_MELZI)
|
2018-03-28 12:51:59 -05:00
|
|
|
#define LCD_PINS_RS 30 // CS chip select /SS chip slave select
|
|
|
|
#define LCD_PINS_ENABLE 29 // SID (MOSI)
|
|
|
|
#define LCD_PINS_D4 17 // SCK (CLK) clock
|
2016-06-04 14:29:01 -05:00
|
|
|
// Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
|
|
|
|
// Marlin so this can be used for BEEPER_PIN. You can use this pin
|
|
|
|
// with M42 instead of BEEPER_PIN.
|
|
|
|
#define BEEPER_PIN 27
|
2017-08-23 18:20:40 -05:00
|
|
|
#else // Sanguinololu >=1.3
|
2015-10-03 01:08:58 -05:00
|
|
|
#define LCD_PINS_RS 4
|
|
|
|
#define LCD_PINS_ENABLE 17
|
|
|
|
#define LCD_PINS_D4 30
|
2015-07-23 14:33:22 -05:00
|
|
|
#define LCD_PINS_D5 29
|
|
|
|
#define LCD_PINS_D6 28
|
|
|
|
#define LCD_PINS_D7 27
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else // DOGM SPI LCD Support
|
|
|
|
|
|
|
|
#define DOGLCD_A0 30
|
|
|
|
|
2017-02-12 02:07:03 -06:00
|
|
|
#if ENABLED(MAKRPANEL)
|
|
|
|
|
|
|
|
#define BEEPER_PIN 29
|
|
|
|
#define DOGLCD_CS 17
|
2018-03-28 12:51:59 -05:00
|
|
|
#define LCD_BACKLIGHT_PIN 28 // PA3
|
2017-02-12 02:07:03 -06:00
|
|
|
|
2018-04-20 16:17:25 -05:00
|
|
|
#elif ENABLED(IS_MELZI)
|
2018-01-15 03:14:23 -06:00
|
|
|
|
|
|
|
#define BEEPER_PIN 27
|
|
|
|
#define DOGLCD_CS 28
|
|
|
|
|
2017-02-12 02:07:03 -06:00
|
|
|
#else // !MAKRPANEL
|
|
|
|
|
|
|
|
#define DOGLCD_CS 29
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2015-07-23 14:33:22 -05:00
|
|
|
#endif
|
2015-10-03 01:08:58 -05:00
|
|
|
|
2015-07-23 14:33:22 -05:00
|
|
|
// Uncomment screen orientation
|
|
|
|
#define LCD_SCREEN_ROT_0
|
2015-09-15 12:36:08 -05:00
|
|
|
//#define LCD_SCREEN_ROT_90
|
|
|
|
//#define LCD_SCREEN_ROT_180
|
|
|
|
//#define LCD_SCREEN_ROT_270
|
2015-07-23 14:33:22 -05:00
|
|
|
|
2017-02-12 02:07:03 -06:00
|
|
|
#else // !DOGLCD
|
2015-07-23 14:33:22 -05:00
|
|
|
|
|
|
|
#define LCD_PINS_RS 4
|
|
|
|
#define LCD_PINS_ENABLE 17
|
|
|
|
#define LCD_PINS_D4 30
|
|
|
|
#define LCD_PINS_D5 29
|
|
|
|
#define LCD_PINS_D6 28
|
|
|
|
#define LCD_PINS_D7 27
|
|
|
|
|
|
|
|
#endif // !DOGLCD
|
|
|
|
|
2015-07-31 00:11:19 -05:00
|
|
|
#if ENABLED(LCD_I2C_PANELOLU2)
|
2017-07-01 22:23:03 -05:00
|
|
|
|
2017-08-23 18:20:40 -05:00
|
|
|
#if ENABLED(IS_MELZI)
|
2015-07-23 14:33:22 -05:00
|
|
|
#define BTN_ENC 29
|
2018-03-28 12:51:59 -05:00
|
|
|
#define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi
|
2015-07-23 14:33:22 -05:00
|
|
|
#else
|
|
|
|
#define BTN_ENC 30
|
|
|
|
#endif
|
2017-07-01 22:23:03 -05:00
|
|
|
|
|
|
|
#elif ENABLED(LCD_FOR_MELZI)
|
|
|
|
|
|
|
|
#define LCD_PINS_RS 17
|
|
|
|
#define LCD_PINS_ENABLE 16
|
|
|
|
#define LCD_PINS_D4 11
|
|
|
|
#define BTN_ENC 28
|
|
|
|
#define BTN_EN1 29
|
|
|
|
#define BTN_EN2 30
|
|
|
|
|
|
|
|
#ifndef ST7920_DELAY_1
|
2018-05-12 08:34:04 -05:00
|
|
|
#define ST7920_DELAY_1 DELAY_NS(0)
|
2017-07-01 22:23:03 -05:00
|
|
|
#endif
|
2017-09-27 02:48:54 -05:00
|
|
|
#ifndef ST7920_DELAY_2
|
2018-05-12 08:34:04 -05:00
|
|
|
#define ST7920_DELAY_2 DELAY_NS(188)
|
2017-07-01 22:23:03 -05:00
|
|
|
#endif
|
|
|
|
#ifndef ST7920_DELAY_3
|
2018-05-12 08:34:04 -05:00
|
|
|
#define ST7920_DELAY_3 DELAY_NS(0)
|
2017-07-01 22:23:03 -05:00
|
|
|
#endif
|
|
|
|
|
2017-12-15 19:05:57 -06:00
|
|
|
#elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
|
|
|
|
|
|
|
|
#define LCD_PINS_RS 28
|
|
|
|
#define LCD_PINS_ENABLE 29
|
|
|
|
#define LCD_PINS_D4 10
|
|
|
|
#define LCD_PINS_D5 11
|
|
|
|
#define LCD_PINS_D6 16
|
|
|
|
#define LCD_PINS_D7 17
|
|
|
|
#define ADC_KEYPAD_PIN 1
|
|
|
|
|
|
|
|
#define BTN_EN1 -1
|
|
|
|
#define BTN_EN2 -1
|
|
|
|
|
|
|
|
#else // !LCD_I2C_PANELOLU2 && !LCD_FOR_MELZI && !ZONESTAR_LCD
|
2017-07-01 22:23:03 -05:00
|
|
|
|
2015-07-23 14:33:22 -05:00
|
|
|
#define BTN_ENC 16
|
2018-03-28 12:51:59 -05:00
|
|
|
#define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi
|
2017-07-01 22:23:03 -05:00
|
|
|
|
|
|
|
#endif
|
2015-07-23 14:33:22 -05:00
|
|
|
|
2018-11-09 00:07:16 -06:00
|
|
|
#if ENABLED(NEWPANEL) && !defined(BTN_EN1)
|
|
|
|
#define BTN_EN1 11
|
|
|
|
#define BTN_EN2 10
|
|
|
|
#endif
|
|
|
|
|
2015-07-31 18:40:50 -05:00
|
|
|
#define SD_DETECT_PIN -1
|
2015-01-25 20:40:00 -06:00
|
|
|
|
2018-11-09 00:07:16 -06:00
|
|
|
#endif // ULTRA_LCD
|
2017-04-07 13:52:21 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// M3/M4/M5 - Spindle/Laser Control
|
|
|
|
//
|
|
|
|
#if ENABLED(SPINDLE_LASER_ENABLE)
|
|
|
|
#if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)) // try to use IO Header
|
|
|
|
|
2018-03-28 12:51:59 -05:00
|
|
|
#define SPINDLE_LASER_ENABLE_PIN 10 // Pin should have a pullup/pulldown!
|
|
|
|
#define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM
|
2017-04-07 13:52:21 -05:00
|
|
|
#define SPINDLE_DIR_PIN 11
|
|
|
|
|
|
|
|
#elif !MB(MELZI) // use X stepper motor socket
|
|
|
|
|
|
|
|
/**
|
|
|
|
* To control the spindle speed and have an LCD you must sacrifice
|
|
|
|
* the Extruder and pull some signals off the X stepper driver socket.
|
|
|
|
*
|
|
|
|
* The following assumes:
|
|
|
|
* - The X stepper driver socket is empty
|
|
|
|
* - The extruder driver socket has a driver board plugged into it
|
|
|
|
* - The X stepper wires are attached the the extruder connector
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Where to get the spindle signals
|
|
|
|
*
|
|
|
|
* spindle signal socket name socket name
|
|
|
|
* -------
|
|
|
|
* /ENABLE O| |O VMOT
|
|
|
|
* MS1 O| |O GND
|
|
|
|
* MS2 O| |O 2B
|
|
|
|
* MS3 O| |O 2A
|
|
|
|
* /RESET O| |O 1A
|
|
|
|
* /SLEEP O| |O 1B
|
2017-08-23 18:20:40 -05:00
|
|
|
* SPINDLE_LASER_PWM_PIN STEP O| |O VDD
|
2017-04-07 13:52:21 -05:00
|
|
|
* SPINDLE_LASER_ENABLE_PIN DIR O| |O GND
|
|
|
|
* -------
|
|
|
|
*
|
|
|
|
* Note: Socket names vary from vendor to vendor.
|
|
|
|
*/
|
|
|
|
#undef X_DIR_PIN
|
|
|
|
#undef X_ENABLE_PIN
|
|
|
|
#undef X_STEP_PIN
|
|
|
|
#define X_DIR_PIN 0
|
|
|
|
#define X_ENABLE_PIN 14
|
|
|
|
#define X_STEP_PIN 1
|
2018-03-28 12:51:59 -05:00
|
|
|
#define SPINDLE_LASER_PWM_PIN 15 // MUST BE HARDWARE PWM
|
|
|
|
#define SPINDLE_LASER_ENABLE_PIN 21 // Pin should have a pullup!
|
|
|
|
#define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin
|
2017-04-07 13:52:21 -05:00
|
|
|
#endif
|
|
|
|
#endif // SPINDLE_LASER_ENABLE
|