Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit GRBLHAL2000 board map file #23

Closed
wants to merge 13 commits into from
Closed
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "grblHAL_Teensy4/src/grbl"]
path = grblHAL_Teensy4/src/grbl
url = https://github.com/grblHAL/core
url = https://github.com/Expatria-Technologies/core
[submodule "grblHAL_Teensy4/src/eeprom"]
path = grblHAL_Teensy4/src/eeprom
url = https://github.com/grblHAL/Plugin_EEPROM
[submodule "grblHAL_Teensy4/src/keypad"]
path = grblHAL_Teensy4/src/keypad
url = https://github.com/grblHAL/Plugin_I2C_keypad
url = https://github.com/Expatria-Technologies/Plugin_I2C_keypad
[submodule "grblHAL_Teensy4/src/networking"]
path = grblHAL_Teensy4/src/networking
url = https://github.com/grblHAL/Plugin_networking
Expand All @@ -15,7 +15,7 @@
url = https://github.com/grblHAL/Plugin_SD_card
[submodule "grblHAL_Teensy4/src/spindle"]
path = grblHAL_Teensy4/src/spindle
url = https://github.com/grblHAL/Plugins_spindle
url = https://github.com/Expatria-Technologies/Plugins_spindle
[submodule "grblHAL_Teensy4/src/odometer"]
path = grblHAL_Teensy4/src/odometer
url = https://github.com/grblHAL/Plugin_odometer
Expand Down
6 changes: 3 additions & 3 deletions grblHAL_Teensy4/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ platform = teensy
upload_protocol = teensy-cli
build_flags = ${env.build_flags}
lib_deps =
https://github.com/wwatson4506/uSDFS#uSDFS-non-blocking
https://github.com/wwatson4506/MSC#MSC-non-blocking
#https://github.com/wwatson4506/uSDFS#uSDFS-non-blocking
#https://github.com/wwatson4506/MSC#MSC-non-blocking
https://github.com/ddrown/teensy41_ethernet

# Included as a stub-example for showing how to structure common environments
Expand All @@ -47,4 +47,4 @@ board = teensy41
platform = ${common_teensy.platform}@4.12
upload_protocol = ${common_teensy.upload_protocol}
build_flags = ${common_teensy.build_flags}
lib_deps = ${common_teensy.lib_deps}
lib_deps = ${common_teensy.lib_deps}
133 changes: 133 additions & 0 deletions grblHAL_Teensy4/src/GRBLHAL2000_map.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
HAL2000PNC_map.h - driver code for IMXRT1062 processor (on Teensy 4.1 board)

Part of grblHAL


Copyright (c) 2021 Terje Io

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/>.
*/

#define BOARD_NAME "GRBLHAL2000 - PRINTNC"
#define HAS_BOARD_INIT
#define HAS_IOPORTS

#ifdef NETWORK_HOSTNAME
#undef NETWORK_HOSTNAME
#define NETWORK_HOSTNAME "GRBLHAL2000"
#endif

#if N_AXIS > 5
#error Max number of axes is 5 for UniversalCNC
#endif

#if QEI_ENABLE && SPINDLE_SYNC_ENABLE
#error Quadrature encoder and spindle sync cannot be enabled at the same time
#endif

#define X_STEP_PIN (2u)
#define X_DIRECTION_PIN (3u)
#define X_ENABLE_PIN (10u)
#define X_LIMIT_PIN (20u)

#define Y_STEP_PIN (4u)
#define Y_DIRECTION_PIN (5u)
#define Y_ENABLE_PIN (10u)
#define Y_LIMIT_PIN (21u)

#define Z_STEP_PIN (6u)
#define Z_DIRECTION_PIN (7u)
#define Z_ENABLE_PIN (39u)
#define Z_LIMIT_PIN (22u)

// Define ganged axis or A axis step pulse and step direction output pins.
#if N_ABC_MOTORS > 0
#define M3_AVAILABLE
#define M3_STEP_PIN (8u)
#define M3_DIRECTION_PIN (9u)
#define M3_LIMIT_PIN (23u)
#define M3_ENABLE_PIN (10u)
#endif

// Define ganged axis or B axis step pulse and step direction output pins.
#if N_ABC_MOTORS == 2
#define M4_AVAILABLE
#define M4_STEP_PIN (26u)
#define M4_DIRECTION_PIN (27u)
#define M4_LIMIT_PIN (28u)
#define M4_ENABLE_PIN (10u)
#endif

// Define spindle enable and spindle direction output pins.
#define SPINDLE_ENABLE_PIN (12u)
#define SPINDLE_DIRECTION_PIN (11u)
#define SPINDLE_PWM_PIN (13u) // NOTE: only pin 12 or pin 13 can be assigned!

// Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_PIN (19u)
#define COOLANT_MIST_PIN (18u)

