SKR 2 PWM Laser control problem

Hello, I have a SKR 2 REV B with TMC2209 drivers.
I would like to build a laser engraver on the basis of this motherboard.

I have a problem with controlling the laser.
The laser has three wires: GND, VCC and Signal PWM.

After connecting to the PWM generator, I checked the laser and everything works ok.

Unfortunately, I can’t configure my motherboard correctly in Marlin-





#define SPINDLE_LASER_ACTIVE_STATE HIGH // Set to “HIGH” if the on/off function is active HIGH

#define SPINDLE_LASER_PWM true // Set to “true” if your controller supports setting the speed/power

#define SPINDLE_LASER_PWM_INVERT false // Set to “true” if the speed/power goes up when you want it to go slower

#define SPINDLE_LASER_FREQUENCY 2000 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)

//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11


#define AIR_EVACUATION_ACTIVE       LOW    // Set to "HIGH" if the on/off function is active HIGH

//#define AIR_EVACUATION_PIN        42     // Override the default Cutter Vacuum or Laser Blower pin


//#define AIR_ASSIST // Air Assist control with G-codes M8-M9


#define AIR_ASSIST_ACTIVE           LOW    // Active state on air assist pin

//#define AIR_ASSIST_PIN            44     // Override the default Air Assist pin


//#define SPINDLE_SERVO // A servo converting an angle to spindle power


#define SPINDLE_SERVO_NR   0               // Index of servo used for spindle control

#define SPINDLE_SERVO_MIN 10               // Minimum angle for servo spindle



  • Speed / Power can be set (‘M3 S’) and displayed in terms of:

    • PWM255 (S0 - S255)
    • PERCENT (S0 - S100)
    • RPM (S0 - S50000) Best for use with a spindle
    • SERVO (S0 - S180)



I have declared PWM laser control on the EX0 output. Unfortunately, no singal PWM appears on the output.
Tried to steer the laser power (PWM) through the reprap controller.

Do you need to excite EX0 (mosfet) through the resistor to the 12V line?
Could it be done differently better. And how to connect my 3-wire laser to this SKR 2 configuration?

Thank you in advance for your help, this is my first marlin project. I apologize for any obvious errors.