From bf5c391e310ff1a6a1ea7b7283b1870edbac9d77 Mon Sep 17 00:00:00 2001 From: lokiagent <75763148+lokiagent@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:01:12 -0700 Subject: [PATCH] Add BTT SB2209 USB Toolhead Add in mcu definitions file and user template for BTT SB2209 USB Toolhead. --- .../toolhead/BTT_SB2209_USB_v1.0.cfg | 23 ++++ .../toolhead/BTT_SB2209_USB_v1.0.cfg | 116 ++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 config/mcu_definitions/toolhead/BTT_SB2209_USB_v1.0.cfg create mode 100644 user_templates/mcu_defaults/toolhead/BTT_SB2209_USB_v1.0.cfg diff --git a/config/mcu_definitions/toolhead/BTT_SB2209_USB_v1.0.cfg b/config/mcu_definitions/toolhead/BTT_SB2209_USB_v1.0.cfg new file mode 100644 index 000000000..451afcc85 --- /dev/null +++ b/config/mcu_definitions/toolhead/BTT_SB2209_USB_v1.0.cfg @@ -0,0 +1,23 @@ +[board_pins toolhead_manufacturer] +mcu: toolhead +aliases: + + MCU_E0_STEP=gpio18 , MCU_E0_DIR=gpio19 , MCU_E0_EN=gpio17 , MCU_E0_UART=gpio20 , + + MCU_ENDSTOP=gpio13 , + MCU_PROBE1=gpio21 , MCU_PROBE2=gpio22 , + + MCU_HE0=gpio7 , + MCU_TH0=gpio26 , + MCU_NTC=gpio27 , + + MCU_IND=gpio6 , MCU_FAN=gpio5 , + MCU_FAN1_PWM=gpio14 , MCU_FAN2_PWM=gpio4 , + MCU_4WFAN_TACH=gpio12 , MCU_4WFAN_PWM=gpio16 , + + MCU_LIS2DW_MISO=gpio0 , MCU_LIS2DW_CS=gpio1 , MCU_LIS2DW_CK=gpio2 , + MCU_LIS2DW_MOSI=gpio3 , MCU_LIS2DW_INT1=gpio25 , MCU_LIS2DW_SPI=spi0a , + + MCU_I2C_SCL=gpio29 , MCU_I2C_SDA=gpio28 , + + MCU_RGB=gpio15 , MCU_STATUS=gpio24 \ No newline at end of file diff --git a/user_templates/mcu_defaults/toolhead/BTT_SB2209_USB_v1.0.cfg b/user_templates/mcu_defaults/toolhead/BTT_SB2209_USB_v1.0.cfg new file mode 100644 index 000000000..44a60dc2a --- /dev/null +++ b/user_templates/mcu_defaults/toolhead/BTT_SB2209_USB_v1.0.cfg @@ -0,0 +1,116 @@ +#--------------------------------------------# +##### BTT SB2209 USB v1.0 MCU definition ##### +#--------------------------------------------# + +[mcu toolhead] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +##-------------------------------------------------------------------- + +# If you want to override the wiring of the BTT SB, keep in mind that this +# board is defined using the "toolhead" name. So you should use "pin: toolhead:PIN_NAME" +# in your own overrides.cfg files. + +[include config/mcu_definitions/toolhead/BTT_SB2209_USB_v1.0.cfg] # Do not remove this line +[board_pins sb2209_usb_mcu] +mcu: toolhead +aliases: + + E_STEP=MCU_E0_STEP , E_DIR=MCU_E0_DIR , E_ENABLE=MCU_E0_EN , E_TMCUART=MCU_E0_UART , + + X_STOP=MCU_ENDSTOP , + PROBE_INPUT=MCU_PROBE1 , PROBE_SENSE=MCU_PROBE2 , + + E_HEATER=MCU_HE0 , + E_TEMPERATURE=MCU_TH0 , + TH_MCU_NTC=MCU_NTC , + + IND_NPN=MCU_IND , FAN0=MCU_FAN , + FAN1=MCU_FAN1_PWM , FAN2=MCU_FAN2_PWM , + FAN3_TACH=MCU_4WFAN_TACH , FAN3=MCU_4WFAN_PWM , + + LIS2DW_MISO=MCU_LIS2DW_MISO , LIS2DW_CS=MCU_LIS2DW_CS , LIS2DW_CK=MCU_LIS2DW_CK , + LIS2DW_MOSI=MCU_LIS2DW_MOSI , LIS2DW_INT1=MCU_LIS2DW_INT1 , + + I2C_SCL=MCU_I2C_SCL , I2C_SDA=MCU_I2C_SDA , + + TOOLHEAD_RGB=MCU_RGB , STATUS_LED=MCU_STATUS + + +#----------------------------------------# +# BTT SB2209 v1.0 pins remapping # +#----------------------------------------# + +[extruder] +step_pin: toolhead:E_STEP +dir_pin: !toolhead:E_DIR +enable_pin: !toolhead:E_ENABLE +heater_pin: toolhead:E_HEATER +pullup_resistor: 2200 # 2.2K +sensor_pin: toolhead:E_TEMPERATURE + +[tmc2209 extruder] +uart_pin: toolhead:E_TMCUART + + +[fan] # fan1 +pin: toolhead:FAN1 + +[heater_fan hotend_fan] # fan2 +pin: toolhead:FAN2 +heater: extruder +heater_temp: 50.0 + +### IND or FAN connector +## Cannot be used with NPN or PNP proximity sensor +## Set jumper on board to FAN +[fan_generic fan0] # IND or FAN connector +pin: toolhead:FAN0 + +[fan_generic 4W_FAN] +pin: toolhead:FAN3 +tachometer_pin: toolhead:FAN3_TACH +#tachometer_ppr: 1 + +[neopixel hotend_rgb] +pin: toolhead:TOOLHEAD_RGB + +[temperature_sensor toolhead_mcu] +sensor_type: Generic 3950 +sensor_pin: toolhead:TH_MCU_NTC +min_temp = 0 +max_temp = 100 + +## Uncomment the following line if not using sensorless homing +## and having the X endstop plugged to the toolhead MCU. Make sure +## X endstop is plugged in to IO.1 on the board. +# [stepper_x] +# endstop_pin: ^toolhead:X_STOP + +#### LIS2DW Input Shaper #### +# Change probe_points to best location for resonance testing +# Include the IS calibration macros to unlock them when +# an accelerometer is installed on the machine +[lis2dw] +cs_pin: toolhead:LIS2DW_CS +spi_bus: spi0a +axes_map: x,y,z + +[resonance_tester] +accel_chip: lis2dw +probe_points: 100,100,20 + +[include ./macros/helpers/resonance_override.cfg] +[include ./scripts/K-ShakeTune/K-SnT_*.cfg] + +### Uncomment if using bltouch #### +#[bltouch] +#sensor_pin: ^toolhead:PROBE_SENSE +#control_pin: toolhead:PROBE_INPUT + +#### Uncomment if using NPN or PNP proximity sensor +## NPN and PNP proximity switch types can be set by jumper +## Cannot be used at the same time as FAN0, set jumper on +## board to IND +#[probe] +#pin: ^toolhead:IND_NPN