|
31 | 31 | #include "LPC17xx.h" |
32 | 32 |
|
33 | 33 |
|
34 | | -// Define CPU pin map and default settings. |
35 | | -// NOTE: OEMs can avoid the need to maintain/update the defaults.h and cpu_map.h files and use only |
36 | | -// one configuration file by placing their specific defaults and pin map at the bottom of this file. |
37 | | -// If doing so, simply comment out these two defines and see instructions below. |
38 | | -// #define DEFAULTS_GENERIC |
39 | | -// #define CPU_MAP_ATMEGA328P // Arduino Uno CPU |
| 34 | +// Define board type for pin map and default settings. |
| 35 | +//#define CPU_MAP_SMOOTHIEBOARD // Smoothieboard (NXP LPC1769 MCU) |
| 36 | +#define CPU_MAP_C3D_REMIX // Cohesion3D Remix (NXP LPC1769 MCU) |
| 37 | +//#define CPU_MAP_C3D_MINI // Cohesion3D Mini (NXP LPC1769 MCU) |
| 38 | +//#define CPU_MAP_MKS_SBASE // MKS SBASE Board (NXP LPC1768 MCU) |
| 39 | +//#define CPU_MAP_AZTEEG_X5 // Azteeg X5 Board (NXP LPC1769 MCU) |
| 40 | + |
| 41 | +// Define machine type for machine specific defaults |
| 42 | +//#define DEFAULTS_GENERIC |
| 43 | +#define DEFAULTS_K40 |
| 44 | +//#define DEFAULTS_FABKIT |
40 | 45 |
|
41 | 46 | // Serial baud rate |
42 | 47 | // #define BAUD_RATE 230400 |
|
108 | 113 | // #define HOMING_CYCLE_2 // OPTIONAL: Uncomment and add axes mask to enable |
109 | 114 |
|
110 | 115 | // NOTE: The following are two examples to setup homing for 2-axis machines. |
111 | | -// #define HOMING_CYCLE_0 ((1<<X_AXIS)|(1<<Y_AXIS)) // NOT COMPATIBLE WITH COREXY: Homes both X-Y in one cycle. |
| 116 | +//#define HOMING_CYCLE_0 ((1<<X_AXIS)|(1<<Y_AXIS)) // NOT COMPATIBLE WITH COREXY: Homes both X-Y in one cycle. |
112 | 117 |
|
113 | | -#define HOMING_CYCLE_0 (1<<X_AXIS) // COREXY COMPATIBLE: First home X |
114 | | -#define HOMING_CYCLE_1 (1<<Y_AXIS) // COREXY COMPATIBLE: Then home Y |
| 118 | +// #define HOMING_CYCLE_0 (1<<X_AXIS) // COREXY COMPATIBLE: First home X |
| 119 | +// #define HOMING_CYCLE_1 (1<<Y_AXIS) // COREXY COMPATIBLE: Then home Y |
| 120 | +// Homing cycle pattern is defined in Machine defaults!!! |
115 | 121 |
|
116 | 122 | // Number of homing cycles performed after when the machine initially jogs to limit switches. |
117 | 123 | // This help in preventing overshoot and should improve repeatability. This value should be one or |
|
130 | 136 | // #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable. |
131 | 137 |
|
132 | 138 | // Uncomment this define to force Grbl to always set the machine origin at bottom left. |
133 | | -#define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable. |
| 139 | +//#define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable. |
134 | 140 |
|
135 | 141 | // Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size |
136 | 142 | // and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may |
|
170 | 176 | // Enables a second coolant control pin via the mist coolant g-code command M7 on the Arduino Uno |
171 | 177 | // analog pin 4. Only use this option if you require a second coolant control pin. |
172 | 178 | // NOTE: The M8 flood coolant control pin on analog pin 3 will still be functional regardless. |
173 | | -// #define ENABLE_M7 // Disabled by default. Uncomment to enable. |
| 179 | +//#define ENABLE_M7 // Disabled by default. Uncomment to enable. |
174 | 180 |
|
175 | 181 | // This option causes the feed hold input to act as a safety door switch. A safety door, when triggered, |
176 | 182 | // immediately forces a feed hold and then safely de-energizes the machine. Resuming is blocked until |
|
563 | 569 |
|
564 | 570 | // LPC176x flash blocks have a rating of 10,000 write cycles. To prevent excess wear, we don't |
565 | 571 | // write G10, G28.1, and G30.1. Uncomment to enable these writes. |
566 | | -// #define STORE_COORD_DATA // Default disabled. Uncomment to enable. |
| 572 | +#define STORE_COORD_DATA // Default disabled. Uncomment to enable. |
567 | 573 |
|
568 | 574 | // In Grbl v0.9 and prior, there is an old outstanding bug where the `WPos:` work position reported |
569 | 575 | // may not correlate to what is executing, because `WPos:` is based on the g-code parser state, which |
|
627 | 633 | below. |
628 | 634 | */ |
629 | 635 |
|
630 | | -// Paste CPU_MAP definitions here. |
631 | | -// Define serial port pins and interrupt vectors. |
632 | | -#define SERIAL_RX USART_RX_vect |
633 | | -#define SERIAL_UDRE USART_UDRE_vect |
634 | | - |
635 | | -// Define step pulse output pins. NOTE: All step bit pins must be on the same port. |
636 | | -#define STEP_DDR LPC_GPIO2->FIODIR |
637 | | -#define STEP_PORT LPC_GPIO2->FIOPIN |
638 | | -#define X_STEP_BIT 0 |
639 | | -#define Y_STEP_BIT 1 |
640 | | -#define Z_STEP_BIT 2 |
641 | | -#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits |
642 | | - |
643 | | -// Define step direction output pins. NOTE: All direction pins must be on the same port. |
644 | | -#define DIRECTION_DDR LPC_GPIO0->FIODIR |
645 | | -#define DIRECTION_PORT LPC_GPIO0->FIOPIN |
646 | | -#define X_DIRECTION_BIT 5 |
647 | | -#define Y_DIRECTION_BIT 11 |
648 | | -#define Z_DIRECTION_BIT 20 |
649 | | -#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits |
650 | | - |
651 | | -// Define stepper driver enable/disable output pin. |
652 | | -#define STEPPERS_DISABLE_DDR LPC_GPIO0->FIODIR |
653 | | -#define STEPPERS_DISABLE_PORT LPC_GPIO0->FIOPIN |
654 | | -#define X_DISABLE_BIT 4 |
655 | | -#define Y_DISABLE_BIT 10 |
656 | | -#define Z_DISABLE_BIT 19 |
657 | | -#define STEPPERS_DISABLE_MASK ((1<<X_DISABLE_BIT)|(1<<Y_DISABLE_BIT)|(1<<Z_DISABLE_BIT)) |
658 | | - |
659 | | -// Define homing/hard limit switch input pins and limit interrupt vectors. |
660 | | -// NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (CONTROL). |
661 | | -#define LIMIT_DDR LPC_GPIO1->FIODIR |
662 | | -#define LIMIT_PIN LPC_GPIO1->FIOPIN |
663 | | -#define LIMIT_PORT LPC_GPIO1->FIOPIN |
664 | | -#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25 |
665 | | -#define Y_LIMIT_BIT 26 // Y-MIN=26, Y-MAX=27 |
666 | | -#define Z_LIMIT_BIT 29 // Z-MIN=28, Z-MAX=29 |
667 | | -#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits |
668 | | -// hard limits not ported #define LIMIT_INT PCIE0 // Pin change interrupt enable pin |
669 | | -// hard limits not ported #define LIMIT_INT_vect PCINT0_vect |
670 | | -// hard limits not ported #define LIMIT_PCMSK PCMSK0 // Pin change interrupt register |
671 | | - |
672 | | -// Define spindle enable and spindle direction output pins. |
673 | | -/* not ported |
674 | | -#define SPINDLE_ENABLE_DDR DDRB |
675 | | -#define SPINDLE_ENABLE_PORT PORTB |
676 | | -// Z Limit pin and spindle PWM/enable pin swapped to access hardware PWM on Pin 11. |
677 | | -#ifdef VARIABLE_SPINDLE |
678 | | - #ifdef USE_SPINDLE_DIR_AS_ENABLE_PIN |
679 | | - // If enabled, spindle direction pin now used as spindle enable, while PWM remains on D11. |
680 | | - #define SPINDLE_ENABLE_BIT 5 // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.) |
681 | | - #else |
682 | | - #define SPINDLE_ENABLE_BIT 3 // Uno Digital Pin 11 |
683 | | - #endif |
684 | | -#else |
685 | | - #define SPINDLE_ENABLE_BIT 4 // Uno Digital Pin 12 |
686 | | -#endif |
687 | | -#ifndef USE_SPINDLE_DIR_AS_ENABLE_PIN |
688 | | - #define SPINDLE_DIRECTION_DDR DDRB |
689 | | - #define SPINDLE_DIRECTION_PORT PORTB |
690 | | - #define SPINDLE_DIRECTION_BIT 5 // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.) |
691 | | -#endif |
692 | | -*/ |
693 | | - |
694 | | -// Define flood and mist coolant enable output pins. |
695 | | -#define COOLANT_FLOOD_DDR NotUsed |
696 | | -#define COOLANT_FLOOD_PORT NotUsed |
697 | | -#define COOLANT_FLOOD_BIT 3 // Uno Analog Pin 3 |
698 | | -#define COOLANT_MIST_DDR NotUsed |
699 | | -#define COOLANT_MIST_PORT NotUsed |
700 | | -#define COOLANT_MIST_BIT 4 // Uno Analog Pin 3 |
701 | | - |
702 | | -// Define user-control controls (cycle start, reset, feed hold) input pins. |
703 | | -// NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits). |
704 | | -#define CONTROL_DDR NotUsed |
705 | | -#define CONTROL_PIN NotUsed |
706 | | -#define CONTROL_PORT NotUsed |
707 | | -#define CONTROL_RESET_BIT 0 // Uno Analog Pin 0 |
708 | | -#define CONTROL_FEED_HOLD_BIT 1 // Uno Analog Pin 1 |
709 | | -#define CONTROL_CYCLE_START_BIT 2 // Uno Analog Pin 2 |
710 | | -#define CONTROL_SAFETY_DOOR_BIT 1 // Uno Analog Pin 1 NOTE: Safety door is shared with feed hold. Enabled by config define. |
711 | | -#define CONTROL_INT PCIE1 // Pin change interrupt enable pin |
712 | | -#define CONTROL_INT_vect PCINT1_vect |
713 | | -#define CONTROL_PCMSK NotUsed // Pin change interrupt register |
714 | | -#define CONTROL_MASK ((1<<CONTROL_RESET_BIT)|(1<<CONTROL_FEED_HOLD_BIT)|(1<<CONTROL_CYCLE_START_BIT)|(1<<CONTROL_SAFETY_DOOR_BIT)) |
715 | | -#define CONTROL_INVERT_MASK CONTROL_MASK // May be re-defined to only invert certain control pins. |
716 | | - |
717 | | -// Define probe switch input pin. |
718 | | -#define PROBE_DDR NotUsed // LPC_GPIO1->FIODIR |
719 | | -#define PROBE_PIN NotUsed // LPC_GPIO1->FIOPIN |
720 | | -#define PROBE_PORT NotUsed // LPC_GPIO1->FIOPIN |
721 | | -#define PROBE_BIT 5 |
722 | | -#define PROBE_MASK (1<<PROBE_BIT) |
723 | | - |
724 | | -// The LPC17xx has 6 PWM channels. Each channel has 2 pins. It can drive both pins simultaneously to the same value. |
725 | | -// |
726 | | -// PWM Channel PWM1_CH1 PWM1_CH2 PWM1_CH3 PWM1_CH4 PWM1_CH5 PWM1_CH6 |
727 | | -// Primary pin P1.18 P1.20 P1.21 P1.23 P1.24 P1.26 |
728 | | -// Secondary pin P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 |
729 | | -#define SPINDLE_PWM_CHANNEL PWM1_CH6 |
730 | | -#define SPINDLE_PWM_USE_PRIMARY_PIN false |
731 | | -#define SPINDLE_PWM_USE_SECONDARY_PIN true |
732 | | - |
733 | | -// Stepper current control |
734 | | -//#define CURRENT_I2C Driver_I2C1 // I2C driver for current control. Comment out to disable. |
735 | | -//#define CURRENT_MCP44XX_ADDR 0b0101100 // Address of MCP44XX |
736 | | -//#define CURRENT_WIPERS {0, 1, 6, 7}; // Wiper registers (X, Y, Z, A) |
737 | | -//#define CURRENT_FACTOR 113.33 // Convert amps to digipot value |
738 | | - |
739 | | -// Paste default settings definitions here. |
740 | | -#define DEFAULT_X_STEPS_PER_MM 160.0 |
741 | | -#define DEFAULT_Y_STEPS_PER_MM 160.0 |
742 | | -#define DEFAULT_Z_STEPS_PER_MM 160.0 |
743 | | -#define DEFAULT_X_MAX_RATE 24000 // mm/min |
744 | | -#define DEFAULT_Y_MAX_RATE 24000 // mm/min |
745 | | -#define DEFAULT_Z_MAX_RATE 500.0 // mm/min |
746 | | -#define DEFAULT_X_ACCELERATION (2500.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 |
747 | | -#define DEFAULT_Y_ACCELERATION (2500.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 |
748 | | -#define DEFAULT_Z_ACCELERATION (2500.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 |
749 | | -#define DEFAULT_X_CURRENT 0.4 // amps |
750 | | -#define DEFAULT_Y_CURRENT 0.6 // amps |
751 | | -#define DEFAULT_Z_CURRENT 0.0 // amps |
752 | | -#define DEFAULT_A_CURRENT 0.0 // amps |
753 | | -#define DEFAULT_X_MAX_TRAVEL 300.0 // mm |
754 | | -#define DEFAULT_Y_MAX_TRAVEL 200.0 // mm |
755 | | -#define DEFAULT_Z_MAX_TRAVEL 50.0 // mm |
756 | | -#define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz |
757 | | -#define DEFAULT_SPINDLE_PWM_OFF_VALUE 0.0 // Percent |
758 | | -#define DEFAULT_SPINDLE_PWM_MIN_VALUE 0.0 // Percent |
759 | | -#define DEFAULT_SPINDLE_PWM_MAX_VALUE 100.0 // Percent |
760 | | -#define DEFAULT_SPINDLE_RPM_MAX 1000.0 // rpm |
761 | | -#define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm |
762 | | -#define DEFAULT_STEP_PULSE_MICROSECONDS 10 |
763 | | -#define DEFAULT_STEPPING_INVERT_MASK 0 |
764 | | -#define DEFAULT_DIRECTION_INVERT_MASK 0 |
765 | | -#define DEFAULT_STEPPER_IDLE_LOCK_TIME 255 // msec (0-254, 255 keeps steppers enabled) |
766 | | -#define DEFAULT_STATUS_REPORT_MASK 0 // WPos enabled |
767 | | -#define DEFAULT_JUNCTION_DEVIATION 0.01 // mm |
768 | | -#define DEFAULT_ARC_TOLERANCE 0.002 // mm |
769 | | -#define DEFAULT_REPORT_INCHES 0 // false |
770 | | -#define DEFAULT_INVERT_ST_ENABLE 0 // false |
771 | | -#define DEFAULT_INVERT_LIMIT_PINS 1 // false |
772 | | -#define DEFAULT_SOFT_LIMIT_ENABLE 1 // false |
773 | | -#define DEFAULT_HARD_LIMIT_ENABLE 0 // false |
774 | | -#define DEFAULT_INVERT_PROBE_PIN 0 // false |
775 | | -#define DEFAULT_LASER_MODE 1 // true |
776 | | -#define DEFAULT_HOMING_ENABLE 1 // false |
777 | | -#define DEFAULT_HOMING_DIR_MASK 1 // move positive dir |
778 | | -#define DEFAULT_HOMING_FEED_RATE 50.0 // mm/min |
779 | | -#define DEFAULT_HOMING_SEEK_RATE 6000.0 // mm/min |
780 | | -#define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k) |
781 | | -#define DEFAULT_HOMING_PULLOFF 2.0 // mm |
782 | 636 |
|
783 | 637 | #endif |
0 commit comments