8 Commits

6 changed files with 71 additions and 44 deletions

View File

@ -34,7 +34,7 @@ Build notes:
* Install the ARM embeded toolchain (see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) * Install the ARM embeded toolchain (see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
* Include ```make``` and the ```arm-none-eabi-*``` tools in your path. * Include ```make``` and the ```arm-none-eabi-*``` tools in your path.
* Run ```git submodule init``` and ```git submodule update``` before building. * Run ```git submodule init``` and ```git submodule update``` before building.
* Make produces 2 files: * ```make``` produces 2 files:
* ```build/firmware.bin```: this is compatible with the sdcard bootloader. * ```build/firmware.bin```: this is compatible with the sdcard bootloader.
* ```build/grbl.hex```: this is not compatible with the sdcard bootloader. It loads using Flash Magic * ```build/grbl.hex```: this is not compatible with the sdcard bootloader. It loads using Flash Magic
and is primarilly for developers who don't want to keep swapping sdcards. If you flash this, and is primarilly for developers who don't want to keep swapping sdcards. If you flash this,

View File

@ -32,12 +32,15 @@
// Define board type for pin map and default settings. // Define board type for pin map and default settings.
//#define CPU_MAP_SMOOTHIEBOARD // Smoothieboard (NXP LPC1769 MCU) #define CPU_MAP_SMOOTHIEBOARD // Smoothieboard (NXP LPC1769 MCU)
#define CPU_MAP_C3D_REMIX // Cohesion3D Remix (NXP LPC1769 MCU) //#define CPU_MAP_C3D_REMIX // Cohesion3D Remix (NXP LPC1769 MCU)
//#define CPU_MAP_C3D_MINI // Cohesion3D Mini (NXP LPC1769 MCU) //#define CPU_MAP_C3D_MINI // Cohesion3D Mini (NXP LPC1769 MCU)
//#define CPU_MAP_MKS_SBASE // MKS SBASE Board (NXP LPC1768 MCU) //#define CPU_MAP_MKS_SBASE // MKS SBASE Board (NXP LPC1768 MCU)
//#define CPU_MAP_AZTEEG_X5 // Azteeg X5 Board (NXP LPC1769 MCU) //#define CPU_MAP_AZTEEG_X5 // Azteeg X5 Board (NXP LPC1769 MCU)
// Force Spincle PWM Pin 2.4 (default is P2.5)
//#define SPINDLE_PWM_PIN_2_4
// Define machine type for machine specific defaults // Define machine type for machine specific defaults
//#define DEFAULTS_GENERIC //#define DEFAULTS_GENERIC
#define DEFAULTS_K40 #define DEFAULTS_K40
@ -136,7 +139,7 @@
// #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable. // #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.
// Uncomment this define to force Grbl to always set the machine origin at bottom left. // Uncomment this define to force Grbl to always set the machine origin at bottom left.
//#define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable. #define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable.
// Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size // Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size
// and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may // and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may

View File

@ -195,12 +195,13 @@
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits #define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits
// Define flood and mist coolant enable output pins. // Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_DDR NotUsed #define COOLANT_FLOOD_DDR LPC_GPIO2->FIODIR
#define COOLANT_FLOOD_PORT NotUsed #define COOLANT_FLOOD_PORT LPC_GPIO2->FIOPIN
#define COOLANT_FLOOD_BIT 6 // MOSFET 2.6 #define COOLANT_FLOOD_BIT 4 // SMALL MOSFET Q8 (P2.4)
#define COOLANT_MIST_DDR NotUsed #define COOLANT_MIST_DDR LPC_GPIO2->FIODIR
#define COOLANT_MIST_PORT NotUsed #define COOLANT_MIST_PORT LPC_GPIO2->FIOPIN
#define COOLANT_MIST_BIT 7 // MOSFET 2.7 #define COOLANT_MIST_BIT 6 // SMALL MOSFET Q9 (P2.6)
#define ENABLE_M7 // enables COOLANT MIST
// Define user-control controls (cycle start, reset, feed hold) input pins. // 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). // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits).
@ -229,7 +230,11 @@
// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 // PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6
// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 // Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26
// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 // Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5
#define SPINDLE_PWM_CHANNEL PWM1_CH6 #ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false #define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true #define SPINDLE_PWM_USE_SECONDARY_PIN true
@ -334,7 +339,11 @@
// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 // PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6
// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 // Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26
// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 // Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5
#define SPINDLE_PWM_CHANNEL PWM1_CH6 #ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false #define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true #define SPINDLE_PWM_USE_SECONDARY_PIN true
@ -400,10 +409,11 @@
// Define flood and mist coolant enable output pins. // Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_DDR NotUsed #define COOLANT_FLOOD_DDR NotUsed
#define COOLANT_FLOOD_PORT NotUsed #define COOLANT_FLOOD_PORT NotUsed
#define COOLANT_FLOOD_BIT 3 // Uno Analog Pin 3 #define COOLANT_FLOOD_BIT 6 // MOSFET 3 (P2.6)
#define COOLANT_MIST_DDR NotUsed #define COOLANT_MIST_DDR LPC_GPIO2->FIODIR
#define COOLANT_MIST_PORT NotUsed #define COOLANT_MIST_PORT LPC_GPIO2->FIOPIN
#define COOLANT_MIST_BIT 4 // Uno Analog Pin 3 #define COOLANT_MIST_BIT 7 // MOSFET 2 (P2.7)
#define ENABLE_M7 // enables COOLANT MIST
// Define user-control controls (cycle start, reset, feed hold) input pins. // 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). // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits).
@ -432,7 +442,11 @@
// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 // PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6
// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 // Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26
// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 // Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5
#define SPINDLE_PWM_CHANNEL PWM1_CH6 #ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false #define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true #define SPINDLE_PWM_USE_SECONDARY_PIN true
@ -496,12 +510,13 @@
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits #define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits
// Define flood and mist coolant enable output pins. // Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_DDR NotUsed #define COOLANT_FLOOD_DDR LPC_GPIO2->FIODIR
#define COOLANT_FLOOD_PORT NotUsed #define COOLANT_FLOOD_PORT LPC_GPIO2->FIOPIN
#define COOLANT_FLOOD_BIT 3 // Uno Analog Pin 3 #define COOLANT_FLOOD_BIT 6 // MOSFET 2.6
#define COOLANT_MIST_DDR NotUsed #define COOLANT_MIST_DDR LPC_GPIO2->FIODIR
#define COOLANT_MIST_PORT NotUsed #define COOLANT_MIST_PORT LPC_GPIO2->FIOPIN
#define COOLANT_MIST_BIT 4 // Uno Analog Pin 3 #define COOLANT_MIST_BIT 7 // MOSFET 2.7
#define ENABLE_M7 // enables COOLANT MIST
// Define user-control controls (cycle start, reset, feed hold) input pins. // 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). // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits).
@ -530,7 +545,11 @@
// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 // PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6
// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 // Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26
// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 // Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5
#define SPINDLE_PWM_CHANNEL PWM1_CH6 #ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false #define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true #define SPINDLE_PWM_USE_SECONDARY_PIN true
@ -600,12 +619,13 @@
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits #define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<A_LIMIT_BIT)) // All limit bits
// Define flood and mist coolant enable output pins. // Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_DDR NotUsed #define COOLANT_FLOOD_DDR LPC_GPIO2->FIODIR
#define COOLANT_FLOOD_PORT NotUsed #define COOLANT_FLOOD_PORT LPC_GPIO2->FIOPIN
#define COOLANT_FLOOD_BIT 3 // Uno Analog Pin 3 #define COOLANT_FLOOD_BIT 4 // FAN MOSFET (P2.4)
#define COOLANT_MIST_DDR NotUsed #define COOLANT_MIST_DDR LPC_GPIO2->FIODIR
#define COOLANT_MIST_PORT NotUsed #define COOLANT_MIST_PORT LPC_GPIO2->FIOPIN
#define COOLANT_MIST_BIT 4 // Uno Analog Pin 3 #define COOLANT_MIST_BIT 7 // BED MOSFET (P2.7)
#define ENABLE_M7 // enables COOLANT MIST
// Define user-control controls (cycle start, reset, feed hold) input pins. // 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). // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits).
@ -631,10 +651,14 @@
// The LPC17xx has 6 PWM channels. Each channel has 2 pins. It can drive both pins simultaneously to the same value. // The LPC17xx has 6 PWM channels. Each channel has 2 pins. It can drive both pins simultaneously to the same value.
// //
// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 PWM1_CH7 PWM1_CH8 // PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6
// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 ? ? // Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26
// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 // Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5
#define SPINDLE_PWM_CHANNEL PWM1_CH8 #ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false #define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true #define SPINDLE_PWM_USE_SECONDARY_PIN true

View File

@ -199,7 +199,7 @@ typedef struct {
typedef struct { typedef struct {
float f; // Feed float f; // Feed
float ijk[3]; // I,J,K Axis arc offsets float ijk[N_AXIS]; // I,J,K Axis arc offsets
uint8_t l; // G10 or canned cycles parameters uint8_t l; // G10 or canned cycles parameters
int32_t n; // Line number int32_t n; // Line number
float p; // G10 or dwell parameters float p; // G10 or dwell parameters

View File

@ -23,7 +23,7 @@
// Grbl versioning system // Grbl versioning system
#define GRBL_VERSION "1.1f" #define GRBL_VERSION "1.1f"
#define GRBL_VERSION_BUILD "20170511" #define GRBL_VERSION_BUILD "20171008"
// Define standard libraries used by Grbl. // Define standard libraries used by Grbl.
#include <avr/io.h> #include <avr/io.h>