// Define user-control CONTROLs (cycle start, reset, feed hold, door) input pins.
#define RESET_PIN (40u) //this is halt?
#define FEED_HOLD_PIN (16u)
#define CYCLE_START_PIN (17u)
#if MOTOR_FAULT_ENABLE
#define MOTOR_FAULT_PIN (29u)
#endif

#define SAFETY_DOOR_PIN (29u)


// Define probe switch input pin.
#define PROBE_PIN (15u)

#if QEI_ENABLE
#define QEI_A_PIN (36u)
#define QEI_B_PIN (30u)
//#define QEI_INDEX_PIN (36u)
#define QEI_SELECT_PIN (31u)
#endif

#if SPINDLE_SYNC_ENABLE
#define SPINDLE_INDEX_PIN (31u) // ST2
#define SPINDLE_PULSE_PIN (14u) // ST3
#endif

// Define auxillary input pins
#define AUXINPUT0_PIN (36u) // ST0
#if !QEI_ENABLE
#define AUXINPUT1_PIN (30u) // ST1
#if !SPINDLE_SYNC_ENABLE
#define AUXINPUT2_PIN (31u) // ST2
#define AUXINPUT3_PIN (14u) // ST3
#endif
#endif

// Define auxillary output pins
#define AUXOUTPUT0_PIN (37u)
#define AUXOUTPUT1_PIN (32u)
#define AUXOUTPUT2_PIN (33u)
//#define AUX_N_OUT 3
//#define AUX_OUT_MASK 0b111

#if KEYPAD_ENABLE
#define KEYPAD_STROBE_PIN (41u)
#endif

#if EEPROM_ENABLE || KEYPAD_ENABLE
#define I2C_PORT 4
#define I2C_SCL4 (24u) // Not used, for info only
#define I2C_SDA4 (25u) // Not used, for info only
#endif
2 changes: 2 additions & 0 deletions grblHAL_Teensy4/src/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
#include "T41U5XBB_ss_map.h"
#elif defined(BOARD_T41BB5X_PRO)
#include "T41BB5X_Pro_map.h"
#elif defined(BOARD_GRBLHAL2000)
#include "GRBLHAL2000_map.h"
#elif defined(BOARD_MY_MACHINE)
#include "my_machine_map.h"
#else // default board
Expand Down
2 changes: 1 addition & 1 deletion grblHAL_Teensy4/src/grbl
Submodule grbl updated 1 files
+2 −18 pin_bits_masks.h
2 changes: 1 addition & 1 deletion grblHAL_Teensy4/src/keypad
Submodule keypad updated 1 files
+18 −22 keypad.c
69 changes: 30 additions & 39 deletions grblHAL_Teensy4/src/my_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Part of grblHAL

Copyright (c) 2020-2021 Terje Io
Copyright (c) 2020 Terje Io

Grbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -24,48 +24,49 @@
// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used
//#define BOARD_T40X101
#define BOARD_T41U5XBB
//#define BOARD_T41U5XBB
//#define BOARD_T41U5XBB_SS // For a modified T41U5XBB board, allows spindle sync to be enabled.
//#define BOARD_T41BB5X_PRO
//#define BOARD_CNC_BOOSTERPACK
#define BOARD_GRBLHAL2000
//#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

// Configuration
// Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown.

/*
Plugin: | ETHERNET | SDCARD | KEYPAD | EEPROM | N_AXIS |
Plugin: | ETHERNET? | SDCARD? | KEYPAD | EEPROM | N_AXIS |
----------------------|-----------|---------|--------|--------|--------|
BOARD_T40X101 | no | no | yes | yes | max 4 |
BOARD_T41U5XBB | yes | yes | yes | yes | max 5 |
BOARD_T40X101 | no | no | yes | yes? | max 4 |
BOARD_T41U5XBB | yes | yes | yes | yes? | max 5 |
BOARD_T41BB5X_PRO | yes | yes | yes | yes | max 5 |
BOARD_CNC_BOOSTERPACK | yes� | yes | yes | yes | max 3 |
BOARD_CNC_BOOSTERPACK | yes? | yes | yes | yes | max 3 |
BOARD_GRBLHAL2000 | yes | yes | yes | yes | max 5 |

Teensy 4.1 only
External magjack.
EEPROM is optional and must be added to the board.
? Teensy 4.1 only
? External magjack.
? EEPROM is optional and must be added to the board.

N_AXIS has a default value of 3, edit grbl\config.h to increase.

*/

