From faad68cb7181a25665ed81b809331281f8cf9f4d Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 10 Jan 2020 10:50:48 -0600 Subject: [PATCH] Removing RMT_CHANNEL setup from cpu_map.h The actual channel numbers don't matter or conflict with anything, so they are all now predefined in stepper.h --- Grbl_Esp32/cpu_map.h | 82 +++++++++++++------------------------- Grbl_Esp32/grbl.h | 2 +- Grbl_Esp32/polar_coaster.h | 2 - Grbl_Esp32/stepper.h | 8 ++++ 4 files changed, 37 insertions(+), 57 deletions(-) diff --git a/Grbl_Esp32/cpu_map.h b/Grbl_Esp32/cpu_map.h index 26dbe271..1fee4513 100644 --- a/Grbl_Esp32/cpu_map.h +++ b/Grbl_Esp32/cpu_map.h @@ -59,8 +59,6 @@ */ #define CPU_MAP_NAME "CPU_MAP_DEFAULT - Demo Only No I/O!" - #define CONTROL_FEED_HOLD_PIN GPIO_NUM_21 // Uno A1 - #define LIMIT_MASK 0 // no limit pins #endif @@ -99,16 +97,10 @@ #define Z_LIMIT_PIN GPIO_NUM_15 #endif - #define X_STEP_PIN GPIO_NUM_12 - - #define X_RMT_CHANNEL 0 - - // #define Y_STEP_PIN (see versions above) - #define Y_RMT_CHANNEL 1 + #define X_STEP_PIN GPIO_NUM_12 #define Z_STEP_PIN GPIO_NUM_27 - #define Z_DIRECTION_PIN GPIO_NUM_33 - #define Z_RMT_CHANNEL 2 + #define Z_DIRECTION_PIN GPIO_NUM_33 // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 @@ -138,44 +130,44 @@ // !!!! Experimental Untested !!!!! // This is a CPU MAP for ESPDUINO-32 Boards and Protoneer V3 boards // Note: Probe pin is mapped, but will require a 10k external pullup to 3.3V to work. + + // Rebooting...See this issue https://github.com/bdring/Grbl_Esp32/issues/314 + #define CPU_MAP_NAME "CPU_MAP_ESPDUINO_32" #define USE_RMT_STEPS - #define X_STEP_PIN GPIO_NUM_26 // Uno D2 - #define X_DIRECTION_PIN GPIO_NUM_16 // Uno D5 - #define X_RMT_CHANNEL 0 + #define X_STEP_PIN GPIO_NUM_26 + #define X_DIRECTION_PIN GPIO_NUM_16 - #define Y_STEP_PIN GPIO_NUM_25 // Uno D3 - #define Y_DIRECTION_PIN GPIO_NUM_27 // Uno D6 - #define Y_RMT_CHANNEL 1 + #define Y_STEP_PIN GPIO_NUM_25 + #define Y_DIRECTION_PIN GPIO_NUM_27 - #define Z_STEP_PIN GPIO_NUM_17 // Uno D4 - #define Z_DIRECTION_PIN GPIO_NUM_14 // Uno D7 - #define Z_RMT_CHANNEL 2 + #define Z_STEP_PIN GPIO_NUM_17 + #define Z_DIRECTION_PIN GPIO_NUM_14 // OK to comment out to use pin for other features - #define STEPPERS_DISABLE_PIN GPIO_NUM_12 // Uno D8 + #define STEPPERS_DISABLE_PIN GPIO_NUM_12 - #define SPINDLE_PWM_PIN GPIO_NUM_19 // Uno D11 + #define SPINDLE_PWM_PIN GPIO_NUM_19 #define SPINDLE_PWM_CHANNEL 0 #define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE - #define SPINDLE_DIR_PIN GPIO_NUM_18 // Uno D13 + #define SPINDLE_DIR_PIN GPIO_NUM_18 - #define COOLANT_FLOOD_PIN GPIO_NUM_34 // Uno A3 - #define COOLANT_MIST_PIN GPIO_NUM_36// Uno A4 + #define COOLANT_FLOOD_PIN GPIO_NUM_34 + #define COOLANT_MIST_PIN GPIO_NUM_36 - #define X_LIMIT_PIN GPIO_NUM_13 // Uno D9 - #define Y_LIMIT_PIN GPIO_NUM_5 // Uno D10 - #define Z_LIMIT_PIN GPIO_NUM_19 // Uno D12 + #define X_LIMIT_PIN GPIO_NUM_13 + #define Y_LIMIT_PIN GPIO_NUM_5 + #define Z_LIMIT_PIN GPIO_NUM_19 #define LIMIT_MASK B111 - #define PROBE_PIN GPIO_NUM_39 // Uno A5 + #define PROBE_PIN GPIO_NUM_39 // comment out #define IGNORE_CONTROL_PINS in config.h to use control pins - #define CONTROL_RESET_PIN GPIO_NUM_2 // Uno A0 - #define CONTROL_FEED_HOLD_PIN GPIO_NUM_4 // Uno A1 - #define CONTROL_CYCLE_START_PIN GPIO_NUM_35 // Uno A2 ... ESP32 needs external pullup + #define CONTROL_RESET_PIN GPIO_NUM_2 + #define CONTROL_FEED_HOLD_PIN GPIO_NUM_4 + #define CONTROL_CYCLE_START_PIN GPIO_NUM_35 // ESP32 needs external pullup #endif #ifdef CPU_MAP_ESP32_ESC_SPINDLE @@ -189,16 +181,13 @@ #define USE_RMT_STEPS #define X_STEP_PIN GPIO_NUM_12 - #define X_DIRECTION_PIN GPIO_NUM_14 - #define X_RMT_CHANNEL 0 + #define X_DIRECTION_PIN GPIO_NUM_14 #define Y_STEP_PIN GPIO_NUM_26 - #define Y_DIRECTION_PIN GPIO_NUM_15// #define Y_STEP_PIN (see versions above) - #define Y_RMT_CHANNEL 1 + #define Y_DIRECTION_PIN GPIO_NUM_15// #define Y_STEP_PIN (see versions above) #define Z_STEP_PIN GPIO_NUM_27 - #define Z_DIRECTION_PIN GPIO_NUM_33 - #define Z_RMT_CHANNEL 2 + #define Z_DIRECTION_PIN GPIO_NUM_33 // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 @@ -260,13 +249,10 @@ #define PEN_LASER_V2 #define X_STEP_PIN GPIO_NUM_12 - #define X_DIRECTION_PIN GPIO_NUM_26 - #define X_RMT_CHANNEL 0 - + #define X_DIRECTION_PIN GPIO_NUM_26 #define Y_STEP_PIN GPIO_NUM_14 - #define Y_DIRECTION_PIN GPIO_NUM_25 - #define Y_RMT_CHANNEL 1 + #define Y_DIRECTION_PIN GPIO_NUM_25 #define STEPPERS_DISABLE_PIN GPIO_NUM_13 @@ -362,11 +348,9 @@ #define X_STEP_PIN GPIO_NUM_12 #define Y_STEP_PIN GPIO_NUM_14 - #define X_RMT_CHANNEL 0 #define X_DIRECTION_PIN GPIO_NUM_26 #define Y_DIRECTION_PIN GPIO_NUM_25 - #define Y_RMT_CHANNEL 1 #ifndef COREXY // maybe set in config.h #define COREXY @@ -827,7 +811,6 @@ #define X_DRIVER_TMC2130 // Which Driver Type? #define X_CS_PIN GPIO_NUM_17 //chip select #define X_RSENSE 0.11f // .11 Ohm - #define X_RMT_CHANNEL 0 #define Y_STEP_PIN GPIO_NUM_14 #define Y_DIRECTION_PIN GPIO_NUM_25 @@ -835,7 +818,6 @@ #define Y_DRIVER_TMC2130 // Which Driver Type? #define Y_CS_PIN GPIO_NUM_16 //chip select #define Y_RSENSE 0.11f // .11 Ohm - #define Y_RMT_CHANNEL 1 // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 @@ -884,21 +866,17 @@ #define X_STEP_PIN GPIO_NUM_12 #define X_DIRECTION_PIN GPIO_NUM_26 - #define X_RMT_CHANNEL 0 #define Y_STEP_PIN GPIO_NUM_14 #define Y_DIRECTION_PIN GPIO_NUM_25 - #define Y_RMT_CHANNEL 1 // Z is a servo #define A_STEP_PIN GPIO_NUM_27 #define A_DIRECTION_PIN GPIO_NUM_33 - #define A_RMT_CHANNEL 2 #define B_STEP_PIN GPIO_NUM_15 #define B_DIRECTION_PIN GPIO_NUM_32 - #define B_RMT_CHANNEL 3 // C is a servo @@ -1035,7 +1013,6 @@ #define X_DRIVER_TMC2130 // Which Driver Type? #define X_CS_PIN GPIO_NUM_17 // Daisy Chain, all share same CS pin #define X_RSENSE 0.11f // .11 Ohm - #define X_RMT_CHANNEL 0 #define Y_STEP_PIN GPIO_NUM_27 #define Y_DIRECTION_PIN GPIO_NUM_26 @@ -1043,7 +1020,6 @@ #define Y_DRIVER_TMC2130 // Which Driver Type? #define Y_CS_PIN X_CS_PIN // Daisy Chain, all share same CS pin #define Y_RSENSE 0.11f // .11 Ohm - #define Y_RMT_CHANNEL 1 #define Z_STEP_PIN GPIO_NUM_15 #define Z_DIRECTION_PIN GPIO_NUM_2 @@ -1051,7 +1027,6 @@ #define Z_DRIVER_TMC2130 // Which Driver Type? #define Z_CS_PIN X_CS_PIN // Daisy Chain, all share same CS pin #define Z_RSENSE 0.11f // .11 Ohm - #define Z_RMT_CHANNEL 2 #define A_STEP_PIN GPIO_NUM_33 #define A_DIRECTION_PIN GPIO_NUM_32 @@ -1059,7 +1034,6 @@ #define A_DRIVER_TMC2130 // Which Driver Type? #define A_CS_PIN X_CS_PIN // Daisy Chain, all share same CS pin #define A_RSENSE 0.11f // .11 Ohm - #define A_RMT_CHANNEL 3 #define STEPPERS_DISABLE_PIN GPIO_NUM_13 diff --git a/Grbl_Esp32/grbl.h b/Grbl_Esp32/grbl.h index 33135184..868e55b7 100644 --- a/Grbl_Esp32/grbl.h +++ b/Grbl_Esp32/grbl.h @@ -20,7 +20,7 @@ // Grbl versioning system #define GRBL_VERSION "1.1f" -#define GRBL_VERSION_BUILD "20200110" +#define GRBL_VERSION_BUILD "20200111" //#include #include diff --git a/Grbl_Esp32/polar_coaster.h b/Grbl_Esp32/polar_coaster.h index a7826172..6d570a02 100644 --- a/Grbl_Esp32/polar_coaster.h +++ b/Grbl_Esp32/polar_coaster.h @@ -33,9 +33,7 @@ #define USE_RMT_STEPS #define X_STEP_PIN GPIO_NUM_15 -#define X_RMT_CHANNEL 0 #define Y_STEP_PIN GPIO_NUM_2 -#define Y_RMT_CHANNEL 1 #define X_DIRECTION_PIN GPIO_NUM_25 #define Y_DIRECTION_PIN GPIO_NUM_26 diff --git a/Grbl_Esp32/stepper.h b/Grbl_Esp32/stepper.h index d2dd6bbd..d99a9d01 100644 --- a/Grbl_Esp32/stepper.h +++ b/Grbl_Esp32/stepper.h @@ -47,6 +47,14 @@ #define PREP_FLAG_PARKING bit(2) #define PREP_FLAG_DECEL_OVERRIDE bit(3) +// which RMT channels to use with the axes +#define X_RMT_CHANNEL 0 +#define Y_RMT_CHANNEL 1 +#define Z_RMT_CHANNEL 2 +#define A_RMT_CHANNEL 3 +#define B_RMT_CHANNEL 4 +#define C_RMT_CHANNEL 5 + // Define Adaptive Multi-Axis Step-Smoothing(AMASS) levels and cutoff frequencies. The highest level // frequency bin starts at 0Hz and ends at its cutoff frequency. The next lower level frequency bin // starts at the next higher cutoff frequency, and so on. The cutoff frequencies for each level must