diff --git a/grbl/config.h b/grbl/config.h index 9208a29..53dad9d 100644 --- a/grbl/config.h +++ b/grbl/config.h @@ -185,7 +185,7 @@ // immediately forces a feed hold and then safely de-energizes the machine. Resuming is blocked until // the safety door is re-engaged. When it is, Grbl will re-energize the machine and then resume on the // previous tool path, as if nothing happened. -// #define ENABLE_SAFETY_DOOR_INPUT_PIN // Default disabled. Uncomment to enable. +#define ENABLE_SAFETY_DOOR_INPUT_PIN // Default disabled. Uncomment to enable. // After the safety door switch has been toggled and restored, this setting sets the power-up delay // between restoring the spindle and coolant and resuming the cycle. @@ -199,7 +199,7 @@ // defined at (http://corexy.com/theory.html). Motors are assumed to positioned and wired exactly as // described, if not, motions may move in strange directions. Grbl requires the CoreXY A and B motors // have the same steps per mm internally. -//#define COREXY // Default disabled. Uncomment to enable. +#define COREXY // Default disabled. Uncomment to enable. // Inverts pin logic of the control command pins based on a mask. This essentially means you can use // normally-closed switches on the specified pins, rather than the default normally-open switches. @@ -221,7 +221,7 @@ // NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and // spindle enable are combined to one pin. If you need both this option and spindle speed PWM, // uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below. -// not ported #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable. +#define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable. // Inverts the selected coolant pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful // for some pre-built electronic boards. @@ -384,13 +384,13 @@ // By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help // preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses -// the spindle direction pin(D13) as a separate spindle enable pin along with spindle speed PWM on pin D11. -// NOTE: This configure option only works with VARIABLE_SPINDLE enabled and a 328p processor (Uno). -// NOTE: Without a direction pin, M4 will not have a pin output to indicate a difference with M3. +// the spindle direction pin (defined in cpu-map.h) as a separate spindle enable pin along with spindle speed PWM pin. +// NOTE: This configure option only works with VARIABLE_SPINDLE enabled. +// NOTE: Without a direction pin, M4 will not have a pin output to indicate a difference with M3. // NOTE: BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with // a programmer (you can use a spare Arduino as "Arduino as ISP". Search the web on how to wire this.), // this D13 LED toggling should go away. We haven't tested this though. Please report how it goes! -// not ported #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable. +#define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable. // Alters the behavior of the spindle enable pin with the USE_SPINDLE_DIR_AS_ENABLE_PIN option . By default, // Grbl will not disable the enable pin if spindle speed is zero and M3/4 is active, but still sets the PWM diff --git a/grbl/cpu_map.h b/grbl/cpu_map.h index 4b48c53..ee92e6d 100644 --- a/grbl/cpu_map.h +++ b/grbl/cpu_map.h @@ -191,13 +191,25 @@ #define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25 #define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27 #define Z_LIMIT_BIT 28 // Z-MIN=28, Z-MAX=29 - #define A_LIMIT_BIT 29 // reuse p1.29 + #define A_LIMIT_BIT 29 // reuse Z-MAX (P1.29) #define LIMIT_MASK ((1<FIODIR + #define SPINDLE_ENABLE_PORT LPC_GPIO1->FIOPIN + #define SPINDLE_ENABLE_BIT 30 // P1.30 + #define SPINDLE_DIRECTION_DDR LPC_GPIO1->FIODIR + #define SPINDLE_DIRECTION_PORT LPC_GPIO1->FIOPIN + #define SPINDLE_DIRECTION_BIT 31 // P1.31 + // Define flood and mist coolant enable output pins. #define COOLANT_FLOOD_DDR LPC_GPIO2->FIODIR #define COOLANT_FLOOD_PORT LPC_GPIO2->FIOPIN - #define COOLANT_FLOOD_BIT 4 // SMALL MOSFET Q8 (P2.4) + #ifndef SPINDLE_PWM_PIN_2_4 + #define COOLANT_FLOOD_BIT 4 // SMALL MOSFET Q8 (P2.4) + #else + #define COOLANT_FLOOD_BIT 5 // SMALL MOSFET Q8 (P2.5) + #endif #define COOLANT_MIST_DDR LPC_GPIO2->FIODIR #define COOLANT_MIST_PORT LPC_GPIO2->FIOPIN #define COOLANT_MIST_BIT 6 // SMALL MOSFET Q9 (P2.6) @@ -205,13 +217,13 @@ // Define user-control controls (cycle start, reset, feed hold) input pins. // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits). - #define CONTROL_DDR NotUsed - #define CONTROL_PIN NotUsed - #define CONTROL_PORT NotUsed - #define CONTROL_RESET_BIT 0 // Uno Analog Pin 0 - #define CONTROL_FEED_HOLD_BIT 1 // Uno Analog Pin 1 - #define CONTROL_CYCLE_START_BIT 2 // Uno Analog Pin 2 - #define CONTROL_SAFETY_DOOR_BIT 1 // Uno Analog Pin 1 NOTE: Safety door is shared with feed hold. Enabled by config define. + #define CONTROL_DDR LPC_GPIO1->FIODIR + #define CONTROL_PIN LPC_GPIO1->FIOPIN + #define CONTROL_PORT LPC_GPIO1->FIOPIN + #define CONTROL_RESET_BIT NotUsed // Not needed as there is a special RESET pin on the Smoothiebaord + #define CONTROL_FEED_HOLD_BIT 22 // P1.22 + #define CONTROL_CYCLE_START_BIT 23 // P1.23 + #define CONTROL_SAFETY_DOOR_BIT 22 // P1.22 NOTE: Safety door is shared with feed hold. Enabled by config define. #define CONTROL_INT PCIE1 // Pin change interrupt enable pin #define CONTROL_INT_vect PCINT1_vect #define CONTROL_PCMSK NotUsed // Pin change interrupt register @@ -219,10 +231,10 @@ #define CONTROL_INVERT_MASK CONTROL_MASK // May be re-defined to only invert certain control pins. // Define probe switch input pin. - #define PROBE_DDR NotUsed - #define PROBE_PIN NotUsed - #define PROBE_PORT NotUsed - #define PROBE_BIT 5 // Uno Analog Pin 5 + #define PROBE_DDR LPC_GPIO2->FIODIR + #define PROBE_PIN LPC_GPIO2->FIOPIN + #define PROBE_PORT LPC_GPIO2->FIOPIN + #define PROBE_BIT 11 // P2.11 #define PROBE_MASK (1<FIODIR + #define SPINDLE_ENABLE_PORT LPC_GPIO1->FIOPIN + #define SPINDLE_ENABLE_BIT 30 // P1.30 + #define SPINDLE_DIRECTION_DDR LPC_GPIO1->FIODIR + #define SPINDLE_DIRECTION_PORT LPC_GPIO1->FIOPIN + #define SPINDLE_DIRECTION_BIT 31 // P1.31 + // Define flood and mist coolant enable output pins. #define COOLANT_FLOOD_DDR LPC_GPIO2->FIODIR #define COOLANT_FLOOD_PORT LPC_GPIO2->FIOPIN @@ -520,13 +540,13 @@ // Define user-control controls (cycle start, reset, feed hold) input pins. // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits). - #define CONTROL_DDR NotUsed - #define CONTROL_PIN NotUsed - #define CONTROL_PORT NotUsed - #define CONTROL_RESET_BIT 0 // Uno Analog Pin 0 - #define CONTROL_FEED_HOLD_BIT 1 // Uno Analog Pin 1 - #define CONTROL_CYCLE_START_BIT 2 // Uno Analog Pin 2 - #define CONTROL_SAFETY_DOOR_BIT 1 // Uno Analog Pin 1 NOTE: Safety door is shared with feed hold. Enabled by config define. + #define CONTROL_DDR LPC_GPIO1->FIODIR + #define CONTROL_PIN LPC_GPIO1->FIOPIN + #define CONTROL_PORT LPC_GPIO1->FIOPIN + #define CONTROL_RESET_BIT NotUsed // Not needed as there is a special RESET pin on the Smoothiebaord + #define CONTROL_FEED_HOLD_BIT 22 // P1.22 + #define CONTROL_CYCLE_START_BIT 23 // P1.23 + #define CONTROL_SAFETY_DOOR_BIT 22 // P1.22 NOTE: Safety door is shared with feed hold. Enabled by config define. #define CONTROL_INT PCIE1 // Pin change interrupt enable pin #define CONTROL_INT_vect PCINT1_vect #define CONTROL_PCMSK NotUsed // Pin change interrupt register @@ -534,10 +554,10 @@ #define CONTROL_INVERT_MASK CONTROL_MASK // May be re-defined to only invert certain control pins. // Define probe switch input pin. - #define PROBE_DDR NotUsed - #define PROBE_PIN NotUsed - #define PROBE_PORT NotUsed - #define PROBE_BIT 5 // Uno Analog Pin 5 + #define PROBE_DDR LPC_GPIO2->FIODIR + #define PROBE_PIN LPC_GPIO2->FIOPIN + #define PROBE_PORT LPC_GPIO2->FIOPIN + #define PROBE_BIT 11 // P2.11 #define PROBE_MASK (1<