#define USB_SERIAL_CDC 2 // 1 for Arduino class library and 2 for PJRC C library. Comment out to use UART communication.
//#define USB_SERIAL_WAIT 1 // Wait for USB connection before starting grblHAL.
//#define BLUETOOTH_ENABLE 1 // Set to 1 for HC-05 module. Enables Bluetooth plugin.
//#define SPINDLE_HUANYANG 1 // Set to 1 or 2 for Huanyang VFD spindle. Enables spindle plugin.
//#define WEBUI_ENABLE 1 // Enable ESP3D-WEBUI plugin along with networking and SD card plugins.
//#define WEBUI_INFLASH 1 // Store WebUI files in flash instead of on SD card.
//#define ETHERNET_ENABLE 1 // Ethernet streaming. Enables networking plugin.
//#define SDCARD_ENABLE 1 // Run gcode programs from SD card, enables sdcard plugin.
//#define BLUETOOTH_ENABLE 1 // Set to 1 for HC-05 module. Requires Bluetooth plugin.
#define SPINDLE_HUANYANG 1 // Set to 1 or 2 for Huanyang VFD spindle. Requires spindle plugin.
#define SPINDLE_RPM_CONTROLLED //this is required if using Huanyang VFD
//#define QEI_ENABLE 1 // Enable quadrature encoder interfaces. Max value is 1. Requires encoder plugin.
//#define KEYPAD_ENABLE 1 // I2C keypad for jogging etc., enables keypad plugin.
#define ETHERNET_ENABLE 1 // Ethernet streaming. Requires networking plugin.
//#define SDCARD_ENABLE 1 // Run gcode programs from SD card, requires sdcard plugin.
#define KEYPAD_ENABLE 1 // I2C keypad for jogging etc., requires keypad plugin.
//#define PLASMA_ENABLE 1 // Plasma/THC plugin. To be completed.
//#define MCP3221_ENABLE 1 // Enable analog input via MCP3221 ADC.
//#define PPI_ENABLE 1 // Laser PPI plugin. To be completed.
//#define ODOMETER_ENABLE 1 // Odometer plugin.
//#define OPENPNP_ENABLE 1 // OpenPNP plugin. To be completed.
//#define FANS_ENABLE 1 // Enable fan control via M106/M107. Enables fans plugin.
//#define EEPROM_ENABLE 1 // I2C EEPROM support. Set to 1 for 24LC16 (2K), 3 for 24C32 (4K - 32 byte page) and 2 for other sizes. Enables eeprom plugin.
//#define FANS_ENABLE 1 // Enable fan control via M106/M107. Requires fans plugin.
//#define EEPROM_ENABLE 1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 for larger sizes. Requires eeprom plugin.
//#define EEPROM_IS_FRAM 1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay.
//#define SPINDLE_SYNC_ENABLE 1 // Enable spindle sync support (G33, G76). !! NOTE: Alpha quality - enable only for test or verification.
// Currently only available for BOARD_T41BB5X_PRO and BOARD_T41U5XBB_SS.
Expand All @@ -76,8 +77,8 @@ N_AXIS has a default value of 3, edit grbl\config.h to increase.
// of axes can be enabled here.
//#define X_GANGED 1
//#define X_AUTO_SQUARE 1
//#define Y_GANGED 1
//#define Y_AUTO_SQUARE 1
#define Y_GANGED 1
#define Y_AUTO_SQUARE 1
//#define Z_GANGED 1
//#define Z_AUTO_SQUARE 1
// For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch.
Expand All @@ -89,24 +90,14 @@ N_AXIS has a default value of 3, edit grbl\config.h to increase.

#if ETHERNET_ENABLE > 0
#define TELNET_ENABLE 1 // Telnet daemon - requires Ethernet streaming enabled.
#define FTP_ENABLE 1 // Ftp daemon - requires SD card enabled.
#define WEBSOCKET_ENABLE 1 // Websocket daemon - requires Ethernet streaming enabled.
#ifdef SDCARD_ENABLE
//#define FTP_ENABLE 1 // Ftp daemon - requires SD card enabled.
//#define HTTP_ENABLE 1 // http daemon - requires SD card enabled.
#define NETWORK_HOSTNAME "GRBLHAL2000"
#define NETWORK_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP
#define NETWORK_IP "192.168.5.1"
#define NETWORK_GATEWAY "192.168.5.1"
#define NETWORK_MASK "255.255.255.0"
#define NETWORK_TELNET_PORT 23
#define NETWORK_WEBSOCKET_PORT 80
#define NETWORK_HTTP_PORT 80
#endif
// The following symbols have the default values as shown, uncomment and change as needed.
//#define NETWORK_HOSTNAME "GRBL"
//#define NETWORK_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP
//#define NETWORK_IP "192.168.5.1"
//#define NETWORK_GATEWAY "192.168.5.1"
//#define NETWORK_MASK "255.255.255.0"
//#define NETWORK_FTP_PORT 21
//#define NETWORK_TELNET_PORT 23
//#define NETWORK_HTTP_PORT 80
#if HTTP_ENABLE
//#define NETWORK_WEBSOCKET_PORT 81
#else
//#define NETWORK_WEBSOCKET_PORT 80
#endif
#endif