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-2.0.9.1.

#define LASER_FEATURE

#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)

#define SPINDLE_LASER_ENA_PIN PB4

#define SPINDLE_LASER_PWM_PIN PB3

#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

#if ENABLED(AIR_EVACUATION)

#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

#endif

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

#if ENABLED(AIR_ASSIST)

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

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

#endif

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

#ifdef SPINDLE_SERVO

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

#define SPINDLE_SERVO_MIN 10               // Minimum angle for servo spindle

#endif

/**

  • 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)

*/

#define CUTTER_POWER_UNIT PWM255

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.

Hi
You find solution for that problem ?
i have the same issue

I haven’t tried it but removing the reference to “true” in the #define SPINDLE_LASER_PWM statement may help. Seems the syntax changed in the more recent Marlin releases as per kcny’s Oct '21 post.