2013-10-30 02:10:39 +01:00
|
|
|
/*
|
2013-12-31 02:44:46 +01:00
|
|
|
cpu_map.h - CPU and pin mapping configuration file
|
2014-08-07 13:58:04 +02:00
|
|
|
Part of Grbl v0.9
|
2013-10-30 02:10:39 +01:00
|
|
|
|
2014-08-07 13:58:04 +02:00
|
|
|
Copyright (c) 2012-2014 Sungeun K. Jeon
|
2013-10-30 02:10:39 +01:00
|
|
|
|
|
|
|
Grbl 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.
|
|
|
|
|
|
|
|
Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-12-31 02:44:46 +01:00
|
|
|
/* The cpu_map.h file serves as a central pin mapping settings file for different processor
|
2013-10-30 02:10:39 +01:00
|
|
|
types, i.e. AVR 328p or AVR Mega 2560. Grbl officially supports the Arduino Uno, but the
|
|
|
|
other supplied pin mappings are supplied by users, so your results may vary. */
|
|
|
|
|
2013-12-31 02:44:46 +01:00
|
|
|
// NOTE: This is still a work in progress. We are still centralizing the configurations to
|
|
|
|
// this file, so your success may vary for other CPUs.
|
2013-10-30 02:10:39 +01:00
|
|
|
|
2013-12-31 02:44:46 +01:00
|
|
|
#ifndef cpu_map_h
|
|
|
|
#define cpu_map_h
|
|
|
|
|
2014-09-05 23:38:17 +02:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
2014-09-05 23:38:17 +02:00
|
|
|
#ifdef CPU_MAP_ATMEGA328P_TRADITIONAL // (Arduino Uno) Officially supported by Grbl.
|
2013-10-30 02:10:39 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define serial port pins and interrupt vectors.
|
2013-10-30 02:10:39 +01:00
|
|
|
#define SERIAL_RX USART_RX_vect
|
|
|
|
#define SERIAL_UDRE USART_UDRE_vect
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define step pulse output pins. NOTE: All step bit pins must be on the same port.
|
2014-02-09 18:46:34 +01:00
|
|
|
#define STEP_DDR DDRD
|
|
|
|
#define STEP_PORT PORTD
|
2014-01-04 20:12:44 +01:00
|
|
|
#define X_STEP_BIT 2 // Uno Digital Pin 2
|
|
|
|
#define Y_STEP_BIT 3 // Uno Digital Pin 3
|
|
|
|
#define Z_STEP_BIT 4 // Uno Digital Pin 4
|
|
|
|
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits
|
|
|
|
|
|
|
|
// Define step direction output pins. NOTE: All direction pins must be on the same port.
|
|
|
|
#define DIRECTION_DDR DDRD
|
|
|
|
#define DIRECTION_PORT PORTD
|
|
|
|
#define X_DIRECTION_BIT 5 // Uno Digital Pin 5
|
|
|
|
#define Y_DIRECTION_BIT 6 // Uno Digital Pin 6
|
|
|
|
#define Z_DIRECTION_BIT 7 // Uno Digital Pin 7
|
|
|
|
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits
|
|
|
|
|
|
|
|
// Define stepper driver enable/disable output pin.
|
2013-10-30 02:10:39 +01:00
|
|
|
#define STEPPERS_DISABLE_DDR DDRB
|
|
|
|
#define STEPPERS_DISABLE_PORT PORTB
|
|
|
|
#define STEPPERS_DISABLE_BIT 0 // Uno Digital Pin 8
|
2014-01-04 20:12:44 +01:00
|
|
|
#define STEPPERS_DISABLE_MASK (1<<STEPPERS_DISABLE_BIT)
|
|
|
|
|
|
|
|
// Define homing/hard limit switch input pins and limit interrupt vectors.
|
|
|
|
// NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (pinout).
|
|
|
|
#define LIMIT_DDR DDRB
|
|
|
|
#define LIMIT_PIN PINB
|
|
|
|
#define LIMIT_PORT PORTB
|
|
|
|
#define X_LIMIT_BIT 1 // Uno Digital Pin 9
|
|
|
|
#define Y_LIMIT_BIT 2 // Uno Digital Pin 10
|
|
|
|
#ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
|
|
|
|
#define Z_LIMIT_BIT 4 // Uno Digital Pin 12
|
2014-01-02 05:42:22 +01:00
|
|
|
#else
|
2014-01-04 20:12:44 +01:00
|
|
|
#define Z_LIMIT_BIT 3 // Uno Digital Pin 11
|
2014-01-02 05:42:22 +01:00
|
|
|
#endif
|
2014-01-04 20:12:44 +01:00
|
|
|
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
|
|
|
|
#define LIMIT_INT PCIE0 // Pin change interrupt enable pin
|
|
|
|
#define LIMIT_INT_vect PCINT0_vect
|
|
|
|
#define LIMIT_PCMSK PCMSK0 // Pin change interrupt register
|
|
|
|
|
|
|
|
// Define spindle enable and spindle direction output pins.
|
|
|
|
#define SPINDLE_ENABLE_DDR DDRB
|
|
|
|
#define SPINDLE_ENABLE_PORT PORTB
|
|
|
|
#ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
|
|
|
|
#define SPINDLE_ENABLE_BIT 3 // Uno Digital Pin 11
|
|
|
|
#else
|
|
|
|
#define SPINDLE_ENABLE_BIT 4 // Uno Digital Pin 12
|
|
|
|
#endif
|
2013-10-30 02:10:39 +01:00
|
|
|
#define SPINDLE_DIRECTION_DDR DDRB
|
|
|
|
#define SPINDLE_DIRECTION_PORT PORTB
|
|
|
|
#define SPINDLE_DIRECTION_BIT 5 // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.)
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define flood and mist coolant enable output pins.
|
|
|
|
// NOTE: Uno analog pins 4 and 5 are reserved for an i2c interface, and may be installed at
|
|
|
|
// a later date if flash and memory space allows.
|
2013-10-30 02:10:39 +01:00
|
|
|
#define COOLANT_FLOOD_DDR DDRC
|
|
|
|
#define COOLANT_FLOOD_PORT PORTC
|
|
|
|
#define COOLANT_FLOOD_BIT 3 // Uno Analog Pin 3
|
2014-01-04 20:12:44 +01:00
|
|
|
#ifdef ENABLE_M7 // Mist coolant disabled by default. See config.h to enable/disable.
|
2013-10-30 02:10:39 +01:00
|
|
|
#define COOLANT_MIST_DDR DDRC
|
|
|
|
#define COOLANT_MIST_PORT PORTC
|
|
|
|
#define COOLANT_MIST_BIT 4 // Uno Analog Pin 4
|
|
|
|
#endif
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define user-control pinouts (cycle start, reset, feed hold) input pins.
|
|
|
|
// NOTE: All pinouts pins must be on the same port and not on a port with other input pins (limits).
|
2013-10-30 02:10:39 +01:00
|
|
|
#define PINOUT_DDR DDRC
|
|
|
|
#define PINOUT_PIN PINC
|
|
|
|
#define PINOUT_PORT PORTC
|
|
|
|
#define PIN_RESET 0 // Uno Analog Pin 0
|
|
|
|
#define PIN_FEED_HOLD 1 // Uno Analog Pin 1
|
|
|
|
#define PIN_CYCLE_START 2 // Uno Analog Pin 2
|
|
|
|
#define PINOUT_INT PCIE1 // Pin change interrupt enable pin
|
|
|
|
#define PINOUT_INT_vect PCINT1_vect
|
|
|
|
#define PINOUT_PCMSK PCMSK1 // Pin change interrupt register
|
G38.2 probe feature rough draft installed. Working but needs testing.
- G38.2 straight probe now supported. Rough draft. May be tweaked more
as testing ramps up.
- G38.2 requires at least one axis word. Multiple axis words work too.
When commanded, the probe cycle will move at the last ‘F’ feed rate
specified in a straight line.
- During a probe cycle: If the probe pin goes low (normal high), Grbl
will record that immediate position and engage a feed hold. Meaning
that the CNC machine will move a little past the probe switch point, so
keep federates low to stop sooner. Once stopped, Grbl will issue a move
to go back to the recorded probe trigger point.
- During a probe cycle: If the probe switch does not engage by the time
the machine has traveled to its target coordinates, Grbl will issue an
ALARM and the user will be forced to reset Grbl. (Currently G38.3 probe
without error isn’t supported, but would be easy to implement later.)
- After a successful probe, Grbl will send a feedback message
containing the recorded probe coordinates in the machine coordinate
system. This is as the g-code standard on probe parameters specifies.
- The recorded probe parameters are retained in Grbl memory and can be
viewed with the ‘$#’ print parameters command. Upon a power-cycle, not
a soft-reset, Grbl will re-zero these values.
- Moved ‘$#’ command to require IDLE or ALARM mode, because it accesses
EEPROM to fetch the coordinate system offsets.
- Updated the Grbl version to v0.9d.
- The probe cycle is subject to change upon testing or user-feedback.
2014-03-01 06:03:26 +01:00
|
|
|
#define PINOUT_MASK ((1<<PIN_RESET)|(1<<PIN_FEED_HOLD)|(1<<PIN_CYCLE_START))
|
|
|
|
|
|
|
|
// Define probe switch input pin.
|
|
|
|
#define PROBE_DDR DDRC
|
|
|
|
#define PROBE_PIN PINC
|
|
|
|
#define PROBE_PORT PORTC
|
|
|
|
#define PROBE_BIT 5 // Uno Analog Pin 5
|
|
|
|
#define PROBE_MASK (1<<PROBE_BIT)
|
|
|
|
|
2013-10-30 02:10:39 +01:00
|
|
|
|
2014-09-05 23:38:17 +02:00
|
|
|
#ifdef VARIABLE_SPINDLE
|
|
|
|
// Advanced Configuration Below You should not need to touch these variables
|
|
|
|
#define TCCRA_REGISTER TCCR2A
|
|
|
|
#define TCCRB_REGISTER TCCR2B
|
|
|
|
#define OCR_REGISTER OCR2A
|
|
|
|
|
|
|
|
#define COMB_BIT COM2A1
|
|
|
|
#define WAVE0_REGISTER WGM20
|
|
|
|
#define WAVE1_REGISTER WGM21
|
|
|
|
#define WAVE2_REGISTER WGM22
|
|
|
|
#define WAVE3_REGISTER WGM23
|
|
|
|
|
|
|
|
// NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
|
|
|
|
#define SPINDLE_PWM_DDR SPINDLE_ENABLE_DDR
|
|
|
|
#define SPINDLE_PWM_PORT SPINDLE_ENABLE_PORT
|
|
|
|
#define SPINDLE_PWM_BIT SPINDLE_ENABLE_BIT // Shared with SPINDLE_ENABLE.
|
|
|
|
#endif // End of VARIABLE_SPINDLE
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
2014-09-05 23:46:55 +02:00
|
|
|
#ifdef CPU_MAP_ATMEGA328P_NEW // (Arduino Uno) New test pinout configuration. Still subject to change. Not finalized!
|
2014-09-05 23:38:17 +02:00
|
|
|
|
|
|
|
// Define serial port pins and interrupt vectors.
|
|
|
|
#define SERIAL_RX USART_RX_vect
|
|
|
|
#define SERIAL_UDRE USART_UDRE_vect
|
|
|
|
|
|
|
|
// Define step pulse output pins. NOTE: All step bit pins must be on the same port.
|
|
|
|
#define STEP_DDR DDRD
|
|
|
|
#define STEP_PORT PORTD
|
|
|
|
#define X_STEP_BIT 2 // Uno Digital Pin 2
|
|
|
|
#define Y_STEP_BIT 3 // Uno Digital Pin 3
|
|
|
|
#define Z_STEP_BIT 4 // Uno Digital Pin 4
|
|
|
|
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits
|
|
|
|
|
|
|
|
// Define step direction output pins. NOTE: All direction pins must be on the same port.
|
|
|
|
#define DIRECTION_DDR DDRD
|
|
|
|
#define DIRECTION_PORT PORTD
|
|
|
|
#define X_DIRECTION_BIT 5 // Uno Digital Pin 5
|
|
|
|
#define Y_DIRECTION_BIT 6 // Uno Digital Pin 6
|
|
|
|
#define Z_DIRECTION_BIT 7 // Uno Digital Pin 7
|
|
|
|
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits
|
|
|
|
|
|
|
|
// Define stepper driver enable/disable output pin.
|
|
|
|
#define STEPPERS_DISABLE_DDR DDRB
|
|
|
|
#define STEPPERS_DISABLE_PORT PORTB
|
|
|
|
#define STEPPERS_DISABLE_BIT 0 // Uno Digital Pin 8
|
|
|
|
#define STEPPERS_DISABLE_MASK (1<<STEPPERS_DISABLE_BIT)
|
|
|
|
|
|
|
|
// Define homing/hard limit switch input pins and limit interrupt vectors.
|
|
|
|
// NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (pinout).
|
|
|
|
#define LIMIT_DDR DDRB
|
|
|
|
#define LIMIT_PIN PINB
|
|
|
|
#define LIMIT_PORT PORTB
|
|
|
|
#define X_LIMIT_BIT 1 // Uno Digital Pin 9
|
|
|
|
#define Y_LIMIT_BIT 2 // Uno Digital Pin 10
|
|
|
|
#ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
|
|
|
|
#define Z_LIMIT_BIT 4 // Uno Digital Pin 12
|
|
|
|
#else
|
|
|
|
#define Z_LIMIT_BIT 3 // Uno Digital Pin 11
|
|
|
|
#endif
|
|
|
|
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
|
|
|
|
#define LIMIT_INT PCIE0 // Pin change interrupt enable pin
|
|
|
|
#define LIMIT_INT_vect PCINT0_vect
|
|
|
|
#define LIMIT_PCMSK PCMSK0 // Pin change interrupt register
|
|
|
|
|
|
|
|
// Define spindle enable and spindle direction output pins.
|
|
|
|
#define SPINDLE_ENABLE_DDR DDRB
|
|
|
|
#define SPINDLE_ENABLE_PORT PORTB
|
|
|
|
#ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
|
|
|
|
#define SPINDLE_ENABLE_BIT 3 // Uno Digital Pin 11
|
|
|
|
#else
|
|
|
|
#define SPINDLE_ENABLE_BIT 4 // Uno Digital Pin 12
|
|
|
|
#endif
|
|
|
|
#define SPINDLE_DIRECTION_DDR DDRB
|
|
|
|
#define SPINDLE_DIRECTION_PORT PORTB
|
|
|
|
#define SPINDLE_DIRECTION_BIT 5 // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.)
|
|
|
|
|
|
|
|
// Define flood and mist coolant enable output pins.
|
|
|
|
// NOTE: Uno analog pins 4 and 5 are reserved for an i2c interface, and may be installed at
|
|
|
|
// a later date if flash and memory space allows.
|
|
|
|
#define COOLANT_FLOOD_DDR DDRC
|
|
|
|
#define COOLANT_FLOOD_PORT PORTC
|
2014-10-02 04:22:16 +02:00
|
|
|
#define COOLANT_FLOOD_BIT 1 // Uno Analog Pin 1
|
2014-09-05 23:38:17 +02:00
|
|
|
#ifdef ENABLE_M7 // Mist coolant disabled by default. See config.h to enable/disable.
|
|
|
|
#define COOLANT_MIST_DDR DDRC
|
|
|
|
#define COOLANT_MIST_PORT PORTC
|
2014-10-02 04:22:16 +02:00
|
|
|
#define COOLANT_MIST_BIT 2 // Uno Analog Pin 2
|
2014-09-05 23:38:17 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Define user-control pinouts (cycle start, reset, feed hold) input pins.
|
|
|
|
// NOTE: All pinouts pins must be on the same port and not on a port with other input pins (limits).
|
|
|
|
#define PINOUT_DDR DDRC
|
|
|
|
#define PINOUT_PIN PINC
|
|
|
|
#define PINOUT_PORT PORTC
|
2014-10-02 04:22:16 +02:00
|
|
|
#define PIN_RESET 3 // Uno Analog Pin 3
|
|
|
|
#define PIN_FEED_HOLD 4 // Uno Analog Pin 4
|
|
|
|
#define PIN_CYCLE_START 5 // Uno Analog Pin 5
|
2014-09-05 23:38:17 +02:00
|
|
|
#define PINOUT_INT PCIE1 // Pin change interrupt enable pin
|
|
|
|
#define PINOUT_INT_vect PCINT1_vect
|
|
|
|
#define PINOUT_PCMSK PCMSK1 // Pin change interrupt register
|
|
|
|
#define PINOUT_MASK ((1<<PIN_RESET)|(1<<PIN_FEED_HOLD)|(1<<PIN_CYCLE_START))
|
|
|
|
|
|
|
|
// Define probe switch input pin.
|
|
|
|
#define PROBE_DDR DDRC
|
|
|
|
#define PROBE_PIN PINC
|
|
|
|
#define PROBE_PORT PORTC
|
|
|
|
#define PROBE_BIT 0 // Uno Analog Pin 0
|
|
|
|
#define PROBE_MASK (1<<PROBE_BIT)
|
|
|
|
|
|
|
|
|
2014-01-02 05:42:22 +01:00
|
|
|
#ifdef VARIABLE_SPINDLE
|
2014-01-04 20:12:44 +01:00
|
|
|
// Advanced Configuration Below You should not need to touch these variables
|
|
|
|
#define TCCRA_REGISTER TCCR2A
|
|
|
|
#define TCCRB_REGISTER TCCR2B
|
|
|
|
#define OCR_REGISTER OCR2A
|
|
|
|
|
|
|
|
#define COMB_BIT COM2A1
|
|
|
|
#define WAVE0_REGISTER WGM20
|
|
|
|
#define WAVE1_REGISTER WGM21
|
|
|
|
#define WAVE2_REGISTER WGM22
|
|
|
|
#define WAVE3_REGISTER WGM23
|
|
|
|
|
|
|
|
// NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
|
|
|
|
#define SPINDLE_PWM_DDR SPINDLE_ENABLE_DDR
|
|
|
|
#define SPINDLE_PWM_PORT SPINDLE_ENABLE_PORT
|
|
|
|
#define SPINDLE_PWM_BIT SPINDLE_ENABLE_BIT // Shared with SPINDLE_ENABLE.
|
2014-01-02 05:42:22 +01:00
|
|
|
#endif // End of VARIABLE_SPINDLE
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
2014-01-02 05:42:22 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
#ifdef CPU_MAP_ATMEGA2560 // (Arduino Mega 2560) Working @EliteEng
|
2013-10-30 02:10:39 +01:00
|
|
|
|
|
|
|
// Serial port pins
|
|
|
|
#define SERIAL_RX USART0_RX_vect
|
|
|
|
#define SERIAL_UDRE USART0_UDRE_vect
|
|
|
|
|
|
|
|
// Increase Buffers to make use of extra SRAM
|
2014-01-02 05:42:22 +01:00
|
|
|
//#define RX_BUFFER_SIZE 256
|
|
|
|
//#define TX_BUFFER_SIZE 128
|
|
|
|
//#define BLOCK_BUFFER_SIZE 36
|
|
|
|
//#define LINE_BUFFER_SIZE 100
|
2013-10-30 02:10:39 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define step pulse output pins. NOTE: All step bit pins must be on the same port.
|
2014-02-09 18:46:34 +01:00
|
|
|
#define STEP_DDR DDRA
|
|
|
|
#define STEP_PORT PORTA
|
|
|
|
#define STEP_PIN PINA
|
2013-10-30 02:10:39 +01:00
|
|
|
#define X_STEP_BIT 2 // MEGA2560 Digital Pin 24
|
|
|
|
#define Y_STEP_BIT 3 // MEGA2560 Digital Pin 25
|
|
|
|
#define Z_STEP_BIT 4 // MEGA2560 Digital Pin 26
|
2014-01-02 05:42:22 +01:00
|
|
|
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits
|
2013-12-31 02:44:46 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define step direction output pins. NOTE: All direction pins must be on the same port.
|
2013-12-31 02:44:46 +01:00
|
|
|
#define DIRECTION_DDR DDRA
|
|
|
|
#define DIRECTION_PORT PORTA
|
|
|
|
#define DIRECTION_PIN PINA
|
2013-10-30 02:10:39 +01:00
|
|
|
#define X_DIRECTION_BIT 5 // MEGA2560 Digital Pin 27
|
|
|
|
#define Y_DIRECTION_BIT 6 // MEGA2560 Digital Pin 28
|
|
|
|
#define Z_DIRECTION_BIT 7 // MEGA2560 Digital Pin 29
|
|
|
|
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define stepper driver enable/disable output pin.
|
2013-10-30 02:10:39 +01:00
|
|
|
#define STEPPERS_DISABLE_DDR DDRB
|
|
|
|
#define STEPPERS_DISABLE_PORT PORTB
|
|
|
|
#define STEPPERS_DISABLE_BIT 7 // MEGA2560 Digital Pin 13
|
|
|
|
#define STEPPERS_DISABLE_MASK (1<<STEPPERS_DISABLE_BIT)
|
|
|
|
|
|
|
|
// NOTE: All limit bit pins must be on the same port
|
|
|
|
#define LIMIT_DDR DDRB
|
|
|
|
#define LIMIT_PORT PORTB
|
|
|
|
#define LIMIT_PIN PINB
|
|
|
|
#define X_LIMIT_BIT 4 // MEGA2560 Digital Pin 10
|
|
|
|
#define Y_LIMIT_BIT 5 // MEGA2560 Digital Pin 11
|
|
|
|
#define Z_LIMIT_BIT 6 // MEGA2560 Digital Pin 12
|
|
|
|
#define LIMIT_INT PCIE0 // Pin change interrupt enable pin
|
|
|
|
#define LIMIT_INT_vect PCINT0_vect
|
|
|
|
#define LIMIT_PCMSK PCMSK0 // Pin change interrupt register
|
|
|
|
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define spindle enable and spindle direction output pins.
|
2014-01-02 05:42:22 +01:00
|
|
|
#define SPINDLE_ENABLE_DDR DDRH
|
|
|
|
#define SPINDLE_ENABLE_PORT PORTH
|
|
|
|
#define SPINDLE_ENABLE_BIT 3 // MEGA2560 Digital Pin 6
|
|
|
|
#define SPINDLE_DIRECTION_DDR DDRE
|
|
|
|
#define SPINDLE_DIRECTION_PORT PORTE
|
|
|
|
#define SPINDLE_DIRECTION_BIT 3 // MEGA2560 Digital Pin 5
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define flood and mist coolant enable output pins.
|
|
|
|
// NOTE: Uno analog pins 4 and 5 are reserved for an i2c interface, and may be installed at
|
|
|
|
// a later date if flash and memory space allows.
|
2014-01-02 05:42:22 +01:00
|
|
|
#define COOLANT_FLOOD_DDR DDRH
|
|
|
|
#define COOLANT_FLOOD_PORT PORTH
|
|
|
|
#define COOLANT_FLOOD_BIT 5 // MEGA2560 Digital Pin 8
|
2014-01-04 20:12:44 +01:00
|
|
|
#ifdef ENABLE_M7 // Mist coolant disabled by default. See config.h to enable/disable.
|
2014-01-02 05:42:22 +01:00
|
|
|
#define COOLANT_MIST_DDR DDRH
|
|
|
|
#define COOLANT_MIST_PORT PORTH
|
|
|
|
#define COOLANT_MIST_BIT 6 // MEGA2560 Digital Pin 9
|
2013-10-30 02:10:39 +01:00
|
|
|
#endif
|
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
// Define user-control pinouts (cycle start, reset, feed hold) input pins.
|
|
|
|
// NOTE: All pinouts pins must be on the same port and not on a port with other input pins (limits).
|
2013-10-30 02:10:39 +01:00
|
|
|
#define PINOUT_DDR DDRK
|
|
|
|
#define PINOUT_PIN PINK
|
|
|
|
#define PINOUT_PORT PORTK
|
|
|
|
#define PIN_RESET 0 // MEGA2560 Analog Pin 8
|
|
|
|
#define PIN_FEED_HOLD 1 // MEGA2560 Analog Pin 9
|
|
|
|
#define PIN_CYCLE_START 2 // MEGA2560 Analog Pin 10
|
|
|
|
#define PINOUT_INT PCIE2 // Pin change interrupt enable pin
|
|
|
|
#define PINOUT_INT_vect PCINT2_vect
|
|
|
|
#define PINOUT_PCMSK PCMSK2 // Pin change interrupt register
|
|
|
|
#define PINOUT_MASK ((1<<PIN_RESET)|(1<<PIN_FEED_HOLD)|(1<<PIN_CYCLE_START))
|
|
|
|
|
2014-03-11 02:23:39 +01:00
|
|
|
// Define probe switch input pin.
|
|
|
|
#define PROBE_DDR DDRK
|
|
|
|
#define PROBE_PIN PINK
|
|
|
|
#define PROBE_PORT PORTK
|
|
|
|
#define PROBE_BIT 3 // MEGA2560 Analog Pin 11
|
|
|
|
#define PROBE_MASK (1<<PROBE_BIT)
|
|
|
|
|
2014-01-02 05:42:22 +01:00
|
|
|
// Start of PWM & Stepper Enabled Spindle
|
|
|
|
#ifdef VARIABLE_SPINDLE
|
2014-01-04 20:12:44 +01:00
|
|
|
// Advanced Configuration Below You should not need to touch these variables
|
2014-03-11 02:23:39 +01:00
|
|
|
// Set Timer up to use TIMER2B which is attached to Digital Pin 9
|
2014-01-04 20:12:44 +01:00
|
|
|
#define TCCRA_REGISTER TCCR2A
|
|
|
|
#define TCCRB_REGISTER TCCR2B
|
|
|
|
#define OCR_REGISTER OCR2B
|
|
|
|
|
|
|
|
#define COMB_BIT COM2B1
|
|
|
|
#define WAVE0_REGISTER WGM20
|
|
|
|
#define WAVE1_REGISTER WGM21
|
|
|
|
#define WAVE2_REGISTER WGM22
|
|
|
|
#define WAVE3_REGISTER WGM23
|
|
|
|
|
|
|
|
#define SPINDLE_PWM_DDR DDRH
|
|
|
|
#define SPINDLE_PWM_PORT PORTH
|
|
|
|
#define SPINDLE_PWM_BIT 6 // MEGA2560 Digital Pin 9
|
|
|
|
#endif // End of VARIABLE_SPINDLE
|
2014-01-02 05:42:22 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
#endif
|
2014-01-02 05:42:22 +01:00
|
|
|
|
2014-01-04 20:12:44 +01:00
|
|
|
//----------------------------------------------------------------------------------------
|
2013-10-30 02:10:39 +01:00
|
|
|
|
|
|
|
/*
|
2013-12-31 02:44:46 +01:00
|
|
|
#ifdef CPU_MAP_CUSTOM_PROC
|
|
|
|
// For a custom pin map or different processor, copy and paste one of the default cpu map
|
2013-10-30 02:10:39 +01:00
|
|
|
// settings above and modify it to your needs. Then, make sure the defined name is also
|
|
|
|
// changed in the config.h file.
|
|
|
|
#endif
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|